aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test_helpers.sh
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-09-03 19:03:48 +0900
committernsfisis <nsfisis@gmail.com>2025-09-10 23:51:52 +0900
commit9a2fbf6f4854b1f2cfd5979b91d5b3d7e183d487 (patch)
tree5fc0c3e0c3cd7159119d0560b5061b3545216f35 /tests/test_helpers.sh
parentb447618c33683b947c1fb26f1e7cd9033e20e5cb (diff)
downloadducc-9a2fbf6f4854b1f2cfd5979b91d5b3d7e183d487.tar.gz
ducc-9a2fbf6f4854b1f2cfd5979b91d5b3d7e183d487.tar.zst
ducc-9a2fbf6f4854b1f2cfd5979b91d5b3d7e183d487.zip
test: merge test scripts
Diffstat (limited to 'tests/test_helpers.sh')
-rw-r--r--tests/test_helpers.sh68
1 files changed, 0 insertions, 68 deletions
diff --git a/tests/test_helpers.sh b/tests/test_helpers.sh
deleted file mode 100644
index eaccd5c..0000000
--- a/tests/test_helpers.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-function test_exit_code() {
- cat > main.c
-
- "$ducc" -o a.out main.c
- set +e
- ./a.out
- exit_code=$?
- set -e
-
- expected=$1
-
- if [[ $exit_code -ne $expected ]]; then
- echo "invalid exit code: expected $expected, but got $exit_code" >&2
- exit 1
- fi
-}
-
-function test_diff() {
- cat > main.c
-
- "$ducc" -o a.out main.c
- if [[ ! -f input ]]; then
- touch input
- fi
- ./a.out "$@" < input > output
- exit_code=$?
-
- if [[ $exit_code -ne 0 ]]; then
- echo "invalid exit code: $exit_code" >&2
- exit 1
- fi
-
- diff -u expected output
-}
-
-function test_compile_error() {
- cat > main.c
-
- set +e
- "$ducc" main.c > /dev/null 2> output
- exit_code=$?
- set -e
-
- if [[ $exit_code -eq 0 ]]; then
- echo "expected to fail" >&2
- exit 1
- fi
-
- diff -u expected output
-}
-
-function test_example() {
- filename="../../../examples/$1.c"
-
- "$ducc" -o a.out "$filename"
- if [[ ! -f input ]]; then
- touch input
- fi
- ./a.out "$@" < input > output
- exit_code=$?
-
- if [[ $exit_code -ne 0 ]]; then
- echo "invalid exit code: $exit_code" >&2
- exit 1
- fi
-
- diff -u expected output
-}