platform_system_core/libziparchive/run-ziptool-tests-on-android.sh
Elliott Hughes f276140d0f cli-test: a tool for testing command-line programs.
Not looking for other users right now, this is just enough to test
unzip/zip/zipinfo.

This includes tests for unzip and ziptool, along with a change to
unzip's behavior to fix AOSP `make dist` when using ziptool unzip.

Also add the boilerplate to run these tests on the device, in presubmit.

Fix command name in --help output.

Test: atest ziptool-tests
Change-Id: I5c0215a3ab8cb2cd5fc517ed9c188f81a7bf4520
2019-12-13 12:23:51 -08:00

15 lines
365 B
Bash
Executable file

#!/bin/bash
# Copy the tests across.
adb shell rm -rf /data/local/tmp/ziptool-tests/
adb shell mkdir /data/local/tmp/ziptool-tests/
adb push cli-tests/ /data/local/tmp/ziptool-tests/
#adb push cli-test /data/local/tmp/ziptool-tests/
if tty -s; then
dash_t="-t"
else
dash_t=""
fi
exec adb shell $dash_t cli-test /data/local/tmp/ziptool-tests/cli-tests/*.test