aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/ijar/test
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-06-13 17:39:50 +0200
committerGravatar Yun Peng <pcloudy@google.com>2017-06-14 13:16:12 +0200
commit6186fa5fe9869c6102597b18244fc9546f931632 (patch)
treedcc5d9d6a171d02fe90125e2d83740599dfd8513 /third_party/ijar/test
parent5d660595111ec2a14c87856e76b78422e267c628 (diff)
Add support for zipped LLVM profile files.
This change is a follow-up to a recent change which allowed LLVM raw profile files to be directly used with blaze. This change allows zipped LLVM raw profile files. This uses //tools/zip:zipper to extract the zipped file contents. This also adds a new option to //tools/zip:zipper, 'j', to junk directories while unzipping. Tested: blaze test //devtools/blaze/integration:fdo_test blaze test //third_party/ijar/test:zip_test RELNOTES[NEW]: Zipped LLVM profiles are now supported. PiperOrigin-RevId: 158849516
Diffstat (limited to 'third_party/ijar/test')
-rwxr-xr-xthird_party/ijar/test/zip_test.sh28
1 files changed, 24 insertions, 4 deletions
diff --git a/third_party/ijar/test/zip_test.sh b/third_party/ijar/test/zip_test.sh
index d206a74ee6..d70fa8fcb0 100755
--- a/third_party/ijar/test/zip_test.sh
+++ b/third_party/ijar/test/zip_test.sh
@@ -80,8 +80,8 @@ function test_zipper() {
# Test flatten option
(cd ${TEST_TMPDIR}/test && $ZIPPER cf ${TEST_TMPDIR}/output.zip ${filelist})
$ZIPPER v ${TEST_TMPDIR}/output.zip >$TEST_log
- expect_log "file"
- expect_log "other_file"
+ expect_log "^f .* file$"
+ expect_log "^f .* other_file$"
expect_not_log "path"
expect_not_log "/"
@@ -90,11 +90,31 @@ function test_zipper() {
echo "abcdefghi" >${TEST_TMPDIR}/test.zip
cat ${TEST_TMPDIR}/output.zip >>${TEST_TMPDIR}/test.zip
$ZIPPER v ${TEST_TMPDIR}/test.zip >$TEST_log
- expect_log "file"
- expect_log "other_file"
+ expect_log "^f .* file$"
+ expect_log "^f .* other_file$"
expect_not_log "path"
}
+function test_zipper_junk_paths() {
+ mkdir -p ${TEST_TMPDIR}/test/path/to/some
+ mkdir -p ${TEST_TMPDIR}/test/some/other/path
+ touch ${TEST_TMPDIR}/test/path/to/some/empty_file
+ echo "toto" > ${TEST_TMPDIR}/test/path/to/some/file
+ echo "titi" > ${TEST_TMPDIR}/test/path/to/some/other_file
+ chmod +x ${TEST_TMPDIR}/test/path/to/some/other_file
+ echo "tata" > ${TEST_TMPDIR}/test/file
+ filelist="$(cd ${TEST_TMPDIR}/test && find . | sed 's|^./||' | grep -v '^.$')"
+
+ # Test extract + flatten option
+ (cd ${TEST_TMPDIR}/test && $ZIPPER c ${TEST_TMPDIR}/output.zip ${filelist})
+ $ZIPPER vf ${TEST_TMPDIR}/output.zip >$TEST_log
+ echo $TEST_log
+ expect_log "^f .* file$"
+ expect_log "^f .* other_file$"
+ expect_not_log "path"
+ expect_not_log "/"
+}
+
function test_zipper_unzip_selective_files() {
mkdir -p ${TEST_TMPDIR}/test/path/to/some
mkdir -p ${TEST_TMPDIR}/test/some/other/path