aboutsummaryrefslogtreecommitdiff
path: root/run.sh
diff options
context:
space:
mode:
authorMustafa Quraish <[email protected]>2022-01-28 22:59:46 -0500
committerMustafa Quraish <[email protected]>2022-01-28 22:59:46 -0500
commitf66593a4c4f08f7a37d525421455166d51987999 (patch)
tree1aee56630eaec1fcbb000e861a003d96f23eb032 /run.sh
parentAdd some basic args parsing so we can test stuff from the CLI (diff)
downloadcup-f66593a4c4f08f7a37d525421455166d51987999.tar.xz
cup-f66593a4c4f08f7a37d525421455166d51987999.zip
Scripts: Reorganize a bit, add some rudimentary shell-testing
Just to make sure we don't break stuff. We'll probably want better unit tests specifically for each part once we're more stable.
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/run.sh b/run.sh
new file mode 100755
index 0000000..6038d91
--- /dev/null
+++ b/run.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