comparison tests/run-tests.py @ 49833:a2356e15200a stable

hghave: add predicates for embedded and filesystem pyoxidizer resources There are a handful of tests with different output between the two flavors of pyoxidizer builds (like the location of the modules and templates), and a few others that avoid `known-bad-output` cases with the embedded resources that shouldn't cause the tests to fail.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 06 Dec 2022 13:02:54 -0500
parents 9a4c76cc8fe6
children a77c1375c316 6515d9a6592d
comparison
equal deleted inserted replaced
49832:9a4c76cc8fe6 49833:a2356e15200a
3449 verbosity = 0 3449 verbosity = 0
3450 elif self.options.verbose: 3450 elif self.options.verbose:
3451 verbosity = 2 3451 verbosity = 2
3452 runner = TextTestRunner(self, verbosity=verbosity) 3452 runner = TextTestRunner(self, verbosity=verbosity)
3453 3453
3454 osenvironb.pop(b'PYOXIDIZED_IN_MEMORY_RSRC', None)
3455 osenvironb.pop(b'PYOXIDIZED_FILESYSTEM_RSRC', None)
3456
3454 if self.options.list_tests: 3457 if self.options.list_tests:
3455 result = runner.listtests(suite) 3458 result = runner.listtests(suite)
3456 else: 3459 else:
3457 install_start_time = time.monotonic() 3460 install_start_time = time.monotonic()
3458 self._usecorrectpython() 3461 self._usecorrectpython()
3884 out, _err = proc.communicate() 3887 out, _err = proc.communicate()
3885 if proc.returncode != 0: 3888 if proc.returncode != 0:
3886 sys.stdout.buffer.write(out) 3889 sys.stdout.buffer.write(out)
3887 sys.exit(1) 3890 sys.exit(1)
3888 3891
3892 cmd = _bytes2sys(b"%s debuginstall -Tjson" % self._hgcommand)
3893 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
3894 out, err = p.communicate()
3895
3896 props = json.loads(out)[0]
3897
3898 # Affects hghave.py
3899 osenvironb.pop(b'PYOXIDIZED_IN_MEMORY_RSRC', None)
3900 osenvironb.pop(b'PYOXIDIZED_FILESYSTEM_RSRC', None)
3901 if props["hgmodules"] == props["pythonexe"]:
3902 osenvironb[b'PYOXIDIZED_IN_MEMORY_RSRC'] = b'1'
3903 else:
3904 osenvironb[b'PYOXIDIZED_FILESYSTEM_RSRC'] = b'1'
3905
3889 def _outputcoverage(self): 3906 def _outputcoverage(self):
3890 """Produce code coverage output.""" 3907 """Produce code coverage output."""
3891 import coverage 3908 import coverage
3892 3909
3893 coverage = coverage.coverage 3910 coverage = coverage.coverage