2 # export the testsuite files to a separate tar
4 if ! [ -f testsuite-files ]; then
5 echo "ERROR: cannot find testsuite-files"
11 TESTSUITE_TAR="btrfs-progs-tests.tar.gz"
12 rm -f "$TESTSUITE_TAR"
14 TIMESTAMP=`date -u "+%Y-%m-%d %T %Z"`
17 echo "VERSION=`cat ../VERSION`"
18 echo "GIT_VERSION=`git describe`"
19 echo "TIMESTAMP='$TIMESTAMP'"
22 # Due to potentially unwanted files in the testsuite (restored images or other
23 # temporary files) we can't simply copy everything so the tar
25 # The testsuite-files specifier:
27 # - directly copy the file from the given path, may be a git tracked file or
30 # - a path relative to the top of git, recursively traversed; path
31 # postprocessing is needed so the tar gets it relative to tests/
38 git ls-tree -r --name-only --full-name HEAD "$f" |
39 sed -e 's#^tests/##' |
40 sed -e 's#^Documentation#../Documentation#'
44 done < testsuite-files > testsuite-files-all
46 echo "create tar: $TESTSUITE_TAR"
47 tar cz --sparse -f "$TESTSUITE_TAR" -T testsuite-files-all
49 echo "tar created successfully"
51 rm -f testsuite-files-all