diff options
author | 2016-08-04 13:48:02 +0000 | |
---|---|---|
committer | 2016-08-04 15:17:48 +0000 | |
commit | 43302f42fc6c2bd342cebc50ca53e52da7727cba (patch) | |
tree | d2f0d8d357f274af760bd53114df21903dcc3e70 /third_party/ijar/test | |
parent | 20e6e8e3885ede8e68a347ca58ea38c4ec05ccc1 (diff) |
zipper now can specify actual path a file is added to
Examples for how to use <zip_path>=<file> syntax:
zipper c x.zip a/b/__init__.py= # Add an empty file at a/b/__init__.py
zipper c x.zip a/b/main.py=foo/bar/bin.py # Add file foo/bar/bin.py at a/b/main.py
--
Change-Id: I3c09dfb31d082f3ca8036e87affc8d99f7e75fe0
Reviewed-on: https://bazel-review.googlesource.com/#/c/4243
MOS_MIGRATED_REVID=129325719
Diffstat (limited to 'third_party/ijar/test')
-rwxr-xr-x | third_party/ijar/test/zip_test.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/third_party/ijar/test/zip_test.sh b/third_party/ijar/test/zip_test.sh index 719f70a908..d206a74ee6 100755 --- a/third_party/ijar/test/zip_test.sh +++ b/third_party/ijar/test/zip_test.sh @@ -148,4 +148,24 @@ function test_zipper_compression() { || fail "Unzip after zipper output differ" } +function test_zipper_specify_path() { + mkdir -p ${TEST_TMPDIR}/files + echo "toto" > ${TEST_TMPDIR}/files/a.txt + echo "titi" > ${TEST_TMPDIR}/files/b.txt + rm -fr ${TEST_TMPDIR}/expect/foo/bar + mkdir -p ${TEST_TMPDIR}/expect/foo/bar + touch ${TEST_TMPDIR}/expect/empty.txt + echo "toto" > ${TEST_TMPDIR}/expect/foo/a.txt + echo "titi" > ${TEST_TMPDIR}/expect/foo/bar/b.txt + rm -fr ${TEST_TMPDIR}/out + mkdir -p ${TEST_TMPDIR}/out + + ${ZIPPER} cC ${TEST_TMPDIR}/output.zip empty.txt= \ + foo/a.txt=${TEST_TMPDIR}/files/a.txt \ + foo/bar/b.txt=${TEST_TMPDIR}/files/b.txt + (cd ${TEST_TMPDIR}/out && $UNZIP -q ${TEST_TMPDIR}/output.zip) + diff -r ${TEST_TMPDIR}/expect ${TEST_TMPDIR}/out &> $TEST_log \ + || fail "Unzip after zipper output is not expected" +} + run_suite "zipper tests" |