diff options
Diffstat (limited to 'tests/tst-tool-config.c')
| -rw-r--r-- | tests/tst-tool-config.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/tst-tool-config.c b/tests/tst-tool-config.c new file mode 100644 index 0000000..8ea0ec6 --- /dev/null +++ b/tests/tst-tool-config.c @@ -0,0 +1,45 @@ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdio.h> +#include <string.h> + +#include "mcpu-tool-options.h" + +int +main( int argc, char **argv ) +{ + mcpu_tool_options options; + int i; + int rc = 1; + + mcpu_tool_options_init( &options, argv[0] ); + + for( i = 1; i < argc; ++i ) + { + int parsed = mcpu_tool_parse_common_option( &options, argc, argv, &i ); + + if( parsed < 0 ) + goto done; + if( parsed == 0 ) + { + fprintf( stderr, "%s: unknown option '%s'\n", + options.progname, argv[i] ); + goto done; + } + } + + if( mcpu_tool_options_prepare(&options, argv[0]) != 0 ) + goto done; + + printf( "root=%s\n", options.runtime.installation_root ); + printf( "config=%s\n", options.runtime.config_file ); + printf( "lib=%s\n", options.runtime.system_library_path ); + rc = 0; + +done: + mcpu_tool_options_free( &options ); + return( rc ); + +} /* End of main() */ |
