Disable PngSuite test by default.

Results are device-dependent and outside our
control.
This commit is contained in:
akwizgran
2019-12-12 13:24:01 +00:00
parent 24a63b08c0
commit ace1d38966
2 changed files with 18 additions and 2 deletions

View File

@@ -135,6 +135,7 @@ dependencies {
testImplementation "org.jmock:jmock-junit4:$jmockVersion"
testImplementation "org.jmock:jmock-legacy:$jmockVersion"
androidTestImplementation project(path: ':bramble-api', configuration: 'testOutput')
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"

View File

@@ -6,18 +6,30 @@ import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import static java.util.Arrays.asList;
import static java.util.logging.Logger.getLogger;
import static org.briarproject.bramble.api.nullsafety.NullSafety.requireNonNull;
import static org.briarproject.bramble.test.TestUtils.isOptionalTestEnabled;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;
@RunWith(Parameterized.class)
public class PngSuiteAttachmentCreationTaskTest
extends AbstractAttachmentCreationTaskTest {
private static final Logger LOG =
getLogger(PngSuiteAttachmentCreationTaskTest.class.getName());
@Parameters
public static Iterable<String> data() throws IOException {
return asList(requireNonNull(getAssetManager().list("PngSuite")));
List<String> data = new ArrayList<>();
String[] files = requireNonNull(getAssetManager().list("PngSuite"));
for (String filename : files)
if (filename.endsWith(".png")) data.add(filename);
return data;
}
private final String filename;
@@ -28,6 +40,9 @@ public class PngSuiteAttachmentCreationTaskTest
@Test
public void testPngSuiteCompress() throws Exception {
assumeTrue(isOptionalTestEnabled(
PngSuiteAttachmentCreationTaskTest.class));
LOG.info("Testing " + filename);
if (filename.startsWith("x")) {
try {
testCompress("PngSuite/" + filename, "image/png");