From f61d0a9de4b71a445ef13d415058dac533eaaba4 Mon Sep 17 00:00:00 2001 From: an7s <an7s@git.zephyr-software.com> Date: Fri, 8 Jan 2016 20:08:47 +0000 Subject: [PATCH] Added ls to test suite Former-commit-id: a45681147a51d8df8266c6768c138d318e8c62b5 --- .gitattributes | 6 +++++ tests/ls/data/dir1/dir2/readme | 1 + tests/ls/data/dir1/hello2 | 1 + tests/ls/data/dir1/yo2.xls | 1 + tests/ls/data/hello1 | 1 + tests/ls/data/yo.txt | 1 + tests/ls/test_script.sh | 48 ++++++++++++++++++++++++++++++++++ 7 files changed, 59 insertions(+) create mode 100644 tests/ls/data/dir1/dir2/readme create mode 100644 tests/ls/data/dir1/hello2 create mode 100644 tests/ls/data/dir1/yo2.xls create mode 100644 tests/ls/data/hello1 create mode 100644 tests/ls/data/yo.txt create mode 100755 tests/ls/test_script.sh diff --git a/.gitattributes b/.gitattributes index bf040c0bf..49c918f89 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 000000000..8178c76d6 --- /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 000000000..14be0d41c --- /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 000000000..55a3a1916 --- /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 000000000..15b8f2a8f --- /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 000000000..f2d0f0d5c --- /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 000000000..424cb67c7 --- /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 -- GitLab