diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-12-17 15:16:22 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-12-17 15:16:22 -0500 |
| commit | b600caa35ab0e2e005c6afec3666b255b3b92ca9 (patch) | |
| tree | e42aed7cac7e075f45bffbf1febb4ab158f08b9e /test | |
| parent | 5505e1b259a092f71ebc5ed848f69f254bef79a9 (diff) | |
Allow test/unit.bqn to test runtime but not compiler with •ReBQN
Diffstat (limited to 'test')
| -rwxr-xr-x | test/unit.bqn | 22 |
1 files changed, 12 insertions, 10 deletions
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 |
