diff options
author | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | 2023-10-17 17:02:58 +0000 |
---|---|---|
committer | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | 2023-10-17 10:28:03 -0700 |
commit | cc17cb758a1b87a0acbe6b3bd63c137e728fade0 (patch) | |
tree | f3b6c3f2f1b113e3a685a486e685fc7344fa1a85 | |
parent | 812165111060f8f293aed92263ea1451de5766fc (diff) | |
download | libavc-cc17cb758a1b87a0acbe6b3bd63c137e728fade0.tar.gz |
AvcEncTest: Use MediaPreparer to download test files
Test: atest AvcEncTest
-rw-r--r-- | tests/AndroidTest.xml | 16 | ||||
-rw-r--r-- | tests/DynamicConfig.xml | 20 | ||||
-rw-r--r-- | tests/README.md | 10 |
3 files changed, 36 insertions, 10 deletions
diff --git a/tests/AndroidTest.xml b/tests/AndroidTest.xml index 36d240d..9b8d81a 100644 --- a/tests/AndroidTest.xml +++ b/tests/AndroidTest.xml @@ -18,14 +18,20 @@ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer"> <option name="cleanup" value="true" /> <option name="push" value="AvcEncTest->/data/local/tmp/AvcEncTest/" /> - <option name="push-file" - key="https://storage.googleapis.com/android_media/external/libavc/tests/AvcEncoder.zip?unzip=true" - value="/data/local/tmp/AvcEncTestRes/" /> </target_preparer> - + <target_preparer class="com.android.compatibility.common.tradefed.targetprep.DynamicConfigPusher"> + <option name="target" value="host" /> + <option name="config-filename" value="AvcEncTest" /> + <option name="version" value="1.0"/> + </target_preparer> + <target_preparer class="com.android.compatibility.common.tradefed.targetprep.MediaPreparer"> + <option name="push-all" value="true" /> + <option name="media-folder-name" value="AvcTestRes-1.0"/> + <option name="dynamic-config-module" value="AvcEncTest" /> + </target_preparer> <test class="com.android.tradefed.testtype.GTest" > <option name="native-test-device-path" value="/data/local/tmp" /> <option name="module-name" value="AvcEncTest" /> - <option name="native-test-flag" value="-P /data/local/tmp/AvcEncTestRes/" /> + <option name="native-test-flag" value="-P /sdcard/test/AvcTestRes-1.0/" /> </test> </configuration> diff --git a/tests/DynamicConfig.xml b/tests/DynamicConfig.xml new file mode 100644 index 0000000..4d721cf --- /dev/null +++ b/tests/DynamicConfig.xml @@ -0,0 +1,20 @@ +<!-- Copyright (C) 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<dynamicConfig> + <entry key="media_files_url"> + <value>https://storage.googleapis.com/android_media/external/libavc/tests/AvcTestRes-1.0.zip</value> + </entry> +</dynamicConfig> diff --git a/tests/README.md b/tests/README.md index 43aa2db..7832d5a 100644 --- a/tests/README.md +++ b/tests/README.md @@ -35,7 +35,7 @@ Optionally, enable sanitizers by passing -DSANITIZE $ make ``` -The media files for the tests are present [at](https://storage.googleapis.com/android_media/external/libavc/tests/AvcEncoder.zip). +The media files for the tests are present [at](https://storage.googleapis.com/android_media/external/libavc/tests/AvcTestRes-1.0.zip). Download and extract these the current folder. usage: AvcEncTest -P \<path_to_the local folder\> @@ -61,20 +61,20 @@ To test 32-bit binary push binaries from nativetest. adb push ${OUT}/data/nativetest/AvcEncTest/AvcEncTest /data/local/tmp/ ``` -The resource file for the tests is taken from [here](https://storage.googleapis.com/android_media/external/libavc/tests/AvcEncoder.zip) +The resource file for the tests is taken from [here](https://storage.googleapis.com/android_media/external/libavc/tests/AvcTestRes-1.0.zip) Download, unzip and push these files into device for testing. ``` -adb push AvcEncoder/. /data/local/tmp/ +adb push AvcTestRes-1.0 /sdcard/test/ ``` usage: AvcEncTest -P \<path_to_folder\> ``` -adb shell /data/local/tmp/AvcEncTest -P /data/local/tmp/ +adb shell /data/local/tmp/AvcEncTest -P /sdcard/test/AvcTestRes-1.0/ ``` Alternatively, the test can also be run using atest command. ``` -atest AvcEncTest -- --enable-module-dynamic-download=true +atest AvcEncTest ``` |