SHTK_UNITTEST_MAIN(3)

πŸ“¦ version 1.7, in nixos 26.05, nixpkgs unstable

✨ NAME ✨

okay so shtk_unittest_main(3) β€” from the Library Functions Manual, bestie β€” is literally the Standard test program entry point. That’s the whole vibe: it’s the standard way your test program walks in the room. πŸ’…

πŸ“š LIBRARY πŸ“š

you get this iconic behavior through shtk_import unittest. 🫢

πŸ¦‹ SYNOPSIS πŸ¦‹

shtk_unittest_main

πŸ’– DESCRIPTION πŸ’–

The shtk_unittest_main function implements the standard entry point of a test program that uses the shtk_unittest(3) library. no cap, that’s its job. It runs all test cases registered within the test case and determines the correct exit condition for the test program. main character energy fr fr. ✨

To use shtk_unittest_main, test programs must either explicitly call the function from their main method like this:

main() { shtk_unittest_main "${@}"; }

Or the test program can be compiled with an override for the main method’s name:

$ shtk build -m shtk_unittest_main module_test.sh

In general, prefer the latter mechanism. like, the build override is the recommended route β€” periodt. πŸ‘‘

πŸ”₯ RETURN VALUES πŸ”₯

Returns 0 (true) if all executed test cases pass, or 1 (false) if any test fails. πŸ’€βœ¨

🌈 SEE ALSO 🌈

πŸŽ€ HISTORY πŸŽ€

shtk_unittest_main first appeared in shtk 1.6. iconic behavior since day one, lowkey. πŸŽ€


mwah πŸ’‹ β€” this cute sign-off is also carrying the footer info: Debian, dated November 8, 2014, manual name SHTK_UNITTEST_MAIN(3). bye bestie, go slay your tests 🌸

πŸ“¦ where this page comes from