From 0c7d231752cee1ac32265c2c63e136f85f89e7fb Mon Sep 17 00:00:00 2001 From: LeoHsiao Date: Thu, 22 Oct 2020 19:23:13 +0800 Subject: [PATCH] let `make python_tests` runs in verbose mode --- test/Makefile | 4 ++-- tests/bash_tests/testcases.py | 2 +- tests/bash_tests/utils.py | 3 ++- tests/suite.conf | 2 ++ tests/system_tests.py | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/Makefile b/test/Makefile index dde7667b..b768040b 100644 --- a/test/Makefile +++ b/test/Makefile @@ -153,8 +153,8 @@ python_tests: @echo @echo ---- Running python_tests ---- @echo - @echo bash -c ' . functions.source ; cd ../tests ; if [ ! -z $$VERBOSE ]; then verbose=--verbose; export EXIV2_ECHO=true; fi; python3 runner.py $$verbose ' - @ bash -c ' . functions.source ; cd ../tests ; if [ ! -z $$VERBOSE ]; then verbose=--verbose; export EXIV2_ECHO=true; fi; python3 runner.py $$verbose ' + @echo bash -c 'cd ../tests; export VERBOSE=1; python3 runner.py --verbose' + @bash -c 'cd ../tests; export VERBOSE=1; python3 runner.py --verbose' mostlyclean clean: rm -rf $(top_srcdir)/test/tmp/* diff --git a/tests/bash_tests/testcases.py b/tests/bash_tests/testcases.py index 8d16be7d..6865ba08 100644 --- a/tests/bash_tests/testcases.py +++ b/tests/bash_tests/testcases.py @@ -12,7 +12,7 @@ class TestCases(unittest.TestCase): BT.Config.init() # When the details are displayed, add a newline - if BT.Config.exiv2_echo: + if BT.Config.exiv2_echo or BT.Config.verbose: print() diff --git a/tests/bash_tests/utils.py b/tests/bash_tests/utils.py index 41ab7dff..837a432a 100644 --- a/tests/bash_tests/utils.py +++ b/tests/bash_tests/utils.py @@ -31,6 +31,7 @@ class Config: exiv2_http = 'http://127.0.0.1' exiv2_port = '12760' exiv2_echo = '' + verbose = '' valgrind = '++' @classmethod @@ -460,7 +461,7 @@ class Executer: def run(self): # Whether to display the command to execute - if Config.exiv2_echo: + if Config.exiv2_echo or Config.verbose: print(Config.valgrind, ' '.join(self.args)) # Check stdout diff --git a/tests/suite.conf b/tests/suite.conf index 0164730a..ca8daf29 100644 --- a/tests/suite.conf +++ b/tests/suite.conf @@ -9,6 +9,7 @@ ld_library_path: LD_LIBRARY_PATH exiv2_http: EXIV2_HTTP exiv2_port: EXIV2_PORT exiv2_echo: EXIV2_ECHO +verbose: VERBOSE valgrind: VALGRIND [ENV fallback] @@ -18,6 +19,7 @@ ld_library_path: ${ENV:exiv2_path}/../lib exiv2_http: http://127.0.0.1 exiv2_port: 12760 exiv2_echo: +verbose: valgrind: ++ [paths] diff --git a/tests/system_tests.py b/tests/system_tests.py index d18e4df0..e1e95186 100644 --- a/tests/system_tests.py +++ b/tests/system_tests.py @@ -209,6 +209,7 @@ def configure_suite(config_file): BT.Config.exiv2_http = config['ENV']['exiv2_http'] BT.Config.exiv2_port = config['ENV']['exiv2_port'] BT.Config.exiv2_echo = config['ENV']['exiv2_echo'] + BT.Config.verbose = config['ENV']['verbose'] BT.Config.valgrind = config['ENV']['valgrind']