aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-31 01:11:54 +0200
committerhachem <im@hachem.wtf>2026-08-31 01:11:54 +0200
commitcf24f576891ece60bdf04928d3c39dd0bbb9b5f6 (patch)
treef0e5492dca4e0c3bbbff256c2c1fa98b15dcfab5 /scripts
parent3e20038bbf7206e2270655418d7884ccfe91a4e4 (diff)
feat: add logical_registers
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/docker_test.sh7
-rwxr-xr-xscripts/run_suite.sh5
-rwxr-xr-xscripts/test_examples.sh11
3 files changed, 1 insertions, 22 deletions
diff --git a/scripts/docker_test.sh b/scripts/docker_test.sh
index 2ded903..5730e1d 100755
--- a/scripts/docker_test.sh
+++ b/scripts/docker_test.sh
@@ -1,9 +1,4 @@
#!/usr/bin/env bash
-# Convenience wrapper: build hdass and run the full test suite (unit tests plus
-# the end-to-end example tests) inside the amd64 Linux Docker environment.
-# Run this from the host; it brings the container up if it is not already.
-#
-# Colours are on by default; set NO_COLOR to disable them.
set -euo pipefail
root="$(cd "$(dirname "$0")/.." && pwd)"
@@ -11,6 +6,4 @@ cd "$root"
docker compose up -d >/dev/null
-# stdin is redirected from /dev/null so `docker compose exec -T` does not hang
-# waiting on the stream after the suite finishes.
docker compose exec -T -e "NO_COLOR=${NO_COLOR:-}" hdass bash /hdass/scripts/run_suite.sh </dev/null
diff --git a/scripts/run_suite.sh b/scripts/run_suite.sh
index 9d40e24..48cf67f 100755
--- a/scripts/run_suite.sh
+++ b/scripts/run_suite.sh
@@ -1,9 +1,4 @@
#!/usr/bin/env bash
-# Build hdass and run the full test suite (unit tests plus the end-to-end
-# example tests). Expects the amd64 Linux environment; it is invoked inside the
-# container by scripts/docker_test.sh, but can also be run directly there.
-#
-# Colours are on by default; set NO_COLOR to disable them.
set -euo pipefail
cd "$(cd "$(dirname "$0")/.." && pwd)"
diff --git a/scripts/test_examples.sh b/scripts/test_examples.sh
index 5ebba65..84299ce 100755
--- a/scripts/test_examples.sh
+++ b/scripts/test_examples.sh
@@ -1,12 +1,4 @@
#!/usr/bin/env bash
-# End-to-end example tests: transpile each program with hdass, assemble it with
-# nasm, link it with ld, run it, and compare its stdout and exit status against
-# the expected values below.
-#
-# The generated programs use Linux x86-64 syscalls, so this must run in the
-# amd64 Linux environment (see the Docker setup in the README), not on macOS.
-#
-# Colours are on by default; set NO_COLOR to disable them.
set -u
root="$(cd "$(dirname "$0")/.." && pwd)"
@@ -38,8 +30,6 @@ trap 'rm -rf "$work"' EXIT
pass=0
fail=0
-# check <name> <description> <source> <expected_exit> <expected_stdout>
-# expected_stdout is compared after trailing newlines are stripped (as $() does).
check()
{
local name="$1" desc="$2" source="$3" expected_exit="$4" expected_stdout="$5"
@@ -90,6 +80,7 @@ check arithmetic "integer compound-assignment math" examples/arithmetic.hd
check loop_sum "sums 1..5 with a countdown loop" examples/loop_sum.hdass 15 ""
check branch "selects the larger of two values" examples/branch.hdass 8 ""
check call "passes an argument through a proc" examples/call.hdass 21 ""
+check logical "logical register names (r1..r14)" examples/logical.hdass 21 ""
check fibonacci "prints the first ten Fibonacci numbers" examples/fibonacci.hdasm 0 "0
1
1