aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test_helpers.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_helpers.sh')
-rw-r--r--tests/test_helpers.sh19
1 files changed, 3 insertions, 16 deletions
diff --git a/tests/test_helpers.sh b/tests/test_helpers.sh
index 9169c24..349dc3a 100644
--- a/tests/test_helpers.sh
+++ b/tests/test_helpers.sh
@@ -2,12 +2,7 @@ function test_exit_code() {
set +e
cat > main.c
- "$ducc" main.c > main.s
- if [[ $? -ne 0 ]]; then
- set -e
- exit 1
- fi
- gcc -o a.out main.s
+ "$ducc" -o a.out main.c
./a.out
exit_code=$?
@@ -24,11 +19,7 @@ function test_exit_code() {
function test_diff() {
cat > main.c
- "$ducc" main.c > main.s
- if [[ $? -ne 0 ]]; then
- exit 1
- fi
- gcc -o a.out main.s
+ "$ducc" -o a.out main.c
if [[ ! -f input ]]; then
touch input
fi
@@ -61,11 +52,7 @@ function test_compile_error() {
function test_example() {
filename="../../../examples/$1.c"
- "$ducc" "$filename" > main.s
- if [[ $? -ne 0 ]]; then
- exit 1
- fi
- gcc -o a.out main.s
+ "$ducc" -o a.out "$filename"
if [[ ! -f input ]]; then
touch input
fi