diff --git a/.gitattributes b/.gitattributes index bf040c0bf8c554d8528bb60c6b67f877bbd09bfd..49c918f89d6906da368a11ca9158eb6c43824b53 100644 --- a/.gitattributes +++ b/.gitattributes @@ -155,6 +155,12 @@ tests/grep/data/khadafy.regexp -text tests/grep/data/pattern -text tests/grep/data/pattern2 -text tests/grep/test_script.sh -text +tests/ls/data/dir1/dir2/readme -text +tests/ls/data/dir1/hello2 -text +tests/ls/data/dir1/yo2.xls -text +tests/ls/data/hello1 -text +tests/ls/data/yo.txt -text +tests/ls/test_script.sh -text tests/manual_test_lib.sh -text tests/nginx/data/conf/fastcgi.conf -text tests/nginx/data/conf/fastcgi.conf.default -text diff --git a/tests/ls/data/dir1/dir2/readme b/tests/ls/data/dir1/dir2/readme new file mode 100644 index 0000000000000000000000000000000000000000..8178c76d627cade75005b40711b92f4177bc6cfc --- /dev/null +++ b/tests/ls/data/dir1/dir2/readme @@ -0,0 +1 @@ +readme diff --git a/tests/ls/data/dir1/hello2 b/tests/ls/data/dir1/hello2 new file mode 100644 index 0000000000000000000000000000000000000000..14be0d41c639d701e0fe23e835b5fe9524b4459d --- /dev/null +++ b/tests/ls/data/dir1/hello2 @@ -0,0 +1 @@ +hello2 diff --git a/tests/ls/data/dir1/yo2.xls b/tests/ls/data/dir1/yo2.xls new file mode 100644 index 0000000000000000000000000000000000000000..55a3a19164a73fb7b11117bebdc9ccdb203bd988 --- /dev/null +++ b/tests/ls/data/dir1/yo2.xls @@ -0,0 +1 @@ +23,34,45 diff --git a/tests/ls/data/hello1 b/tests/ls/data/hello1 new file mode 100644 index 0000000000000000000000000000000000000000..15b8f2a8ffc8a7789b65fdcf2505f23ea9e4dde0 --- /dev/null +++ b/tests/ls/data/hello1 @@ -0,0 +1 @@ +hello1 diff --git a/tests/ls/data/yo.txt b/tests/ls/data/yo.txt new file mode 100644 index 0000000000000000000000000000000000000000..f2d0f0d5c45102b9d2947c0edf358eb1487a1469 --- /dev/null +++ b/tests/ls/data/yo.txt @@ -0,0 +1 @@ +yo yo yo diff --git a/tests/ls/test_script.sh b/tests/ls/test_script.sh new file mode 100755 index 0000000000000000000000000000000000000000..424cb67c73932a94e94985217893637d6799f148 --- /dev/null +++ b/tests/ls/test_script.sh @@ -0,0 +1,48 @@ +#!/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/ls +DATA_DIR=$TEST_DIR/data + +#used for filtering program names from output. +ORIG_NAME=ls + +#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 ls $DATA_DIR +run_basic_test 120 ls $DATA_DIR/not-exist +run_basic_test 120 ls -a $DATA_DIR +run_basic_test 120 ls -l $DATA_DIR +run_basic_test 120 ls -ltr $DATA_DIR +run_basic_test 120 ls -ltrR $DATA_DIR +run_basic_test 120 ls -ha $DATA_DIR +run_basic_test 120 ls -Z $DATA_DIR +run_basic_test 120 ls -Rd $DATA_DIR +run_basic_test 120 ls -Rlg $DATA_DIR +run_basic_test 120 ls -lC -s $DATA_DIR +run_basic_test 120 ls -C --color=always $DATA_DIR +run_basic_test 120 ls -F $DATA_DIR +run_basic_test 120 ls -Fg $DATA_DIR +run_basic_test 120 ls -ha --si $DATA_DIR +run_basic_test 120 ls -ha --si -i $DATA_DIR +run_basic_test 120 ls -lt --time-style=full-iso $DATA_DIR +run_basic_test 120 ls -lt --time-style=long-iso $DATA_DIR +run_basic_test 120 ls -lt --time-style=iso $DATA_DIR +run_basic_test 120 ls -lt --tabsize=4 --time-style=iso $DATA_DIR +run_basic_test 120 ls -ltZ $DATA_DIR + +cleanup + +report_success