ZT_MAIN(3)

✨ zt_main ✨

okay bestie, gather round, because this is the command line interface for running tests and she is lowkey the moment πŸ’…. she lives in the LOCAL</> manual, section 3, and honestly? iconic.


🌸 NAME 🌸

zt_main β€” the command line interface for running tests, fr fr 🧚


πŸŽ€ SYNOPSIS πŸŽ€

#include <zt.h>

int
zt_main(int argc, char **argv, char **envp, zt_test_suite_func tsuite);

like. look at her. so clean. so powerful. 🫢


πŸ’– DESCRIPTION πŸ’–

so zt_main takes all the familiar arguments you already know and love, plus one single test suite function β€” that's the tsuite bestie, she's the main character here πŸ‘‘.

and then, depending on whatever you threw at it on the command line, it either:

  • enumerates and prints some or all of the tests πŸ“, or
  • actually executes some or all of them πŸ”₯

some. or all. depends on the args. the args decide. the args are the vibe check. periodt.


⭐ RETURN VALUES ⭐

here's the tea β˜•:

  • when tests are executed, the return value is EXIT_SUCCESS or EXIT_FAILURE β€” basically a pass/fail report card and you WILL be seeing it 😭
  • if the tests are only listed (no execution, just a lil peek πŸ‘€), the return value is always EXIT_SUCCESS. always. no cap.

πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, they're literally the besties:

iykyk πŸ’œ


🌈 HISTORY 🌈

zt_main first appeared in libzt 0.1 β€” a true OG, we stan a humble origin story πŸŽ€


πŸ’œ AUTHORS πŸ’œ

Zygmunt Krynicki <me@zygoon.pl> β€” thank you for your service, king πŸ«‘πŸ‘‘


no cap, that's the whole page. go run some tests bestie, you got this πŸ’…βœ¨

and that's a wrap! this lil legend comes from libzt 0.3.1, dated January 12, 2020, and lives at zt_main(3) πŸ“ bye bestie!! πŸ§šπŸ’–