diff options
author | Danny Abukalam <dannyabukalam@codethink.co.uk> | 2012-01-26 17:23:27 +0000 |
---|---|---|
committer | Danny Abukalam <dannyabukalam@codethink.co.uk> | 2012-01-26 17:23:27 +0000 |
commit | 807c3eebe1de06f8a81fd64ede0249a6339f19fe (patch) | |
tree | 65adac868fe030315888e720c4883555a195cec9 /tests/gen.sh | |
parent | 1cc3604133185f822d1e076db455aee1b91a0506 (diff) | |
download | tbdiff-807c3eebe1de06f8a81fd64ede0249a6339f19fe.tar.gz |
Corrupted git repo
Diffstat (limited to 'tests/gen.sh')
-rwxr-xr-x | tests/gen.sh | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/tests/gen.sh b/tests/gen.sh new file mode 100755 index 0000000..6f3e803 --- /dev/null +++ b/tests/gen.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# This script generates seven folders with incremental +# file type additions. This setup allows for the creation +# of patches for cross-platform testing of tbdiff. These patches +# are then commited and recreated and compared on different +# platforms to check compatibility between different systems +# including endianness and architecture. + +. ./test_lib.sh + +labelmeta() { + touch -ht 197001010100.42 $1 + chmod 607 $1 +} + +cleanup() { + for ((i=0; i<8; i++)); do + rm -rf ${nums[$i]} + done +} + +if [ ! -f run_tests.sh ] +then + echo "Test needs to be run from the tests directory" 1>&2 + exit 1 +fi + +if [ ! $(id -u) -eq 0 ] +then + echo "Root." + exit 1 +fi + +if [ -d PATCHES ] +then + echo -n "Overwrite Existing Patches? " + read input + input=`echo $input | tr '[:upper:]' '[:lower:]'` + case "$input" in + [Yy]|'') ;; + [Nn]*) echo "Aborted."; exit 1;; + *) echo "??";; + esac +fi + +rm -rf PATCHES + +mkdir -p zero +mkdir -p PATCHES +for ((i=1; i<8; i++)); do + mkdir -p ${nums[$i]} + cd ${nums[$i]} + insertfiles $i + for ((j=1; j<=$i; j++)); do + labelmeta ${files[$j]} + done + cd .. + tbdiff-create PATCHES/patch${nums[$i]}.tbd ${nums[$(($i - 1))]} ${nums[$i]} +done + +cleanup + +exit 0 |