diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-03-23 16:14:51 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-03-23 16:14:51 +0200 |
| commit | 5b038666c3e911ffeb78a4d656044e5bd076705b (patch) | |
| tree | 9b09b4f27c39ef6a0139a5eb9bfa5e98a250086c /tests | |
| parent | 70615379062cdd2e016f5095dfafd23a6dca148c (diff) | |
| download | ek-5b038666c3e911ffeb78a4d656044e5bd076705b.tar.gz ek-5b038666c3e911ffeb78a4d656044e5bd076705b.zip | |
integrate parser work
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/check.sh | 36 | ||||
| -rw-r--r-- | tests/empty.cu | 0 | ||||
| -rw-r--r-- | tests/import/priv_hello.cu | 1 | ||||
| -rw-r--r-- | tests/import/pub_hello.cu | 1 | ||||
| -rw-r--r-- | tests/import/pub_import_hello.cu | 1 | ||||
| -rw-r--r-- | tests/main.cu | 1 | ||||
| -rw-r--r-- | tests/priv_hello.cu | 7 | ||||
| -rw-r--r-- | tests/pub_hello.cu | 6 | ||||
| -rw-r--r-- | tests/pub_import_hello.cu | 6 |
9 files changed, 59 insertions, 0 deletions
diff --git a/tests/check.sh b/tests/check.sh new file mode 100755 index 0000000..397d36d --- /dev/null +++ b/tests/check.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +echo > check.log + +tests=0 +passed=0 +failed=0 + +for file in $(echo check/*.cu) +do + testcase=$(echo "$file" | cut -f 1 -d '.') + expected="$testcase".ok + args=$(test -e "$testcase".args && cat "$testcase".args) + + echo -n testing "$testcase"... + + cmd="./cu "$args" "$file" -o check/run && ./check/run" + + tests=$((tests + 1)) + if test "$output" = "$expected" + then + passed=$((passed + 1)) + echo ok + else + failed=$((failed + 1)) + echo fail + fi; + + if test -n "$VERBOSE" + then + echo "$cmd" + fi +done + +echo +echo tests "$tests", passed "$passed", failed "$failed" diff --git a/tests/empty.cu b/tests/empty.cu new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/empty.cu diff --git a/tests/import/priv_hello.cu b/tests/import/priv_hello.cu new file mode 100644 index 0000000..970efcd --- /dev/null +++ b/tests/import/priv_hello.cu @@ -0,0 +1 @@ +hello(){} diff --git a/tests/import/pub_hello.cu b/tests/import/pub_hello.cu new file mode 100644 index 0000000..f26624e --- /dev/null +++ b/tests/import/pub_hello.cu @@ -0,0 +1 @@ +pub hello(){} diff --git a/tests/import/pub_import_hello.cu b/tests/import/pub_import_hello.cu new file mode 100644 index 0000000..4e6a851 --- /dev/null +++ b/tests/import/pub_import_hello.cu @@ -0,0 +1 @@ +pub import "pub_hello.cu"; diff --git a/tests/main.cu b/tests/main.cu new file mode 100644 index 0000000..05437c5 --- /dev/null +++ b/tests/main.cu @@ -0,0 +1 @@ +main(){} diff --git a/tests/priv_hello.cu b/tests/priv_hello.cu new file mode 100644 index 0000000..ef0f4c9 --- /dev/null +++ b/tests/priv_hello.cu @@ -0,0 +1,7 @@ +import "import/priv_hello.cu" + +main() +{ + /* expect this to fail */ + hello(); +} diff --git a/tests/pub_hello.cu b/tests/pub_hello.cu new file mode 100644 index 0000000..e6bea3b --- /dev/null +++ b/tests/pub_hello.cu @@ -0,0 +1,6 @@ +import "import/pub_hello.cu"; + +main() +{ + hello(); +} diff --git a/tests/pub_import_hello.cu b/tests/pub_import_hello.cu new file mode 100644 index 0000000..a0aeb31 --- /dev/null +++ b/tests/pub_import_hello.cu @@ -0,0 +1,6 @@ +import "import/pub_import_hello.cu"; + +main() +{ + hello(); +} |
