use of com.facebook.buck.testutil.integration.ZipInspector in project buck by facebook.
the class AndroidBinaryIntegrationTest method testX86OnlyCxxLibrary.
@Test
public void testX86OnlyCxxLibrary() throws IOException {
String target = "//apps/sample:app_with_x86_lib";
workspace.runBuckCommand("build", target).assertSuccess();
ZipInspector zipInspector = new ZipInspector(workspace.getPath(BuildTargets.getGenPath(filesystem, BuildTargetFactory.newInstance(target), "%s.apk")));
zipInspector.assertFileDoesNotExist("lib/armeabi-v7a/libnative_cxx_x86-only.so");
zipInspector.assertFileDoesNotExist("lib/armeabi-v7a/libgnustl_shared.so");
zipInspector.assertFileDoesNotExist("lib/armeabi/libnative_cxx_x86-only.so");
zipInspector.assertFileDoesNotExist("lib/armeabi/libgnustl_shared.so");
zipInspector.assertFileExists("lib/x86/libnative_cxx_x86-only.so");
zipInspector.assertFileExists("lib/x86/libgnustl_shared.so");
}
use of com.facebook.buck.testutil.integration.ZipInspector in project buck by facebook.
the class BuiltinApplePackageIntegrationTest method swiftSupportIsOnlyAddedIfPackageContainsSwiftCode.
@Test
public void swiftSupportIsOnlyAddedIfPackageContainsSwiftCode() throws IOException {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "simple_application_bundle_no_debug", tmp);
workspace.setUp();
workspace.enableDirCache();
BuildTarget packageTarget = BuildTargetFactory.newInstance("//:DemoAppPackage");
workspace.runBuckCommand("build", packageTarget.getFullyQualifiedName()).assertSuccess();
workspace.getBuildLog().assertTargetBuiltLocally(packageTarget.getFullyQualifiedName());
ZipInspector zipInspector = new ZipInspector(workspace.getPath(BuildTargets.getGenPath(filesystem, packageTarget, "%s.ipa")));
zipInspector.assertFileDoesNotExist("SwiftSupport");
}
use of com.facebook.buck.testutil.integration.ZipInspector in project buck by facebook.
the class BuiltinApplePackageIntegrationTest method packageHasProperStructureForSwift.
@Test
public void packageHasProperStructureForSwift() throws IOException {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "simple_application_bundle_swift_no_debug", tmp);
workspace.setUp();
workspace.enableDirCache();
BuildTarget packageTarget = BuildTargetFactory.newInstance("//:DemoAppPackage");
workspace.runBuckCommand("build", packageTarget.getFullyQualifiedName()).assertSuccess();
workspace.getBuildLog().assertTargetBuiltLocally(packageTarget.getFullyQualifiedName());
ZipInspector zipInspector = new ZipInspector(workspace.getPath(BuildTargets.getGenPath(filesystem, packageTarget, "%s.ipa")));
zipInspector.assertFileExists("SwiftSupport/iphonesimulator/libswiftCore.dylib");
}
use of com.facebook.buck.testutil.integration.ZipInspector in project buck by facebook.
the class DefaultJavaLibraryIntegrationTest method testSpoolClassFilesDirectlyToJarWithAnnotationProcessor.
@Test
public void testSpoolClassFilesDirectlyToJarWithAnnotationProcessor() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "spool_class_files_directly_to_jar_with_annotation_processor", tmp);
workspace.setUp();
BuildTarget target = BuildTargetFactory.newInstance("//:a");
ProcessResult result = workspace.runBuckBuild(target.getFullyQualifiedName());
result.assertSuccess();
Path classesDir = workspace.getPath(BuildTargets.getScratchPath(filesystem, target, "lib__%s__classes"));
assertThat(Files.exists(classesDir), is(Boolean.TRUE));
assertThat("There should be no class files in disk", ImmutableList.copyOf(classesDir.toFile().listFiles()), hasSize(0));
Path sourcesDir = workspace.getPath(BuildTargets.getAnnotationPath(filesystem, target, "__%s_gen__"));
assertThat(Files.exists(sourcesDir), is(Boolean.TRUE));
assertThat("There should one source file in disk, from the Immutable class.", ImmutableList.copyOf(sourcesDir.toFile().listFiles()), hasSize(1));
Path jarPath = workspace.getPath(BuildTargets.getGenPath(filesystem, target, "lib__%s__output/a.jar"));
assertTrue(Files.exists(jarPath));
ZipInspector zipInspector = new ZipInspector(jarPath);
zipInspector.assertFileDoesNotExist("ImmutableC.java");
zipInspector.assertFileExists("ImmutableC.class");
}
use of com.facebook.buck.testutil.integration.ZipInspector in project buck by facebook.
the class ProjectFilesystemTest method testCreateZipWithEmptyDir.
@Test
public void testCreateZipWithEmptyDir() throws IOException {
tmp.newFolder("foo");
tmp.newFile("foo/bar.txt");
tmp.newFile("foo/baz.txt");
tmp.newFolder("empty");
Path output = tmp.newFile("out.zip");
filesystem.createZip(ImmutableList.of(Paths.get("foo/bar.txt"), Paths.get("foo/baz.txt"), Paths.get("empty")), output);
ZipInspector zipInspector = new ZipInspector(output);
assertEquals(ImmutableSet.of("foo/bar.txt", "foo/baz.txt", "empty/"), zipInspector.getZipFileEntries());
}
Aggregations