diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/hello/TARGETS | 7 | ||||
-rw-r--r-- | test/hello/test_hello.sh | 5 | ||||
-rw-r--r-- | test/proto/TARGETS | 7 | ||||
-rw-r--r-- | test/proto/test.sh | 12 | ||||
-rw-r--r-- | test/test_hello.sh | 5 | ||||
-rw-r--r-- | test/withExtendedPath/TARGETS | 7 | ||||
-rw-r--r-- | test/withExtendedPath/test.sh | 12 |
7 files changed, 55 insertions, 0 deletions
diff --git a/test/hello/TARGETS b/test/hello/TARGETS new file mode 100644 index 0000000..d01c382 --- /dev/null +++ b/test/hello/TARGETS @@ -0,0 +1,7 @@ +{ "": + { "type": ["@", "rules", "shell/test", "script"] + , "name": ["hello"] + , "test": ["test_hello.sh"] + , "deps": [["@", "src", "hello", ""]] + } +} diff --git a/test/hello/test_hello.sh b/test/hello/test_hello.sh new file mode 100644 index 0000000..08347e8 --- /dev/null +++ b/test/hello/test_hello.sh @@ -0,0 +1,5 @@ +set -e + +./hello | grep -i world +./hello Universe | grep Universe +./hello Universe | grep -i world && exit 1 || : diff --git a/test/proto/TARGETS b/test/proto/TARGETS new file mode 100644 index 0000000..50d5195 --- /dev/null +++ b/test/proto/TARGETS @@ -0,0 +1,7 @@ +{ "": + { "type": ["@", "rules", "shell/test", "script"] + , "name": ["proto"] + , "test": ["test.sh"] + , "deps": [["@", "src", "proto", "write"], ["@", "src", "proto", "read"]] + } +} diff --git a/test/proto/test.sh b/test/proto/test.sh new file mode 100644 index 0000000..fbd946b --- /dev/null +++ b/test/proto/test.sh @@ -0,0 +1,12 @@ +set -e + +./write FOO 42 data.bin 2>&1 + +echo +echo Binary encoding +xxd data.bin + +echo +echo Verifying read +./read data.bin | grep foo=FOO +./read data.bin | grep bar=42 diff --git a/test/test_hello.sh b/test/test_hello.sh new file mode 100644 index 0000000..08347e8 --- /dev/null +++ b/test/test_hello.sh @@ -0,0 +1,5 @@ +set -e + +./hello | grep -i world +./hello Universe | grep Universe +./hello Universe | grep -i world && exit 1 || : diff --git a/test/withExtendedPath/TARGETS b/test/withExtendedPath/TARGETS new file mode 100644 index 0000000..73a5a9e --- /dev/null +++ b/test/withExtendedPath/TARGETS @@ -0,0 +1,7 @@ +{"withExtendedPath": + { "type": ["@", "rules", "shell/test", "script"] + , "name": ["find-in-extended-path"] + , "test": ["test.sh"] + , "deps": [["@", "src", "withExtendedPath", ""]] + } +} diff --git a/test/withExtendedPath/test.sh b/test/withExtendedPath/test.sh new file mode 100644 index 0000000..de51742 --- /dev/null +++ b/test/withExtendedPath/test.sh @@ -0,0 +1,12 @@ +set -e + +TOOLS_DIR=`pwd`/additionalTools +mkdir -p ${TOOLS_DIR} +cat > ${TOOLS_DIR}/mytool <<'EOF' +#!/bin/sh + +echo using my CuStOm tool +EOF +chmod 755 ${TOOLS_DIR}/mytool + +./withExtendedPath ${TOOLS_DIR} mytool | grep CuStOm |