btrfs-progs: tests: add script to clean intermediate images

Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
David Sterba 2015-05-25 16:08:46 +02:00
parent 1497c92e67
commit b51cc1d325
2 changed files with 23 additions and 0 deletions

View File

@ -169,6 +169,10 @@ test-fsck: btrfs btrfs-image btrfs-corrupt-block btrfs-debug-tree mkfs.btrfs
@echo " [TEST] fsck-tests.sh" @echo " [TEST] fsck-tests.sh"
$(Q)bash tests/fsck-tests.sh $(Q)bash tests/fsck-tests.sh
test-clean:
@echo "Cleaning tests"
$(Q)bash tests/clean-tests.sh
test: test-fsck test-convert test: test-fsck test-convert
# #

19
tests/clean-tests.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
# remove all intermediate files from tests
if [ "$BUILD_VERBOSE" = 1 ]; then
verbose=-print
fi
SCRIPT_DIR=$(dirname $(readlink -f $0))
TOP=$(readlink -f $SCRIPT_DIR/../)
if ! cd $TOP/tests; then
echo "ERROR: cannot cd to $TOP/tests"
exit 1
fi
find fsck-tests -type f -name '*.restored' $verbose -delete
# do not remove, the file could have special permissions set
echo -n > test.img