diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
2 files changed, 18 insertions, 12 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java index 741c25e35c..78a21cc5a0 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java @@ -296,8 +296,9 @@ public class AndroidInstrumentationTest implements RuleConfiguredTargetFactory { private static String getTestSuitePropertyName(RuleContext ruleContext) throws RuleErrorException { try { - return ResourceFileLoader.loadResource( - AndroidInstrumentationTest.class, TEST_SUITE_PROPERTY_NAME_FILE); + return ResourceFileLoader + .loadResource(AndroidInstrumentationTest.class, TEST_SUITE_PROPERTY_NAME_FILE) + .trim(); } catch (IOException e) { ruleContext.throwWithRuleError("Cannot load test suite property name: " + e.getMessage()); return null; diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/android_instrumentation_test_template.txt b/src/main/java/com/google/devtools/build/lib/rules/android/android_instrumentation_test_template.txt index c4af683ddb..c09d1cef10 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/android_instrumentation_test_template.txt +++ b/src/main/java/com/google/devtools/build/lib/rules/android/android_instrumentation_test_template.txt @@ -72,17 +72,22 @@ fixture_args="%fixture_args%" test_suite_property_name='%test_suite_property_name%' +argv=$(cat <<END +--adb="${adb}" \ +--device_broker_type="${device_broker_type}" \ +--device_script="${device_script}" \ +--data_deps="${data_deps}" \ +--test_label="${test_label}" \ +--apks_to_install="${apks_to_install}" \ +--fixture_scripts="$(printf "%s," "${!device_script_fixtures[@]}")" \ +--hermetic_server_script="${host_service_fixture}" \ +--hermetic_servers="${host_service_fixture_services}" \ +--data_deps="$(printf "%s," "${!device_script_fixtures[@]}")" +END +) + $test_entry_point \ --wrapper_script_flag=--jvm_flag=-D$test_suite_property_name=com.google.android.apps.common.testing.suite.AndroidDeviceTestSuite \ - --adb="${adb}" \ - --device_broker_type="${device_broker_type}" \ - --device_script="${device_script}" \ - --data_deps="${data_deps}" \ - --test_label="${test_label}" \ - --apks_to_install="${apks_to_install}" \ - --fixture_scripts="$(printf "%s," "${!device_script_fixtures[@]}")" \ - --hermetic_server_script="${host_service_fixture}" \ - --hermetic_servers="${host_service_fixture_services}" \ - --data_deps="$(printf "%s," "${!device_script_fixtures[@]}")" \ + --wrapper_script_flag=--jvm_flag=-Dargv="$argv" \ --test_filter="${ANDROID_TESTBRIDGE_TEST_ONLY}" \ "$@" |