uCBQN/test
2025-06-13 02:21:25 +03:00
..
cases clear flags on •bit._neg & •bit._not reuse 2025-06-13 02:21:25 +03:00
ffi FFI: fix "&{*}" 2024-03-07 14:45:10 +02:00
generated testing setup for ˘ & ⎉ 2023-04-24 19:43:04 +03:00
imports make •Import follow ReBQN 2023-12-11 14:02:38 +02:00
cells.bqn refactor •internal.Temp 2025-05-28 06:55:53 +03:00
joinReuse.bqn final test cleanup 2025-06-07 20:06:15 +03:00
mainCfgs.sh don't require bash 2024-06-05 02:14:43 +03:00
moreCfgs.sh bump for_build binary 2025-05-01 22:53:45 +03:00
precompiled.bqn fix test/precompiled.bqn once more 2022-11-24 01:32:08 +02:00
README.md cleanup 2025-06-11 00:47:11 +03:00
readTests.bqn add argument descriptions to test/readTests.bqn 2022-06-04 02:25:18 +03:00
run.bqn modernize imports test 2025-06-01 17:42:22 +03:00
utils.bqn default to •internal.EEqual comparing 0 and ¯0 as equal 2023-04-02 15:29:11 +03:00
x86Cfgs.sh don't require bash 2024-06-05 02:14:43 +03:00

Tests

All of the below must be run from the project's root directory. Some tests require -DTEST_UTILS (enabled by default in debug builds)

test/mainCfgs.sh path/to/mlochbaum/BQN // run the test suite for a couple primary configurations
test/x86Cfgs.sh  path/to/mlochbaum/BQN // run the test suite for x86-64-specific configurations, including singeli; 32-bit build is "supposed" to fail one test involving ⋆⁼
test/moreCfgs.sh path/to/mlochbaum/BQN // run "2+2" in a bunch of configurations; requires dzaima/BQN to be accessible as dbqn
test/run.bqn // run tests in test/cases/
make -C test/ffi // test FFI functionality; expects both regular and shared library CBQN builds to already exist

legacy things:
  test/joinReuse.bqn // test in-place join; requires -DPRINT_JOIN_REUSE
  test/readTests.bqn // read mlochbaum/BQN tests in various formats
  test/precompiled.bqn // run a precompiled expression

Format of tests in test/cases/:

%DEF somename some code # add a definition to be used by later tests or other %DEFs
%USE somename # copy-paste in the code of the given definition to here
# if the first line is "### WHOLE-FILE-TEST", the whole file is a single test
tests:
  # •args contains `helpers‿"arg0"‿1`, "helpers" being run.bqn's variable of the same name
  code that runs some !assertions # if there are no '!'s, 'lint' will complain
  !"error message" % erroring code # can be written as "!% erroring code" at first, and let 'update-messages' insert the message
  code %% expected value
  (
    multiline
    code
    running !assertions
    # the '(' and ')' lines must have no other characters in them
  )

# flags addable anywhere in code to restrict when it's run:
  %SLOW # enable only if 'slow' argument present
  %!DEBUG # disable if 'debug' argument present
  %!HEAPVERIFY # disable if 'heapverify' argument present
  %ALLOW_CATCH # allow running in noerr mode even if ⎊ is present
  %!PROPER_FILLS # enable only if has PROPER_FILLS==0
  %PROPER_FILLS # enable only if has PROPER_FILLS==1