run-tests: Make .exp and .out file names unique by prefixing with dir.

Input files like basics/string_format.py and float/string_format.py have
the same basename so using that name for writing the output (.exp and .out
files) when both tests fail, results in the output of the first one being
overwritten.

Avoid this by using unique names for the output, replacing path characters
with underscores.
pull/4040/merge
stijn 2018-08-08 15:20:22 +02:00 zatwierdzone przez Damien George
rodzic 3fccd78aca
commit ca0d78cebb
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -394,8 +394,8 @@ def run_tests(pyb, tests, args, base_path="."):
if verdict == "exclude":
continue
test_basename = os.path.basename(test_file)
test_name = os.path.splitext(test_basename)[0]
test_basename = test_file.replace('..', '_').replace('./', '').replace('/', '_')
test_name = os.path.splitext(os.path.basename(test_file))[0]
is_native = test_name.startswith("native_") or test_name.startswith("viper_")
is_endian = test_name.endswith("_endian")
is_int_big = test_name.startswith("int_big") or test_name.endswith("_intbig")