mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
Unit tests can now be passed custom arguments from the command line. For example, the following command would run the "mytest" test in the "/main/mycat" category with the option "myoption=54" `CLI> test execute category /main/mycat name mytest options myoption=54` You can also pass options to an entire category... `CLI> test execute category /main/mycat options myoption=54` Basically, everything after the "options" keyword is passed verbatim to the test which must decide what to do with it. * A new API ast_test_get_cli_args() was created to give the tests access to the cli_args->argc and cli_args->argv elements. * Although not needed for the option processing, a new macro ast_test_validate_cleanup_custom() was added to test.h that allows you to specify a custom error message instead of just "Condition failed". * The test_skel.c was updated to demonstrate parsing options and the use of the ast_test_validate_cleanup_custom() macro.