summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2020-08-24 16:39:11 +0900
committerLorenzo Colitti <lorenzo@google.com>2020-08-24 17:42:10 +0900
commitc8fcf5ef443a7b0142d0fa115d4b419336884291 (patch)
tree1d92573b2ce201ee1b0d26af9daba27b0dcf91b1
parent82f4e345aef14aafec68cc40fbd8dc7dce50b852 (diff)
downloadapf-c8fcf5ef443a7b0142d0fa115d4b419336884291.tar.gz
Add data_bins to apf_run_test so it can run remotely.
Currently it's possible to run apf_run_test locally, but not remotely, because the required binary (apf_run) is not packaged when the test is built. Fix this using the new data_bins property, and remove the useless requires: which was an attempt to fix this problem. Make the test shell script invoke apf_run with "./" because the binary is in the same directory as the test (it used to work when running locally because it was in a directory that was in $PATH). Also annotate the test with a null-device property, since it does not require a device. This does not seem to work with atest but hopefully it does work when running remotely. Bug: 143248826 Test: atest apf_run_test Test: forrest run L17500000674511176 Change-Id: Ifec451c5ab4f4c96ad91a9a64157d88800e443e2
-rw-r--r--Android.bp2
-rwxr-xr-xapf_run_test.sh2
-rw-r--r--apf_run_test.xml2
3 files changed, 3 insertions, 3 deletions
diff --git a/Android.bp b/Android.bp
index b76c858..4d21712 100644
--- a/Android.bp
+++ b/Android.bp
@@ -59,8 +59,8 @@ sh_test_host {
filename: "apf_run_test.sh",
test_suites: ["general-tests"],
test_config: "apf_run_test.xml",
- required: ["apf_run"],
data: ["testdata/*"],
+ data_bins: ["apf_run"],
target: {
darwin: {
enabled: false,
diff --git a/apf_run_test.sh b/apf_run_test.sh
index 12bbfe0..ef47fc8 100755
--- a/apf_run_test.sh
+++ b/apf_run_test.sh
@@ -23,7 +23,7 @@ for prog in testdata/*.program; do
args="$args --age $(cat testdata/$testcase.age)"
fi
- if diff --color -u <(apf_run $args) <(cat $outputpath); then
+ if diff --color -u <(./apf_run $args) <(cat $outputpath); then
echo $testname: $testcase: PASS
else
echo $testname: $testcase: FAIL
diff --git a/apf_run_test.xml b/apf_run_test.xml
index 689d5a6..1719348 100644
--- a/apf_run_test.xml
+++ b/apf_run_test.xml
@@ -15,7 +15,7 @@
-->
<configuration description="Config for running APF tools tests through atest">
<option name="test-suite-tag" value="apf_run_test" />
- <!-- This test requires a device, so it's not annotated with a null-device -->
+ <option name="null-device" value="true" />
<test class="com.android.tradefed.testtype.binary.ExecutableHostTest" >
<option name="binary" value="apf_run_test.sh" />
<!-- Script assumes a relative path with the tests/ folders -->