From ba1b04d64bdfaf377915b22f77520216ebe47674 Mon Sep 17 00:00:00 2001 From: kx Date: Thu, 1 Oct 2026 12:02:28 +0300 Subject: Version 1.0.2 --- tests/mcpp-options-test.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/mcpp-options-test.c (limited to 'tests/mcpp-options-test.c') diff --git a/tests/mcpp-options-test.c b/tests/mcpp-options-test.c new file mode 100644 index 0000000..a0e8311 --- /dev/null +++ b/tests/mcpp-options-test.c @@ -0,0 +1,24 @@ +#include + +int +main( int argc, char **argv ) +{ + mcpp_options options; + const char *p; + int rc = 1; + + mcpp_options_init( &options, argc ); + if( options.actions == NULL ) + return( 1 ); + + p = argv[0] + strlen( argv[0] ); + while( p != argv[0] && p[-1] != '/' ) --p; + options.progname = p; + + if( mcpp_handle_options(&options, argc - 1, argv + 1) == 0 && + mcpp_options_dump(&options, stdout) == 0 ) + rc = 0; + + mcpp_options_free( &options ); + return( rc ); +} -- cgit v1.2.3