aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Makefile')
-rw-r--r--tests/Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644
index 0000000..9e7d788
--- /dev/null
+++ b/tests/Makefile
@@ -0,0 +1,34 @@
+NBC = nbc
+OPTIMIZE = -Z2
+FIRMWARE =
+PYTHON = python3
+# or PYTHON = poetry -C path/to/nxt-python run python
+
+TESTS = float
+
+tests: $(TESTS:%=%.diff)
+
+%.rxe: %.nxc
+ $(NBC) $(OPTIMIZE) $(FIRMWARE) -O=$@ $<
+
+%.load: %.rxe
+ $(NBC) $(OPTIMIZE) $(FIRMWARE) -d -b $<
+
+%.out: %.load
+ $(PYTHON) term.py -qos $* > $@
+
+%.diff: %.out %.expect
+ diff $^ > $@
+
+%.S: %.nxc
+ $(NBC) $(OPTIMIZE) $(FIRMWARE) -nbc=$@ $<
+
+clean-out:
+ rm -f $(TESTS:%=%.out) $(TESTS:%=%.diff)
+
+clean: clean-out
+ rm -f $(TESTS:%=%.rxe)
+
+.SECONDARY:
+
+.DELETE_ON_ERROR: