tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit a9be56bf5cda7c74005d67f0768f94fd8bea1054
parent 02242322aef59b10c4965ca1f7d2e0a65734f34d
Author: Tom Marble <tmarble@info9.net>
Date:   Wed, 10 Dec 2025 15:52:24 +0000

Bug 2004545 - cppunit No tests run or test summary not found r=ahal

Signed-off-by: Tom Marble <tmarble@info9.net>

Differential Revision: https://phabricator.services.mozilla.com/D275799

Diffstat:
Mtesting/cppunittest.toml | 2++
Mtesting/runcppunittests.py | 30++++++++++++++++--------------
2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/testing/cppunittest.toml b/testing/cppunittest.toml @@ -91,6 +91,7 @@ run-if = [ skip-if = [ "os == 'android' && os_version == '14' && arch == 'aarch64'", # requires administrator permission on aarch64 "os == 'mac' && os_version == '15.30' && arch == 'aarch64'", # requires administrator permission on aarch64 + "os == 'win' && os_version == '11.26100' && arch == 'aarch64'", "os == 'win' && os_version == '11.26100' && arch == 'x86'", # fails on win/x86 ] @@ -135,6 +136,7 @@ skip-if = [ "os == 'win' && os_version == '10.2009' && arch == 'x86_64'", "os == 'win' && os_version == '11.26100' && arch == 'x86'", "os == 'win' && os_version == '11.26100' && arch == 'x86_64'", + "os == 'win' && os_version == '11.26100' && arch == 'aarch64'", ] ["TestMozJemallocUtils"] diff --git a/testing/runcppunittests.py b/testing/runcppunittests.py @@ -55,7 +55,7 @@ class CPPUnitTests: def timeout_handler(proc): CPPUnitTests.run_one_test.timed_out = True - message = "timed out after %d seconds" % CPPUnitTests.TEST_PROC_TIMEOUT + message = f"timed out after {CPPUnitTests.TEST_PROC_TIMEOUT} seconds" self.log.test_end( basename, status="TIMEOUT", expected="PASS", message=message ) @@ -63,10 +63,7 @@ class CPPUnitTests: def output_timeout_handler(proc): CPPUnitTests.run_one_test.timed_out = True - message = ( - "timed out after %d seconds without output" - % CPPUnitTests.TEST_PROC_NO_OUTPUT_TIMEOUT - ) + message = f"timed out after {CPPUnitTests.TEST_PROC_NO_OUTPUT_TIMEOUT} seconds without output" self.log.test_end( basename, status="TIMEOUT", expected="PASS", message=message ) @@ -95,7 +92,7 @@ class CPPUnitTests: ) if output: - output = "\n%s" % "\n".join(output) + output = "\n" + "\n".join(output) self.log.process_output(proc.pid, output, command=[prog]) if CPPUnitTests.run_one_test.timed_out: return False @@ -108,7 +105,7 @@ class CPPUnitTests: basename, status="FAIL", expected="PASS", - message=("test failed with return code %d" % proc.returncode), + message=(f"test failed with return code {proc.returncode}"), ) else: self.log.test_end(basename, status="PASS", expected="PASS") @@ -151,7 +148,7 @@ class CPPUnitTests: pathvar = "PATH" if pathvar: if pathvar in env: - env[pathvar] = "%s%s%s" % (libpath, os.pathsep, env[pathvar]) + env[pathvar] = f"{libpath}{os.pathsep}{env[pathvar]}" else: env[pathvar] = libpath @@ -171,9 +168,9 @@ class CPPUnitTests: ) if os.path.isfile(llvmsym): env[symbolizer_path] = llvmsym - self.log.info("Using LLVM symbolizer at %s" % llvmsym) + self.log.info(f"Using LLVM symbolizer at {llvmsym}") else: - self.log.info("Failed to find LLVM symbolizer at %s" % llvmsym) + self.log.info(f"Failed to find LLVM symbolizer at {llvmsym}") return env @@ -223,8 +220,8 @@ class CPPUnitTests: # Mozharness-parseable summary formatting. self.log.info("Result summary:") - self.log.info("cppunittests INFO | Passed: %d" % pass_count) - self.log.info("cppunittests INFO | Failed: %d" % fail_count) + self.log.info(f"cppunittests INFO | Passed: {pass_count}") + self.log.info(f"cppunittests INFO | Failed: {fail_count}") return fail_count == 0 @@ -316,7 +313,7 @@ def extract_unittests_from_args(args, environ, manifest_path): for test in tests: if not os.path.isfile(test[0]): errors = True - log.error("test file not found: %s" % test[0]) + log.error(f"test file not found: {test[0]}") if errors: raise RuntimeError("One or more cppunittests not found; aborting.") @@ -334,6 +331,11 @@ def update_mozinfo(): dirs.add(path) path = os.path.split(path)[0] mozinfo.find_and_update_from_json(*dirs) + print( + "These variables are available in the mozinfo environment and can be used to skip tests conditionally:" + ) + for k in sorted(mozinfo.info.keys()): + print(f" {k}: {mozinfo.info[k]}") def run_test_harness(options, args): @@ -358,7 +360,7 @@ def main(): options, args = parser.parse_args() if not args: print( - """Usage: %s <test binary> [<test binary>...]""" % sys.argv[0], + f"Usage: {sys.argv[0]} <test binary> [<test binary>...]", file=sys.stderr, ) sys.exit(1)