diff options
author | 2017-04-18 16:31:34 +0200 | |
---|---|---|
committer | 2017-04-18 16:41:48 +0200 | |
commit | b6cc4c1d35cfc8427ab3ed94b9e8c1f38cd910e0 (patch) | |
tree | 90853914e45dd111a43e14d0d488b9c36ba5ad97 /src/test | |
parent | 7a90b9a409bea4a69e0c80d418c6193d64c8eb3f (diff) |
Automated g4 rollback of commit 501b62716af12ba42c019bd9f231468b3c144757.
*** Reason for rollback ***
Broke //src/test/shell/bazel:cc_inc_library_test on darwin
see http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=darwin-x86_64/704/console
*** Original change description ***
Basic open-source crosstool to support targetting apple platform types.
RELNOTES: None.
PiperOrigin-RevId: 153460334
Diffstat (limited to 'src/test')
-rwxr-xr-x | src/test/shell/bazel/apple/bazel_apple_test.sh | 136 | ||||
-rwxr-xr-x | src/test/shell/bazel/external_correctness_test.sh | 2 | ||||
-rwxr-xr-x | src/test/shell/bazel/remote_execution_test.sh | 7 |
3 files changed, 4 insertions, 141 deletions
diff --git a/src/test/shell/bazel/apple/bazel_apple_test.sh b/src/test/shell/bazel/apple/bazel_apple_test.sh index b34063819a..ac6b17cb15 100755 --- a/src/test/shell/bazel/apple/bazel_apple_test.sh +++ b/src/test/shell/bazel/apple/bazel_apple_test.sh @@ -212,7 +212,7 @@ EOF bazel build --verbose_failures --objccopt=-DCOPTS_FOO=1 -s \ --xcode_version=$XCODE_VERSION \ //ios:swift_lib >$TEST_log 2>&1 || fail "should build" - expect_log "-module-cache-path bazel-out/darwin_x86_64-fastbuild/genfiles/_objc_module_cache" + expect_log "-module-cache-path bazel-out/local-fastbuild/genfiles/_objc_module_cache" } function test_swift_import_objc_framework() { @@ -766,8 +766,8 @@ EOF bazel build --verbose_failures --xcode_version=$XCODE_VERSION -s \ //ios:bin >$TEST_log 2>&1 || fail "should build" - expect_log "-Xlinker -add_ast_path -Xlinker bazel-out/darwin_x86_64-fastbuild/genfiles/ios/dep/_objs/ios_dep.swiftmodule" - expect_log "-Xlinker -add_ast_path -Xlinker bazel-out/darwin_x86_64-fastbuild/genfiles/ios/swift_lib/_objs/ios_swift_lib.swiftmodule" + expect_log "-Xlinker -add_ast_path -Xlinker bazel-out/local-fastbuild/genfiles/ios/dep/_objs/ios_dep.swiftmodule" + expect_log "-Xlinker -add_ast_path -Xlinker bazel-out/local-fastbuild/genfiles/ios/swift_lib/_objs/ios_swift_lib.swiftmodule" } function test_swiftc_script_mode() { @@ -914,134 +914,4 @@ EOF || fail "should contain DWARF data" } -function test_apple_binary_crosstool_ios() { - rm -rf package - mkdir -p package - cat > package/BUILD <<EOF -objc_library( - name = "lib_a", - srcs = ["a.m"], -) -objc_library( - name = "lib_b", - srcs = ["b.m"], - deps = [":cc_lib"], -) -cc_library( - name = "cc_lib", - srcs = ["cc_lib.cc"], -) -apple_binary( - name = "main_binary", - deps = [":lib_a", ":lib_b"], - srcs = ["main.m"], -) -genrule( - name = "lipo_run", - srcs = [":main_binary_lipobin"], - outs = ["lipo_out"], - cmd = - "set -e && " + - "lipo -info \$(location :main_binary_lipobin) > \$(@)", - tags = ["requires-darwin"], -) -EOF - touch package/a.m - touch package/b.m - cat > package/main.m <<EOF -int main() { - return 0; -} -EOF - cat > package/cc_lib.cc << EOF -#include <string> - -std::string GetString() { return "h3ll0"; } -EOF - - bazel build --verbose_failures //package:lipo_out \ - --experimental_enable_objc_cc_deps \ - --experimental_objc_crosstool=all \ - --apple_crosstool_transition \ - --ios_multi_cpus=i386,x86_64 \ - --xcode_version=$XCODE_VERSION \ - || fail "should build apple_binary and obtain info via lipo" - - cat bazel-genfiles/package/lipo_out | grep "i386 x86_64" \ - || fail "expected output binary to be for x86_64 architecture" -} - -function test_apple_binary_crosstool_watchos() { - rm -rf package - mkdir -p package - cat > package/BUILD <<EOF -genrule( - name = "lipo_run", - srcs = [":main_binary_lipobin"], - outs = ["lipo_out"], - cmd = - "set -e && " + - "lipo -info \$(location :main_binary_lipobin) > \$(@)", - tags = ["requires-darwin"], -) - -apple_binary( - name = "main_binary", - srcs = ["main.m"], - deps = [":lib_a"], - platform_type = "watchos", -) -cc_library( - name = "cc_lib", - srcs = ["cc_lib.cc"], -) -# By depending on a library which requires it is built for watchos, -# this test verifies that dependencies of apple_binary are compiled -# for the specified platform_type. -objc_library( - name = "lib_a", - srcs = ["a.m"], - deps = [":cc_lib"], -) -EOF - cat > package/main.m <<EOF -#import <WatchKit/WatchKit.h> - -// Note that WKExtensionDelegate is only available in Watch SDK. -@interface TestInterfaceMain : NSObject <WKExtensionDelegate> -@end - -int main() { - return 0; -} -EOF - cat > package/a.m <<EOF -#import <WatchKit/WatchKit.h> - -// Note that WKExtensionDelegate is only available in Watch SDK. -@interface TestInterfaceA : NSObject <WKExtensionDelegate> -@end - -int aFunction() { - return 0; -} -EOF - cat > package/cc_lib.cc << EOF -#include <string> - -std::string GetString() { return "h3ll0"; } -EOF - - bazel build --verbose_failures //package:lipo_out \ - --experimental_enable_objc_cc_deps \ - --experimental_objc_crosstool=library \ - --apple_crosstool_transition \ - --watchos_cpus=armv7k \ - --xcode_version=$XCODE_VERSION \ - || fail "should build watch binary" - - cat bazel-genfiles/package/lipo_out | grep "armv7k" \ - || fail "expected output binary to be for armv7k architecture" -} - run_suite "apple_tests" diff --git a/src/test/shell/bazel/external_correctness_test.sh b/src/test/shell/bazel/external_correctness_test.sh index 764f5df83d..ea8ad05eb2 100755 --- a/src/test/shell/bazel/external_correctness_test.sh +++ b/src/test/shell/bazel/external_correctness_test.sh @@ -142,7 +142,7 @@ genrule( ) EOF bazel build @a//b/c:echo-d &> $TEST_log || fail "Build failed" - assert_contains "bazel-out/.*-fastbuild/genfiles/external/a/b/c" \ + assert_contains "bazel-out/local.*-fastbuild/genfiles/external/a/b/c" \ "bazel-genfiles/external/a/b/c/d" } diff --git a/src/test/shell/bazel/remote_execution_test.sh b/src/test/shell/bazel/remote_execution_test.sh index 2030efce3a..7dd6949b64 100755 --- a/src/test/shell/bazel/remote_execution_test.sh +++ b/src/test/shell/bazel/remote_execution_test.sh @@ -52,13 +52,6 @@ function tear_down() { } function test_cc_binary() { - if [[ "$PLATFORM" == "darwin" ]]; then - # TODO(b/37355380): This test is disabled due to RemoteWorker not supporting - # setting SDKROOT and DEVELOPER_DIR appropriately, as is required of - # action executors in order to select the appropriate Xcode toolchain. - return 0 - fi - mkdir -p a cat > a/BUILD <<EOF package(default_visibility = ["//visibility:public"]) |