From b600caa35ab0e2e005c6afec3666b255b3b92ca9 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 17 Dec 2021 15:16:22 -0500 Subject: =?UTF-8?q?Allow=20test/unit.bqn=20to=20test=20runtime=20but=20not?= =?UTF-8?q?=20compiler=20with=20=E2=80=A2ReBQN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/unit.bqn | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'test/unit.bqn') diff --git a/test/unit.bqn b/test/unit.bqn index 52a61556..bf187a37 100755 --- a/test/unit.bqn +++ b/test/unit.bqn @@ -5,21 +5,23 @@ files‿opts ← 2 ↑ ('-'=⊑)¨⊸⊔ •args files ↩ (0<≠)◶⟨1,∨´"all"⊸≡¨⟩◶⟨∾⟜".bqn"¨, •file.List∘"cases"⟩ files nc‿rt‿ref‿noerr ← "-nocomp"‿"-rt"‿"-ref"‿"-noerr" ∊ opts -"Can't test runtime without the compiler!" ! ¬nc∧rt∨ref Native ← •BQN +gl ← •Import "../src/glyphs.bqn" +prim ← { + ref ? •Import "ref.bqn" ; # Reference implementations + rt ? •Import "../rt.bqn" ; # Self-hosted + ¬nc ? •BQN∘⥊¨ ∾gl ; # Native runtime + @ # Just use •BQN +} exec ← { - nc ? Native ; - # Otherwise compiled - gl ← •Import "../src/glyphs.bqn" + ¬nc ? # Compiled compile ← gl •Import "../src/c.bqn" vm ← •Import "../vm.bqn" - r ← { - ref ? •Import "ref.bqn" ; # Reference implementations - rt ? •Import "../rt.bqn" ; # Self-hosted - •BQN∘⥊¨ ∾gl # Native runtime - } - BQN ← ⟨r,{𝕊"bqn":BQN}¨⟩⊸(VM Compile) + BQN ← ⟨prim,{𝕊"bqn":BQN}¨⟩⊸(VM Compile) +; prim≢@ ? + •ReBQN {primitives⇐(∾gl)⋈¨prim} +; Native } c ← ∾ ((0<≠)◶0‿('#'≠⊑)¨⊸/ · •file.Lines "cases/"⊸∾)¨ files -- cgit v1.2.3