From b9129cef4d41ef1e1f19f92b7aabaaafef8060ce Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Sun, 22 Mar 2020 06:42:27 -0700 Subject: [PATCH] Fix --parallel readelf test after previous commit Previous commit broke them because lambdas can't be picked by multiprocessing --- test/run_readelf_tests.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/run_readelf_tests.py b/test/run_readelf_tests.py index 5f9a8ae..f4d06ae 100755 --- a/test/run_readelf_tests.py +++ b/test/run_readelf_tests.py @@ -48,7 +48,7 @@ def discover_testfiles(rootdir): yield os.path.join(rootdir, filename) -def run_test_on_file(filename, verbose, opt): +def run_test_on_file(filename, verbose=False, opt=None): """ Runs a test on the given input filename. Return True if all test runs succeeded. If opt is specified, rather that going over the whole @@ -57,13 +57,17 @@ def run_test_on_file(filename, verbose, opt): """ success = True testlog.info("Test file '%s'" % filename) - options = [opt] if opt else [ + if opt is None: + options = [ '-e', '-d', '-s', '-n', '-r', '-x.text', '-p.shstrtab', '-V', '--debug-dump=info', '--debug-dump=decodedline', '--debug-dump=frames', '--debug-dump=frames-interp', '--debug-dump=aranges', '--debug-dump=pubtypes', '--debug-dump=pubnames' ] + else: + options = [opt] + for option in options: if verbose: testlog.info("..option='%s'" % option) @@ -229,9 +233,7 @@ def main(): if len(filenames) > 1 and args.parallel: pool = Pool() - results = pool.map( - lambda filename: run_test_on_file(filename, False, args.opt), - filenames) + results = pool.map(run_test_on_file, filenames) failures = results.count(False) else: failures = 0 -- 2.30.2