summaryrefslogtreecommitdiff
path: root/tests/tst-tool-config.c
diff options
context:
space:
mode:
authorkx <kx@radix-linux.su>2026-10-09 18:00:15 +0300
committerkx <kx@radix-linux.su>2026-10-09 18:00:15 +0300
commit065da3509019b15dd0e678072e6be629e5330bef (patch)
tree69c934c9e786ac048b4fbe8f4c4c5571661521f4 /tests/tst-tool-config.c
parentd130fe27fa753be02ed76fd9b277aa3c3d928eb9 (diff)
downloadlibmcpu-0.4.0.tar.xz
Version 0.4.00.4.0
Diffstat (limited to 'tests/tst-tool-config.c')
-rw-r--r--tests/tst-tool-config.c45
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() */