aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMustafa Quraish <[email protected]>2022-01-29 22:26:17 -0500
committerMustafa Quraish <[email protected]>2022-01-29 22:26:57 -0500
commit76b80dd7f4423b37753031a6ef061ef08c570c06 (patch)
treed20e63f18fcf826245d3c9e8c855cd5bb78d0cd9 /tests
parentAdd for and while loop support (w/o declarations in `for`) (diff)
downloadcup-76b80dd7f4423b37753031a6ef061ef08c570c06.tar.xz
cup-76b80dd7f4423b37753031a6ef061ef08c570c06.zip
Make the compiler / scripts work on Linux too (yay!)
Diffstat (limited to 'tests')
-rw-r--r--tests/common.sh17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/common.sh b/tests/common.sh
index 80e0bea..f863826 100644
--- a/tests/common.sh
+++ b/tests/common.sh
@@ -1,9 +1,20 @@
#!/bin/bash
function assemble() {
- # Note: macOS only for now, abstract this out later
- nasm -f macho64 -o output.o output.nasm
- ld -lSystem output.o
+ case "$(uname -s)" in
+ Darwin)
+ set -e
+ nasm -f macho64 -o output.nasm.o output.nasm
+ ld -lSystem output.nasm.o
+ set +e
+ ;;
+ Linux)
+ set -e
+ nasm -f elf64 -o output.nasm.o output.nasm
+ ld output.nasm.o
+ set +e
+ ;;
+ esac
}
function assert_exit_status() {