aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2018-12-02 16:53:03 -0600
committerRob Landley <rob@landley.net>2018-12-02 16:53:03 -0600
commitb742998a2671818ceb5295d1a3f2f2c062a39028 (patch)
treea222febb10fca4df789d31b9536a257ae619b527
parent01844db4fb92aa7ae6eb12b160f1978235a449d5 (diff)
downloadtoybox-b742998a2671818ceb5295d1a3f2f2c062a39028.tar.gz
Teach testcmd to say short name rather than full path.
-rwxr-xr-xscripts/test.sh4
-rw-r--r--tests/test.test26
2 files changed, 19 insertions, 11 deletions
diff --git a/scripts/test.sh b/scripts/test.sh
index 490750cc..f7ad4a1e 100755
--- a/scripts/test.sh
+++ b/scripts/test.sh
@@ -129,7 +129,9 @@ testcmd()
{
wrong_args "$@"
- testing "$1" "$C $2" "$3" "$4" "$5"
+ X="$1"
+ [ -z "$X" ] && X="$CMDNAME $2"
+ testing "$X" "$C $2" "$3" "$4" "$5"
}
# Recursively grab an executable and all the libraries needed to run it.
diff --git a/tests/test.test b/tests/test.test
index 8b60c0bd..7f574f08 100644
--- a/tests/test.test
+++ b/tests/test.test
@@ -44,16 +44,16 @@ rmdir d
# TODO: Test rwx gu t
-testing "" "$C '' || echo yes" "yes\n" "" ""
-testing "" "$C a && echo yes" "yes\n" "" ""
-testing "-n" "$C -n '' || echo yes" "yes\n" "" ""
-testing "-n2" "$C -n a && echo yes" "yes\n" "" ""
-testing "-z" "$C -z '' && echo yes" "yes\n" "" ""
-testing "-z2" "$C -z a || echo yes" "yes\n" "" ""
-testing "" "$C a = b || echo yes" "yes\n" "" ""
-testing "" "$C '' = '' && echo yes" "yes\n" "" ""
-testing "a != b" "$C a != b && echo yes" "yes\n" "" ""
-testing "a != b" "$C a != a || echo yes" "yes\n" "" ""
+testcmd "" "'' || echo yes" "yes\n" "" ""
+testcmd "" "a && echo yes" "yes\n" "" ""
+testcmd "-n" "-n '' || echo yes" "yes\n" "" ""
+testcmd "-n2" "-n a && echo yes" "yes\n" "" ""
+testcmd "-z" "-z '' && echo yes" "yes\n" "" ""
+testcmd "-z2" "-z a || echo yes" "yes\n" "" ""
+testcmd "" "a = b || echo yes" "yes\n" "" ""
+testcmd "" "'' = '' && echo yes" "yes\n" "" ""
+testcmd "a != b" "a != b && echo yes" "yes\n" "" ""
+testcmd "a != b" "a != a || echo yes" "yes\n" "" ""
arith_test()
{
@@ -80,3 +80,9 @@ testing "-le" "arith_test -le" "le" "" ""
# -e == -a -o -d != -o
# \( "x" \) -a \) == \)
# \( ! ! ! -e \) \)
+
+# // () -a (() -a () -o ()) -o ()
+# // x -a ( x -o x ) -a x
+# // x -o ( x -a x ) -a x -o x
+
+# trailing ! and (