From cd7e6595ea0ee856a54bf07a6cd3d9cceddb39d7 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 26 Sep 2021 21:16:19 +0000 Subject: [PATCH] unit_tests.py: new 'win_skip' attribute --- test/unit_tests.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/unit_tests.py b/test/unit_tests.py index 5f20bcc5..f61b187c 100755 --- a/test/unit_tests.py +++ b/test/unit_tests.py @@ -94,29 +94,38 @@ class UnitTestHelpers(object): else: rdie(3,m_noraise.format(desc,exc_chk)) +tests_seen = [] + def run_test(test,subtest=None): modname = 'test.unit_tests_d.{}{}'.format(file_pfx,test) mod = importlib.import_module(modname) def run_subtest(subtest): - gmsg(f'Running unit subtest {test}.{subtest}') + msg(f'Running unit subtest {test}.{subtest}') t = getattr(mod,'unit_tests')() if not getattr(t,subtest)(test,UnitTestHelpers): rdie(1,f'Unit subtest {subtest!r} failed') pass + if test not in tests_seen: + gmsg(f'Running unit test {test}') + tests_seen.append(test) + if subtest: run_subtest(subtest) else: - gmsg(f'Running unit test {test}') if hasattr(mod,'unit_tests'): # new class-based API t = getattr(mod,'unit_tests') altcoin_deps = getattr(t,'altcoin_deps',()) + win_skip = getattr(t,'win_skip',()) subtests = [k for k,v in t.__dict__.items() if type(v).__name__ == 'function'] for subtest in subtests: if opt.no_altcoin_deps and subtest in altcoin_deps: qmsg(gray(f'Invoked with --no-altcoin-deps, so skipping {subtest!r}')) continue + if g.platform == 'win' and subtest in win_skip: + qmsg(gray(f'Skipping {subtest!r} for Windows platform')) + continue run_subtest(subtest) else: if not mod.unit_test().run_test(test,UnitTestHelpers):