Commit Briefs

b01ca349cc Sven M. Hallberg

test.h: rename check() macro to expect() (main)

I can't remember where else I've seen this naming, but I like it because it seems to match up more neatly with assert().


0f3b75642b Sven M. Hallberg

put a TAB into "test() skipped" to fit regular output

This version matches project sc2 (git): commit fb675b5f860edf6266885e42d9c09c2802cf9416 from: Sven M. Hallberg <pesco@khjk.org> date: Sat Dec 28 23:46:43 2024 UTC


b638044ea2 Sven M. Hallberg

test.h: remove colons from output

As a side effect, this makes the test output clean TSV. This version matches project sc2 (git): commit 7e054f3208ac703dda195f3d0c49bf53e781ebc2 from: Sven M. Hallberg <pesco@khjk.org> date: Sat Dec 28 16:17:19 2024 UTC The change was initially recorded in project rx (darcs): patch 31afcfda494ef1937d8019360c9cc1ba1c4ef3c2 Author: pesco@khjk.org Date: Sat Dec 28 16:15:49 UTC 2024


5299567952 Sven M. Hallberg

include assert.h from test.h

This tweak came silently with the initial commit of project sc2 (git): commit a398e14898e509e7df5eb1648b4a28408e92eec0 from: Sven M. Hallberg <pesco@khjk.org> date: Sun Dec 8 13:37:38 2024 UTC open arrays and uinit tests


b0aa2229df Sven M. Hallberg

add lang/c/test.h

This is the first (2020) version, from project rx (darcs): patch e23a5d20646a06606d11f4ab711e123b4cd98ba6 Author: pesco@khjk.org Date: Mon Apr 12 15:47:51 CEST 2021 * prototype


fcb7466a5c Sven M. Hallberg

regen README


12d156c595 Sven M. Hallberg

manpage fixes


42d07c50c8 Sven M. Hallberg

add counters section to manpage


9c8a0916ad Sven M. Hallberg

separate run and total counters

Total is the number of tests we intend to execute. It is semantically the counter that was called 'run' before. It may increase while running test suites but is otherwise set up-front. Run is now the number of tests we have so far (at least tried) to execute and increments as we go. It will normally be the sum of ok, fail, and error. If and when we add parallel execution of tests, the sum might lag behind because 'run' gets incremented before the test is finished. Counter consistency gains the requirement that run not exceed total. At the same time, it is relaxed such that run may end lower than total. Thus test suites (or exercise itself) may abort early (after the first failure, say) without such a run being considered invalid. This commit includes two new tests and fixes some bugs they exposed.


d020afe4a9 Sven M. Hallberg

assert-exercise: remove tempfiles via an exit trap

This ensures it happens also on a premature exit (127).


a3a317d2df Sven M. Hallberg

manpage tweaks


101dd348a5 Sven M. Hallberg

unify pattern flags into -p[dst]=...


1314fbfbc6 Sven M. Hallberg

xxx -q test name


0eb2a1f6b1 Sven M. Hallberg

add a final sanity check for progress counters


8dc949b075 Sven M. Hallberg

add -q: squelch standard output


5b9fbd58a1 Sven M. Hallberg

more getopt improvements

Set arg variable to 1 for boolean flags.


19d28f9717 Sven M. Hallberg

improve getopt a little


e6eae04680 Sven M. Hallberg

add command line options for patterns

Includes a minimal getopt(3) implementation.


8e4033faa2 Sven M. Hallberg

improve counter colors in corner cases

Color "ok" green only if positive. Color "run" dark red if zero.


1041414ec4 Sven M. Hallberg

update patterns in manpage


2a32333ed6 Sven M. Hallberg

adjust testsuite tests to use new pattern (*.tests)


25e116bbe3 Sven M. Hallberg

rename tests to match new pattern (*.t)


b36334c106 Sven M. Hallberg

change default test/suite/dir patterns to *.t, *.tests, *, respectively

The file patterns should be suffixes so they become hidden if there is another, like on a source file for a test, for instance. NB: The directory pattern only applies to directories, it will not cause regular files to be mistaken for subdirectories. Widening it to all directories is done in anticipation of introducing a -C command line option. The executable patterns also only apply to regular files.


252e283ccf Sven M. Hallberg

add copyright and license tag


119471299b Sven M. Hallberg

add README/manpage, Makefile

Makefile generates README from the manpage.