mirror of
https://github.com/anrieff/libcpuid
synced 2024-11-20 23:01:51 +00:00
Tests: fix the --fix option
--fix was removing delimiters from real output, but there are required.
This commit is contained in:
parent
3b8b7dfaf8
commit
39506501d5
2 changed files with 5 additions and 2 deletions
|
@ -15392,6 +15392,7 @@ general
|
|||
256 (authoritative)
|
||||
EPYC (Rome)
|
||||
fpu vme de pse tsc msr pae mce cx8 apic mtrr sep pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht pni pclmul monitor ssse3 cx16 sse4_1 sse4_2 syscall movbe popcnt aes xsave osxsave avx mmxext nx fxsr_opt rdtscp lm lahf_lm cmp_legacy svm abm misalignsse sse4a 3dnowprefetch osvw ibs skinit wdt ts ttp tm_amd hwpstate constant_tsc fma3 f16c rdrand x2apic cpb aperfmperf avx2 bmi1 bmi2 sha_ni rdseed adx
|
||||
--------------------------------------------------------------------------------
|
||||
x86
|
||||
x86-64-v3
|
||||
general
|
||||
|
|
|
@ -96,9 +96,11 @@ def do_test(inp, expected_out, binary, test_file_name, num_cpu_type):
|
|||
os.system(cmd)
|
||||
os.unlink(fninp)
|
||||
real_out = []
|
||||
real_out_delim = [] # when fixing the file, delimiters are required
|
||||
try:
|
||||
f = open(fnoutp, "rt")
|
||||
for s in f.readlines():
|
||||
real_out_delim.append(s.strip())
|
||||
if delimiter not in s:
|
||||
real_out.append(s.strip())
|
||||
f.close()
|
||||
|
@ -107,7 +109,7 @@ def do_test(inp, expected_out, binary, test_file_name, num_cpu_type):
|
|||
return "Exception"
|
||||
if len(real_out) != len(expected_out) or len(real_out) != len(fields) * num_cpu_type:
|
||||
if fix:
|
||||
fixFile(test_file_name, inp, real_out)
|
||||
fixFile(test_file_name, inp, real_out_delim)
|
||||
return "Number of records, fixed."
|
||||
else:
|
||||
return "Unexpected number of records returned\n - expected length %d\n - real length %d\n - %d fields" % (len(expected_out), len(real_out), len(fields) * num_cpu_type)
|
||||
|
@ -119,7 +121,7 @@ def do_test(inp, expected_out, binary, test_file_name, num_cpu_type):
|
|||
return "OK"
|
||||
else:
|
||||
if fix:
|
||||
fixFile(test_file_name, inp, real_out)
|
||||
fixFile(test_file_name, inp, real_out_delim)
|
||||
return "Mismatch, fixed."
|
||||
else:
|
||||
return "Mismatch in fields:\n%s" % "\n".join([fmt_error(err) for err in err_fields])
|
||||
|
|
Loading…
Reference in a new issue