about summary refs log tree commit diff stats
path: root/baremetal/502test.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2021-01-13 21:50:38 -0800
committerKartik Agaram <vc@akkartik.com>2021-01-13 21:50:38 -0800
commit21bddb2e4bad5f67ef45022f194c902f2ea24c84 (patch)
tree17b9afc811a800560816d4f0a8d87e5289bedc12 /baremetal/502test.mu
parent32bb01ba4a434388cbfda3b28a149790d13d9a95 (diff)
downloadmu-21bddb2e4bad5f67ef45022f194c902f2ea24c84.tar.gz
7519 - baremetal: run all tests on boot
Diffstat (limited to 'baremetal/502test.mu')
-rw-r--r--baremetal/502test.mu18
1 files changed, 18 insertions, 0 deletions
diff --git a/baremetal/502test.mu b/baremetal/502test.mu
new file mode 100644
index 00000000..94063a70
--- /dev/null
+++ b/baremetal/502test.mu
@@ -0,0 +1,18 @@
+# print msg to screen if a != b, otherwise print "."
+fn check-ints-equal _a: int, b: int, msg: (addr array byte) {
+  var a/eax: int <- copy _a
+  compare a, b
+  {
+    break-if-=
+    draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0, msg, 3  # 3=cyan
+    count-test-failure
+  }
+  {
+    break-if-!=
+    draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0, ".", 3  # 3=cyan
+  }
+}
+
+fn test-check-ints-equal {
+  check-ints-equal 0, 0, "abc"
+}