diff options
| author | peter <peter@pmikkelsen.com> | 2026-09-01 17:37:49 +0000 |
|---|---|---|
| committer | peter <peter@pmikkelsen.com> | 2026-09-01 17:37:49 +0000 |
| commit | b0878be692785dabf6e21fbb7d93ff06563f2063 (patch) | |
| tree | 89754d05a405b1d379ccb05fe10818a1bbee9bb9 | |
| parent | f9f9b10c1d17077632d7a09e447e629b8d33b23d (diff) | |
| parent | 30af5b777682a5c81fe40081667d58f804571914 (diff) | |
Update memory-manager branch
FossilOrigin-Name: b6d07c6950d35369ce7d47069f35bb5b97b9f0b28853903aedc54b5be9fc918d
| -rw-r--r-- | CMakeLists.txt | 17 | ||||
| -rwxr-xr-x | tests/scripts/bad/1.sh | 3 | ||||
| -rwxr-xr-x | tests/scripts/good/1.sh | 3 | ||||
| -rwxr-xr-x | tests/scripts/good/2.sh | 5 | ||||
| -rwxr-xr-x | tests/scripts/good/3.sh | 8 | ||||
| -rwxr-xr-x | tests/scripts/good/4.sh | 8 |
6 files changed, 44 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9da17b3..efa3cc1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,6 +122,23 @@ foreach(script ${TEST_SCRIPTS_BAD}) ) endforeach() +file(GLOB TEST_SCRIPTS_GOOD CONFIGURE_DEPENDS "tests/scripts/good/*.sh") +foreach(script ${TEST_SCRIPTS_GOOD}) + add_test(NAME "${script}" COMMAND "${script}") + set_tests_properties("${script}" PROPERTIES + ENVIRONMENT "PATH=$<TARGET_FILE_DIR:aplwc-repl>" + ) +endforeach() + +file(GLOB TEST_SCRIPTS_BAD CONFIGURE_DEPENDS "tests/scripts/bad/*.sh") +foreach(script ${TEST_SCRIPTS_BAD}) + add_test(NAME "${script}" COMMAND "${script}") + set_tests_properties("${script}" PROPERTIES + ENVIRONMENT "PATH=$<TARGET_FILE_DIR:aplwc-repl>" + WILL_FAIL TRUE + ) +endforeach() + add_test(NAME "aplwc-repl" COMMAND "aplwc-repl" "-x") set(REQUIRED_MALLOCS 3) diff --git a/tests/scripts/bad/1.sh b/tests/scripts/bad/1.sh new file mode 100755 index 0000000..2bb8d86 --- /dev/null +++ b/tests/scripts/bad/1.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exit 1 diff --git a/tests/scripts/good/1.sh b/tests/scripts/good/1.sh new file mode 100755 index 0000000..c52d3c2 --- /dev/null +++ b/tests/scripts/good/1.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exit 0 diff --git a/tests/scripts/good/2.sh b/tests/scripts/good/2.sh new file mode 100755 index 0000000..9bb0268 --- /dev/null +++ b/tests/scripts/good/2.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +echo "1+2" | aplwc-repl diff --git a/tests/scripts/good/3.sh b/tests/scripts/good/3.sh new file mode 100755 index 0000000..4a86c11 --- /dev/null +++ b/tests/scripts/good/3.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +cat <<EOF | aplwc-repl +1+2 +3+4 +EOF diff --git a/tests/scripts/good/4.sh b/tests/scripts/good/4.sh new file mode 100755 index 0000000..b075ac7 --- /dev/null +++ b/tests/scripts/good/4.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +cat <<EOF | aplwc-repl +'abc' +123 +EOF |