diff --git a/.gitattributes b/.gitattributes index 3425314b0536904553bdecdc2cf1e9fd19e6bdaf..73bac7568c8b886f8c4895e0a241ee638a9e91fe 100644 --- a/.gitattributes +++ b/.gitattributes @@ -135,6 +135,13 @@ tests/bzip2/data/compression_input1 -text tests/bzip2/data/decompression_input1 -text tests/bzip2/test_script.sh -text tests/cal/test_script.sh -text +tests/du/data/dir1/dir2/readme -text +tests/du/data/dir1/hello2 -text +tests/du/data/dir1/yo2.xls -text +tests/du/data/hello1 -text +tests/du/data/test.tar -text +tests/du/data/yo.txt -text +tests/du/test_script.sh -text tests/egrep/data/data1.txt -text tests/egrep/data/data2.txt -text tests/egrep/data/khadafy.lines -text diff --git a/tests/du/data/dir1/dir2/readme b/tests/du/data/dir1/dir2/readme new file mode 100644 index 0000000000000000000000000000000000000000..8178c76d627cade75005b40711b92f4177bc6cfc --- /dev/null +++ b/tests/du/data/dir1/dir2/readme @@ -0,0 +1 @@ +readme diff --git a/tests/du/data/dir1/hello2 b/tests/du/data/dir1/hello2 new file mode 100644 index 0000000000000000000000000000000000000000..14be0d41c639d701e0fe23e835b5fe9524b4459d --- /dev/null +++ b/tests/du/data/dir1/hello2 @@ -0,0 +1 @@ +hello2 diff --git a/tests/du/data/dir1/yo2.xls b/tests/du/data/dir1/yo2.xls new file mode 100644 index 0000000000000000000000000000000000000000..55a3a19164a73fb7b11117bebdc9ccdb203bd988 --- /dev/null +++ b/tests/du/data/dir1/yo2.xls @@ -0,0 +1 @@ +23,34,45 diff --git a/tests/du/data/hello1 b/tests/du/data/hello1 new file mode 100644 index 0000000000000000000000000000000000000000..15b8f2a8ffc8a7789b65fdcf2505f23ea9e4dde0 --- /dev/null +++ b/tests/du/data/hello1 @@ -0,0 +1 @@ +hello1 diff --git a/tests/du/data/test.tar b/tests/du/data/test.tar new file mode 100644 index 0000000000000000000000000000000000000000..adf61fcdebfc9c4ae606533f9a505c75b91bc02c Binary files /dev/null and b/tests/du/data/test.tar differ diff --git a/tests/du/data/yo.txt b/tests/du/data/yo.txt new file mode 100644 index 0000000000000000000000000000000000000000..f2d0f0d5c45102b9d2947c0edf358eb1487a1469 --- /dev/null +++ b/tests/du/data/yo.txt @@ -0,0 +1 @@ +yo yo yo diff --git a/tests/du/test_script.sh b/tests/du/test_script.sh new file mode 100755 index 0000000000000000000000000000000000000000..d208e7a1098617b9d31763e732461f5c9f63e328 --- /dev/null +++ b/tests/du/test_script.sh @@ -0,0 +1,57 @@ +#!/bin/bash +#Everyone must point to the manual test library +TEST_LIB=$PEASOUP_HOME/tests/manual_test_lib.sh + + +#for grep, I use some data files, so I set up variables pointing to that location +TEST_DIR=$PEASOUP_HOME/tests/du +DATA_DIR=$TEST_DIR/data + +#used for filtering program names from output. +ORIG_NAME=du + +#must import the library here, as it depends on some of the above variables +. $TEST_LIB + +#run_basic_test will run both the modified program and original program using the same arguments. The first argument ot run_basic_test is the timeout value (in seconds) followed by the arguments for the programs. run_basic_test also does comparisons of stdout, stderr, and the exit status, and only does comparisons and uses timeout when the -i flag is not set. See the library for more details. + +pwd +echo "TEST_PROG: $TEST_PROG" + +run_basic_test 120 --help +run_basic_test 120 --version +run_basic_test 120 --doesnotexist +run_basic_test 120 $DATA_DIR +run_basic_test 120 -0 $DATA_DIR +run_basic_test 120 --null $DATA_DIR +run_basic_test 120 -a $DATA_DIR +run_basic_test 120 --all $DATA_DIR +run_basic_test 120 --all --apparent-size $DATA_DIR +run_basic_test 120 -a -BM $DATA_DIR +run_basic_test 120 -b $DATA_DIR +run_basic_test 120 -c $DATA_DIR +run_basic_test 120 --summarize $DATA_DIR +run_basic_test 120 -bh $DATA_DIR +run_basic_test 120 --all -h $DATA_DIR +run_basic_test 120 -L $DATA_DIR +run_basic_test 120 -l $DATA_DIR +run_basic_test 120 -m $DATA_DIR +run_basic_test 120 -P $DATA_DIR +run_basic_test 120 -S $DATA_DIR +run_basic_test 120 --si $DATA_DIR +run_basic_test 120 -s $DATA_DIR +run_basic_test 120 -t $DATA_DIR +run_basic_test 120 --time $DATA_DIR +run_basic_test 120 --time-style=full-iso $DATA_DIR +run_basic_test 120 --time-style=long-iso $DATA_DIR +run_basic_test 120 --time-style=iso $DATA_DIR +run_basic_test 120 --exclude-from=$DATA_DIR/yo.txt $DATA_DIR +run_basic_test 120 --exclude=foobar $DATA_DIR +run_basic_test 120 --exclude="*.txt" $DATA_DIR +run_basic_test 120 -x $DATA_DIR + + + +cleanup + +report_success