summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXusheng <xusheng@vector35.com>2020-07-17 12:52:50 +0800
committerXusheng <xusheng@vector35.com>2020-07-30 16:16:43 +0800
commitccce3a95b8106dd92440ac880cd9f5eca32f6282 (patch)
tree1f773a70e486e02de48ed3bd791a54f9309ea803
parent2953ae462cff5e449586a2fcb1e9ed739c614d14 (diff)
update generator
-rwxr-xr-xsuite/generator.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/suite/generator.py b/suite/generator.py
index ce7efada..6f2338d2 100755
--- a/suite/generator.py
+++ b/suite/generator.py
@@ -27,13 +27,11 @@ from collections import Counter
api_suite_path = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), {4}))
sys.path.append(api_suite_path)
+import config
import testcommon
import api_test
import rebasing_test
-global verbose
-verbose = False
-
class TestBinaryNinjaAPI(unittest.TestCase):
# Returns a tuple of:
@@ -78,10 +76,10 @@ class TestBinaryNinjaAPI(unittest.TestCase):
stringDiffList = stringDiff.split(\'\\n\')
if len(stringDiffList) > 10:
- if not verbose:
+ if not config.verbose:
stringDiff = \'\\n\'.join(line if len(line) <= 100 else line[:100] + "...and " + str(len(line) - 100) + " more characters" for line in stringDiffList[:10])
stringDiff += \'\\n\\n### And ' + str(len(stringDiffList)) + " more lines, use '-v' to show ###"
- elif not verbose:
+ elif not config.verbose:
stringDiff = \'\\n\'.join(line if len(line) <= 100 else line[:100] + "...and " + str(len(line) - 100) + " more characters" for line in stringDiffList)
stringDiff = \'\\n\\n\' + firstText + stringDiff
return (equality, stringDiff)
@@ -130,13 +128,13 @@ if __name__ == "__main__":
if len(sys.argv) > 1:
for i in range(1, len(sys.argv)):
if sys.argv[i] == '-v' or sys.argv[i] == '-V' or sys.argv[i] == '--verbose':
- verbose = True
+ config.verbose = True
elif sys.argv[i] == '--api-only':
- api_only = True
+ config.api_only = True
test_suite = unittest.defaultTestLoader.loadTestsFromModule(api_test)
test_suite = unittest.defaultTestLoader.loadTestsFromModule(rebasing_test)
- if not api_only:
+ if not config.api_only:
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TestBinaryNinjaAPI))
runner = unittest.TextTestRunner(verbosity=2)
runner.run(test_suite)