Reimplementation of Pijul in C, for education, fun and absolutely no profit

#14 Testing strategy

Closed on November 28, 2023
laumann on September 18, 2023

Meson has a test subcommand that can be used to run an executable as a test harness.

We can make it so:

  • there’s a tests subdirectory with a meson.build that requires that requires the libani.so
  • the top-level meson.build does libani = library(...) and then calls subdir('tests')
  • the tests/meson.build just defines a bunch of test executables via test()

The neat thing is that we can have (1) tests built and executed straight from meson (2) we can use TAP! The downside (imo) is that each meson test is not a single test, but a test harness, so the final report will give the number of failed harnesses not the total of failed tests.

test('tests', tests, protocol : 'tap', verbose : true)
laumann on September 18, 2023

Components to test:

  • base32 encode/decode, how can this fail?
  • bincode decoder functions
  • decoding change files
laumann added a change on November 28, 2023
change: rework to make more testable created on November 27, 2023
SMB3M6ESOIR2LMFII2VFQJSPFIUYXHD7CXYARIGOKPB2QF2ORFLAC
main
laumann on November 28, 2023

The proposed change does not use TAP, imo the TAP support in meson is not what I would expect it to be.

laumann closed this discussion on November 28, 2023