ldcheck.py

changeset 38
66c9591b733d
parent 36
2753aad79678
child 47
4da025d0b283
--- a/ldcheck.py	Fri May 24 15:32:10 2019 +0300
+++ b/ldcheck.py	Fri May 24 17:37:10 2019 +0200
@@ -116,6 +116,8 @@
         action = ListTestSuiteAction,
         help = 'Lists all possible checks and exit',
     )
+    parser.add_argument('--dump-structure', action = 'store_true')
+    parser.add_argument('--rebuild', action = 'store_true')
     args = parser.parse_args()
     config = load_config('ldcheck.cfg')
     for ldconfig_ldr_path in find_ldconfig_ldr_paths(config):
@@ -128,7 +130,14 @@
             name = basename(args.filename),
             config = config,
         )
-        from testsuite import load_tests, check_model, format_report
-        test_suite = load_tests()
-        report = check_model(model, test_suite)
-        print(format_report(report, model, test_suite))
+        if args.dump_structure:
+            for entry in model.body:
+                print(entry)
+        elif args.rebuild:
+            for entry in model.body:
+                print(entry.textual_representation(), end = '\r\n')
+        else:
+            from testsuite import load_tests, check_model, format_report
+            test_suite = load_tests()
+            report = check_model(model, test_suite)
+            print(format_report(report, model, test_suite))

mercurial