aboutsummaryrefslogtreecommitdiff
path: root/test.sh
diff options
context:
space:
mode:
authorMustafa Quraish <[email protected]>2022-01-28 18:42:46 -0500
committerMustafa Quraish <[email protected]>2022-01-28 22:38:02 -0500
commitb8a173787a0b9b8c0dc064c12c99475a41dfe383 (patch)
tree414347672b0da6cbd543f81695d2138c548595b8 /test.sh
parentAdd a parser, dump the AST in main (diff)
downloadcup-b8a173787a0b9b8c0dc064c12c99475a41dfe383.tar.xz
cup-b8a173787a0b9b8c0dc064c12c99475a41dfe383.zip
Add some scripts to help assemble generated output and run it
Until we have a better way of outputting the data, we're just using return codes for now. The `test.sh` script creates the compiler, compiles the selected file into ASM, then assembles and links the generated output, after which it runs it and shows the exit status.
Diffstat (limited to 'test.sh')
-rwxr-xr-xtest.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..14f0145
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+if [ -z "$1" ]
+then
+ echo "Usage: $0 <path to .cup file>"
+ exit 1
+fi
+
+set -xe
+
+./compile.sh
+./cupcc $@
+./assemble.sh output.nasm
+
+set +e
+
+./a.out
+echo "Exit status: $?" \ No newline at end of file