summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2005-09-05 09:42:10 +0000
committerstefanf <stefanf@FreeBSD.org>2005-09-05 09:42:10 +0000
commit560cfe4de3e63e664fc297f927e761d8e62afbbb (patch)
tree00a3adcc5b6525f24fde4ca1fd4dfcb2c4741709 /tools
parent549c6812a94339302b34e899ce15d452ed69ef23 (diff)
downloadFreeBSD-src-560cfe4de3e63e664fc297f927e761d8e62afbbb.zip
FreeBSD-src-560cfe4de3e63e664fc297f927e761d8e62afbbb.tar.gz
- Add tests for hash and return and more tests for set -e.
- Simplify regress.sh, sort tests.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/bin/sh/builtins/hash1.05
-rw-r--r--tools/regression/bin/sh/builtins/hash1.0.stdout1
-rw-r--r--tools/regression/bin/sh/builtins/hash2.04
-rw-r--r--tools/regression/bin/sh/builtins/hash2.0.stdout1
-rw-r--r--tools/regression/bin/sh/builtins/hash3.03
-rw-r--r--tools/regression/bin/sh/builtins/hash3.0.stdout2
-rw-r--r--tools/regression/bin/sh/builtins/return1.07
-rw-r--r--tools/regression/bin/sh/builtins/return2.17
-rw-r--r--tools/regression/bin/sh/builtins/return3.13
-rw-r--r--tools/regression/bin/sh/regress.sh13
-rw-r--r--tools/regression/bin/sh/set-e/for1.09
-rw-r--r--tools/regression/bin/sh/set-e/func1.07
-rw-r--r--tools/regression/bin/sh/set-e/func2.17
-rw-r--r--tools/regression/bin/sh/set-e/until3.09
-rw-r--r--tools/regression/bin/sh/set-e/while3.09
15 files changed, 78 insertions, 9 deletions
diff --git a/tools/regression/bin/sh/builtins/hash1.0 b/tools/regression/bin/sh/builtins/hash1.0
new file mode 100644
index 0000000..45cc300
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/hash1.0
@@ -0,0 +1,5 @@
+# $FreeBSD$
+cat /dev/null
+hash
+hash -r
+hash
diff --git a/tools/regression/bin/sh/builtins/hash1.0.stdout b/tools/regression/bin/sh/builtins/hash1.0.stdout
new file mode 100644
index 0000000..3afc3e7
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/hash1.0.stdout
@@ -0,0 +1 @@
+/bin/cat
diff --git a/tools/regression/bin/sh/builtins/hash2.0 b/tools/regression/bin/sh/builtins/hash2.0
new file mode 100644
index 0000000..e5cd21b
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/hash2.0
@@ -0,0 +1,4 @@
+# $FreeBSD$
+hash
+hash cat
+hash
diff --git a/tools/regression/bin/sh/builtins/hash2.0.stdout b/tools/regression/bin/sh/builtins/hash2.0.stdout
new file mode 100644
index 0000000..3afc3e7
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/hash2.0.stdout
@@ -0,0 +1 @@
+/bin/cat
diff --git a/tools/regression/bin/sh/builtins/hash3.0 b/tools/regression/bin/sh/builtins/hash3.0
new file mode 100644
index 0000000..eade0b3
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/hash3.0
@@ -0,0 +1,3 @@
+# $FreeBSD$
+hash -v cat
+hash
diff --git a/tools/regression/bin/sh/builtins/hash3.0.stdout b/tools/regression/bin/sh/builtins/hash3.0.stdout
new file mode 100644
index 0000000..a34864c
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/hash3.0.stdout
@@ -0,0 +1,2 @@
+/bin/cat
+/bin/cat
diff --git a/tools/regression/bin/sh/builtins/return1.0 b/tools/regression/bin/sh/builtins/return1.0
new file mode 100644
index 0000000..787e892
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/return1.0
@@ -0,0 +1,7 @@
+# $FreeBSD$
+f() {
+ return 0
+ exit 1
+}
+
+f
diff --git a/tools/regression/bin/sh/builtins/return2.1 b/tools/regression/bin/sh/builtins/return2.1
new file mode 100644
index 0000000..0ef8171
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/return2.1
@@ -0,0 +1,7 @@
+# $FreeBSD$
+f() {
+ true && return 1
+ return 0
+}
+
+f
diff --git a/tools/regression/bin/sh/builtins/return3.1 b/tools/regression/bin/sh/builtins/return3.1
new file mode 100644
index 0000000..605ec68
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/return3.1
@@ -0,0 +1,3 @@
+# $FreeBSD$
+return 1
+exit 0
diff --git a/tools/regression/bin/sh/regress.sh b/tools/regression/bin/sh/regress.sh
index 0e098d0..e2767d7 100644
--- a/tools/regression/bin/sh/regress.sh
+++ b/tools/regression/bin/sh/regress.sh
@@ -1,6 +1,6 @@
# $FreeBSD$
-echo '1..31'
+echo '1..42'
COUNTER=1
@@ -31,12 +31,7 @@ do_test() {
rm tmp.stdout tmp.stderr
}
-SUCCESS=$(find . -name "*.0")
-for i in ${SUCCESS} ; do
- do_test ${i} 0
-done
-
-FAILURE=$(find . -name "*.1")
-for i in ${FAILURE} ; do
- do_test ${i} 1
+TESTS=$(find -s . -name "*.[01]")
+for i in ${TESTS} ; do
+ do_test ${i} ${i##*.}
done
diff --git a/tools/regression/bin/sh/set-e/for1.0 b/tools/regression/bin/sh/set-e/for1.0
new file mode 100644
index 0000000..67eb718
--- /dev/null
+++ b/tools/regression/bin/sh/set-e/for1.0
@@ -0,0 +1,9 @@
+# $FreeBSD$
+set -e
+f() {
+ for i in a b c; do
+ false
+ true
+ done
+}
+f || true
diff --git a/tools/regression/bin/sh/set-e/func1.0 b/tools/regression/bin/sh/set-e/func1.0
new file mode 100644
index 0000000..3c6b704
--- /dev/null
+++ b/tools/regression/bin/sh/set-e/func1.0
@@ -0,0 +1,7 @@
+# $FreeBSD$
+set -e
+f() {
+ false
+ true
+}
+f || true
diff --git a/tools/regression/bin/sh/set-e/func2.1 b/tools/regression/bin/sh/set-e/func2.1
new file mode 100644
index 0000000..cc76d6e
--- /dev/null
+++ b/tools/regression/bin/sh/set-e/func2.1
@@ -0,0 +1,7 @@
+# $FreeBSD$
+set -e
+f() {
+ false
+ exit 0
+}
+f
diff --git a/tools/regression/bin/sh/set-e/until3.0 b/tools/regression/bin/sh/set-e/until3.0
new file mode 100644
index 0000000..597db59
--- /dev/null
+++ b/tools/regression/bin/sh/set-e/until3.0
@@ -0,0 +1,9 @@
+# $FreeBSD$
+set -e
+f() {
+ until false; do
+ false
+ break
+ done
+}
+f || true
diff --git a/tools/regression/bin/sh/set-e/while3.0 b/tools/regression/bin/sh/set-e/while3.0
new file mode 100644
index 0000000..dd3c790
--- /dev/null
+++ b/tools/regression/bin/sh/set-e/while3.0
@@ -0,0 +1,9 @@
+# $FreeBSD$
+set -e
+f() {
+ while true; do
+ false
+ break
+ done
+}
+f || true
OpenPOWER on IntegriCloud