aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test
diff options
context:
space:
mode:
authorGravatar hlopko <hlopko@google.com>2017-08-03 14:14:48 +0200
committerGravatar Dmitry Lomov <dslomov@google.com>2017-08-03 15:43:16 +0200
commitb3be32e7135895737b64e3ad8ddb09176bfc8dd5 (patch)
tree98cb5d34f25a4be1c22accfb7f0ada15abff3a10 /src/test
parentca9290380880ecc0370cea53a26e647cd527c29f (diff)
Use feature configuration to construct command line for 'strip' action
This cl introduces new action_config named 'strip' for the strip action. While at it, it fixes support for executionRequirements. Fixed #209 RELNOTES: 'strip' action is now configured via feature configuration PiperOrigin-RevId: 164110478
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL370
-rw-r--r--src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java6
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java1
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java1
4 files changed, 376 insertions, 2 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL b/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL
index 0a87b1c73c..fb072bda32 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL
+++ b/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL
@@ -1189,6 +1189,43 @@ toolchain {
}
}
action_config {
+ config_name: "strip"
+ action_name: "strip"
+ tool {
+ tool_path: "mac/strip"
+ }
+ flag_set {
+ flag_group {
+ flag: "-S"
+ flag: "-o"
+ flag: "%{output_file}"
+ flag: "-R"
+ flag: ".gnu.switches.text.quote_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.bracket_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.system_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_defines"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_includes"
+ flag: "-R"
+ flag: ".gnu.switches.text.cl_args"
+ flag: "-R"
+ flag: ".gnu.switches.text.lipo_info"
+ flag: "-R"
+ flag: ".gnu.switches.text.annotation"
+ }
+ flag_group {
+ flag: "%{stripopts}"
+ iterate_over: "stripopts"
+ }
+ flag_group {
+ flag: "%{input_file}"
+ }
+ }
+ }
+ action_config {
config_name: "c-compile"
action_name: "c-compile"
tool {
@@ -2773,6 +2810,43 @@ toolchain {
}
}
action_config {
+ config_name: "strip"
+ action_name: "strip"
+ tool {
+ tool_path: "mac/strip"
+ }
+ flag_set {
+ flag_group {
+ flag: "-S"
+ flag: "-o"
+ flag: "%{output_file}"
+ flag: "-R"
+ flag: ".gnu.switches.text.quote_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.bracket_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.system_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_defines"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_includes"
+ flag: "-R"
+ flag: ".gnu.switches.text.cl_args"
+ flag: "-R"
+ flag: ".gnu.switches.text.lipo_info"
+ flag: "-R"
+ flag: ".gnu.switches.text.annotation"
+ }
+ flag_group {
+ flag: "%{stripopts}"
+ iterate_over: "stripopts"
+ }
+ flag_group {
+ flag: "%{input_file}"
+ }
+ }
+ }
+ action_config {
config_name: "c-compile"
action_name: "c-compile"
tool {
@@ -4365,6 +4439,43 @@ toolchain {
}
}
action_config {
+ config_name: "strip"
+ action_name: "strip"
+ tool {
+ tool_path: "iossim/strip"
+ }
+ flag_set {
+ flag_group {
+ flag: "-S"
+ flag: "-o"
+ flag: "%{output_file}"
+ flag: "-R"
+ flag: ".gnu.switches.text.quote_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.bracket_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.system_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_defines"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_includes"
+ flag: "-R"
+ flag: ".gnu.switches.text.cl_args"
+ flag: "-R"
+ flag: ".gnu.switches.text.lipo_info"
+ flag: "-R"
+ flag: ".gnu.switches.text.annotation"
+ }
+ flag_group {
+ flag: "%{stripopts}"
+ iterate_over: "stripopts"
+ }
+ flag_group {
+ flag: "%{input_file}"
+ }
+ }
+ }
+ action_config {
config_name: "c-compile"
action_name: "c-compile"
tool {
@@ -5961,6 +6072,43 @@ toolchain {
}
}
action_config {
+ config_name: "strip"
+ action_name: "strip"
+ tool {
+ tool_path: "watchsim/strip"
+ }
+ flag_set {
+ flag_group {
+ flag: "-S"
+ flag: "-o"
+ flag: "%{output_file}"
+ flag: "-R"
+ flag: ".gnu.switches.text.quote_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.bracket_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.system_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_defines"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_includes"
+ flag: "-R"
+ flag: ".gnu.switches.text.cl_args"
+ flag: "-R"
+ flag: ".gnu.switches.text.lipo_info"
+ flag: "-R"
+ flag: ".gnu.switches.text.annotation"
+ }
+ flag_group {
+ flag: "%{stripopts}"
+ iterate_over: "stripopts"
+ }
+ flag_group {
+ flag: "%{input_file}"
+ }
+ }
+ }
+ action_config {
config_name: "c-compile"
action_name: "c-compile"
tool {
@@ -7585,6 +7733,43 @@ toolchain {
}
}
action_config {
+ config_name: "strip"
+ action_name: "strip"
+ tool {
+ tool_path: "tvsim/strip"
+ }
+ flag_set {
+ flag_group {
+ flag: "-S"
+ flag: "-o"
+ flag: "%{output_file}"
+ flag: "-R"
+ flag: ".gnu.switches.text.quote_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.bracket_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.system_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_defines"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_includes"
+ flag: "-R"
+ flag: ".gnu.switches.text.cl_args"
+ flag: "-R"
+ flag: ".gnu.switches.text.lipo_info"
+ flag: "-R"
+ flag: ".gnu.switches.text.annotation"
+ }
+ flag_group {
+ flag: "%{stripopts}"
+ iterate_over: "stripopts"
+ }
+ flag_group {
+ flag: "%{input_file}"
+ }
+ }
+ }
+ action_config {
config_name: "c-compile"
action_name: "c-compile"
tool {
@@ -9186,6 +9371,43 @@ toolchain {
}
}
action_config {
+ config_name: "strip"
+ action_name: "strip"
+ tool {
+ tool_path: "iossim/strip"
+ }
+ flag_set {
+ flag_group {
+ flag: "-S"
+ flag: "-o"
+ flag: "%{output_file}"
+ flag: "-R"
+ flag: ".gnu.switches.text.quote_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.bracket_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.system_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_defines"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_includes"
+ flag: "-R"
+ flag: ".gnu.switches.text.cl_args"
+ flag: "-R"
+ flag: ".gnu.switches.text.lipo_info"
+ flag: "-R"
+ flag: ".gnu.switches.text.annotation"
+ }
+ flag_group {
+ flag: "%{stripopts}"
+ iterate_over: "stripopts"
+ }
+ flag_group {
+ flag: "%{input_file}"
+ }
+ }
+ }
+ action_config {
config_name: "c-compile"
action_name: "c-compile"
tool {
@@ -10805,6 +11027,43 @@ toolchain {
}
}
action_config {
+ config_name: "strip"
+ action_name: "strip"
+ tool {
+ tool_path: "ios/strip"
+ }
+ flag_set {
+ flag_group {
+ flag: "-S"
+ flag: "-o"
+ flag: "%{output_file}"
+ flag: "-R"
+ flag: ".gnu.switches.text.quote_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.bracket_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.system_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_defines"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_includes"
+ flag: "-R"
+ flag: ".gnu.switches.text.cl_args"
+ flag: "-R"
+ flag: ".gnu.switches.text.lipo_info"
+ flag: "-R"
+ flag: ".gnu.switches.text.annotation"
+ }
+ flag_group {
+ flag: "%{stripopts}"
+ iterate_over: "stripopts"
+ }
+ flag_group {
+ flag: "%{input_file}"
+ }
+ }
+ }
+ action_config {
config_name: "c-compile"
action_name: "c-compile"
tool {
@@ -12424,6 +12683,43 @@ toolchain {
}
}
action_config {
+ config_name: "strip"
+ action_name: "strip"
+ tool {
+ tool_path: "watchos/strip"
+ }
+ flag_set {
+ flag_group {
+ flag: "-S"
+ flag: "-o"
+ flag: "%{output_file}"
+ flag: "-R"
+ flag: ".gnu.switches.text.quote_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.bracket_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.system_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_defines"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_includes"
+ flag: "-R"
+ flag: ".gnu.switches.text.cl_args"
+ flag: "-R"
+ flag: ".gnu.switches.text.lipo_info"
+ flag: "-R"
+ flag: ".gnu.switches.text.annotation"
+ }
+ flag_group {
+ flag: "%{stripopts}"
+ iterate_over: "stripopts"
+ }
+ flag_group {
+ flag: "%{input_file}"
+ }
+ }
+ }
+ action_config {
config_name: "c-compile"
action_name: "c-compile"
tool {
@@ -14071,6 +14367,43 @@ toolchain {
}
}
action_config {
+ config_name: "strip"
+ action_name: "strip"
+ tool {
+ tool_path: "tvos/strip"
+ }
+ flag_set {
+ flag_group {
+ flag: "-S"
+ flag: "-o"
+ flag: "%{output_file}"
+ flag: "-R"
+ flag: ".gnu.switches.text.quote_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.bracket_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.system_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_defines"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_includes"
+ flag: "-R"
+ flag: ".gnu.switches.text.cl_args"
+ flag: "-R"
+ flag: ".gnu.switches.text.lipo_info"
+ flag: "-R"
+ flag: ".gnu.switches.text.annotation"
+ }
+ flag_group {
+ flag: "%{stripopts}"
+ iterate_over: "stripopts"
+ }
+ flag_group {
+ flag: "%{input_file}"
+ }
+ }
+ }
+ action_config {
config_name: "c-compile"
action_name: "c-compile"
tool {
@@ -15695,6 +16028,43 @@ toolchain {
}
}
action_config {
+ config_name: "strip"
+ action_name: "strip"
+ tool {
+ tool_path: "ios/strip"
+ }
+ flag_set {
+ flag_group {
+ flag: "-S"
+ flag: "-o"
+ flag: "%{output_file}"
+ flag: "-R"
+ flag: ".gnu.switches.text.quote_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.bracket_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.system_paths"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_defines"
+ flag: "-R"
+ flag: ".gnu.switches.text.cpp_includes"
+ flag: "-R"
+ flag: ".gnu.switches.text.cl_args"
+ flag: "-R"
+ flag: ".gnu.switches.text.lipo_info"
+ flag: "-R"
+ flag: ".gnu.switches.text.annotation"
+ }
+ flag_group {
+ flag: "%{stripopts}"
+ iterate_over: "stripopts"
+ }
+ flag_group {
+ flag: "%{input_file}"
+ }
+ }
+ }
+ action_config {
config_name: "c-compile"
action_name: "c-compile"
tool {
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java
index a6ebc585be..7f2ab2b02a 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java
+++ b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java
@@ -448,14 +448,16 @@ public abstract class MockCcSupport {
public static final String EMPTY_CLIF_MATCH_ACTION_CONFIG =
emptyActionConfigFor(CppCompileAction.CLIF_MATCH);
+ public static final String EMPTY_STRIP_ACTION_CONFIG =
+ emptyActionConfigFor(CppCompileAction.STRIP_ACTION_NAME);
+
/**
* Creates action_config for {@code actionName} action using DUMMY_TOOL that doesn't imply any
* features.
*/
private static String emptyActionConfigFor(String actionName) {
return String.format(
- ""
- + "action_config {"
+ "action_config {"
+ " config_name: '%s'"
+ " action_name: '%s'"
+ " tool {"
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java
index 464878197c..7c013507a5 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java
@@ -782,6 +782,7 @@ public class CcLibraryConfiguredTargetTest extends BuildViewTestCase {
MockCcSupport.EMPTY_EXECUTABLE_ACTION_CONFIG,
MockCcSupport.EMPTY_DYNAMIC_LIBRARY_ACTION_CONFIG,
MockCcSupport.EMPTY_STATIC_LIBRARY_ACTION_CONFIG,
+ MockCcSupport.EMPTY_STRIP_ACTION_CONFIG,
MockCcSupport.NO_LEGACY_FEATURES_FEATURE);
useConfiguration();
scratchConfiguredTarget("a", "a",
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
index 9a3ae3ab06..3667a2d21d 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
@@ -88,6 +88,7 @@ public class CppLinkActionTest extends BuildViewTestCase {
"gcc_tool",
"dynamic_library_linker_tool",
"ar_tool",
+ "strip_tool",
true,
false))
.getFeatureConfiguration(