diff options
author | 2018-03-21 07:00:35 -0700 | |
---|---|---|
committer | 2018-03-21 07:02:30 -0700 | |
commit | 67549a752c2316234b19d7b50ea84a8ae80d3669 (patch) | |
tree | 563d8d00732e5988d339cc633d8ddf78c7167a0f /src/test/java/com/google/devtools/build/lib/rules | |
parent | a1068c44a700ec2cff84cbd12592e9bfea25d754 (diff) |
Automated rollback of commit 3c5a1098af0c5ae80d4e3b1fc52dd1fef6027d43.
*** Reason for rollback ***
Breaks bazel ci: https://github.com/bazelbuild/bazel/issues/4894#event-1533040075
*** Original change description ***
Add crosstool_lib.bzl and crosstool_utils.bzl
These will be used to rewrite current crosstool autoconfiguration into
action_configs and features.
RELNOTES: None.
PiperOrigin-RevId: 189901308
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD | 5 | ||||
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/cpp/SkylarkCcToolchainConfigureTest.java | 144 |
2 files changed, 3 insertions, 146 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD b/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD index 9d5482bada..7e0b17115b 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD @@ -13,10 +13,7 @@ filegroup( java_test( name = "cpp-rules-tests", srcs = glob(["*.java"]) + ["proto/CcProtoLibraryTest.java"], - resources = [ - "//tools/cpp:crosstool_utils", - "//tools/cpp:lib_cc_configure", - ], + resources = ["//tools/cpp:lib_cc_configure"], tags = ["rules"], test_class = "com.google.devtools.build.lib.AllTests", deps = [ diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/SkylarkCcToolchainConfigureTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/SkylarkCcToolchainConfigureTest.java index c3386fff9a..dbaa612fb3 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/SkylarkCcToolchainConfigureTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/SkylarkCcToolchainConfigureTest.java @@ -27,15 +27,6 @@ import org.junit.runners.JUnit4; public class SkylarkCcToolchainConfigureTest extends EvaluationTestCase { @Test - public void testActionNames() throws Exception { - newTest() - .testStatement("COMPILE_ACTIONS", MutableList.copyOf(env, CcCommon.ALL_COMPILE_ACTIONS)) - .testStatement("LINK_ACTIONS", MutableList.copyOf(env, CcCommon.ALL_LINK_ACTIONS)) - .testStatement("ARCHIVE_ACTIONS", MutableList.copyOf(env, CcCommon.ALL_ARCHIVE_ACTIONS)) - .testStatement("OTHER_ACTIONS", MutableList.copyOf(env, CcCommon.ALL_OTHER_ACTIONS)); - } - - @Test public void testSplitEscaped() throws Exception { newTest() .testStatement("split_escaped('a:b:c', ':')", MutableList.of(env, "a", "b", "c")) @@ -56,135 +47,7 @@ public class SkylarkCcToolchainConfigureTest extends EvaluationTestCase { .testStatement("split_escaped('a%%b', ':')", MutableList.of(env, "a%b")) .testStatement("split_escaped('a%:', ':')", MutableList.of(env, "a:")); } - - @Test - public void testActionConfig() throws Exception { - newTest() - .testStatement( - "action_config('c++-compile', '/usr/bin/gcc')", - "\n" - + " action_config {\n" - + " config_name: 'c++-compile'\n" - + " action_name: 'c++-compile'\n" - + " tool {\n" - + " tool_path: '/usr/bin/gcc'\n" - + " }\n" - + " }"); - } - - @Test - public void testFeature() throws Exception { - newTest() - .testStatement( - "feature(" - + "'fully_static_link', " - + " [ " - + " flag_set(" - + " ['c++-link-dynamic-library', 'c++-link-nodeps-dynamic-library'], " - + " [flag_group([flag('-a'), flag('-b'), flag('-c')])])])", - "\n" - + " feature {\n" - + " name: 'fully_static_link'\n" - + " enabled: true\n" - + " flag_set {\n" - + " action: 'c++-link-dynamic-library'\n" - + " action: 'c++-link-nodeps-dynamic-library'\n" - + " flag_group {\n" - + " flag: '-a'\n" - + " flag: '-b'\n" - + " flag: '-c'\n" - + " }\n" - + " }\n" - + " }"); - } - - @Test - public void testFeatureThoroughly() throws Exception { - newTest() - .testStatement( - "feature(" - + "'fully_static_link', " - + " [ " - + " flag_set(" - + " ['c++-link-dynamic-library'], " - + " [flag_group([flag('-a')])])," - + " flag_set(" - + " ['c++-link-dynamic-library']," - + " [" - + " flag_group(" - + " [flag('-a')]," - + " iterate_over='a')," - + " flag_group(" - + " [flag('-c')]," - + " expand_if_all_available=['a','b']," - + " expand_if_none_available=['a']," - + " expand_if_true=['a','b']," - + " expand_if_false=['a']," - + " expand_if_equal=[['a','val']]," - + " )," - + " flag_group(" - + " [flag('-c')]," - + " iterate_over='a'," - + " expand_if_all_available=['a','b']," - + " expand_if_none_available=['a']," - + " expand_if_true=['a','b']," - + " expand_if_false=['a']," - + " expand_if_equal=[['a','val']]," - + " )" - + " ])," - + " flag_set(" - + " ['c++-link-dynamic-library'], " - + " [flag_group([flag_group([flag('-a')])])])" - + " ])", - "\n" - + " feature {\n" - + " name: 'fully_static_link'\n" - + " enabled: true\n" - + " flag_set {\n" - + " action: 'c++-link-dynamic-library'\n" - + " flag_group {\n" - + " flag: '-a'\n" - + " }\n" - + " }\n" - + " flag_set {\n" - + " action: 'c++-link-dynamic-library'\n" - + " flag_group {\n" - + " iterate_over: 'a'\n" - + " flag: '-a'\n" - + " }\n" - + " flag_group {\n" - + " expand_if_all_available: 'a'\n" - + " expand_if_all_available: 'b'\n" - + " expand_if_none_available: 'a'\n" - + " expand_if_true: 'a'\n" - + " expand_if_true: 'b'\n" - + " expand_if_false: 'a'\n" - + " expand_if_equal { variable: 'a' value: 'val' }\n" - + " flag: '-c'\n" - + " }\n" - + " flag_group {\n" - + " expand_if_all_available: 'a'\n" - + " expand_if_all_available: 'b'\n" - + " expand_if_none_available: 'a'\n" - + " expand_if_true: 'a'\n" - + " expand_if_true: 'b'\n" - + " expand_if_false: 'a'\n" - + " expand_if_equal { variable: 'a' value: 'val' }\n" - + " iterate_over: 'a'\n" - + " flag: '-c'\n" - + " }\n" - + " }\n" - + " flag_set {\n" - + " action: 'c++-link-dynamic-library'\n" - + " flag_group {\n" - + " flag_group {\n" - + " flag: '-a'\n" - + " }\n" - + " }\n" - + " }\n" - + " }"); - } - + private ModalTestCase newTest(String... skylarkOptions) throws IOException { return new SkylarkTest(skylarkOptions) // A mock implementation of Label to be able to parse lib_cc_configure under default @@ -193,9 +56,6 @@ public class SkylarkCcToolchainConfigureTest extends EvaluationTestCase { .setUp("def Label(arg):\n return 42") .setUp( ResourceLoader.readFromResources( - TestConstants.BAZEL_REPO_PATH + "tools/cpp/lib_cc_configure.bzl")) - .setUp( - ResourceLoader.readFromResources( - TestConstants.BAZEL_REPO_PATH + "tools/cpp/crosstool_utils.bzl")); + TestConstants.BAZEL_REPO_PATH + "tools/cpp/lib_cc_configure.bzl")); } } |