Better regression test logging.
parent
dc441d09e5
commit
3554301afe
|
@ -167,7 +167,7 @@ def process_dir(d, outfile_results, zipin, result):
|
||||||
print("Processing directory " + d)
|
print("Processing directory " + d)
|
||||||
for f in sorted(os.listdir(d)):
|
for f in sorted(os.listdir(d)):
|
||||||
fullpath = os.path.join(d, f)
|
fullpath = os.path.join(d, f)
|
||||||
if os.path.isdir(fullpath) and not f == ".svn":
|
if os.path.isdir(fullpath) and not f[:1] == '.':
|
||||||
process_dir(fullpath, outfile_results, zipin, result)
|
process_dir(fullpath, outfile_results, zipin, result)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -190,32 +190,26 @@ def process_dir(d, outfile_results, zipin, result):
|
||||||
"regression database? Use gen_db.zip to re-generate.")
|
"regression database? Use gen_db.zip to re-generate.")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Ignore extensions via settings.py configured list
|
|
||||||
# todo: Fix for multi dot extensions like .skeleton.xml
|
|
||||||
ext = os.path.splitext(fullpath)[1].lower()
|
|
||||||
if ext != "" and ext in settings.exclude_extensions:
|
|
||||||
continue
|
|
||||||
|
|
||||||
print("-"*60 + "\n " + os.path.realpath(fullpath) + " pp: " + pppreset)
|
print("-"*60 + "\n " + os.path.realpath(fullpath) + " pp: " + pppreset)
|
||||||
|
|
||||||
outfile_actual = prepare_output_dir(fullpath, filehash, "ACTUAL")
|
outfile_actual = prepare_output_dir(fullpath, filehash, "ACTUAL")
|
||||||
outfile_expect = prepare_output_dir(fullpath, filehash, "EXPECT")
|
outfile_expect = prepare_output_dir(fullpath, filehash, "EXPECT")
|
||||||
outfile_results.write("assimp dump "+"-"*80+"\n")
|
outfile_results.write("assimp dump "+"-"*80+"\n")
|
||||||
outfile_results.flush()
|
outfile_results.flush()
|
||||||
|
|
||||||
command = [assimp_bin_path,
|
command = [assimp_bin_path,
|
||||||
"dump",
|
"dump",
|
||||||
fullpath, outfile_actual, "-b", "-s", "-l" ] +\
|
fullpath, outfile_actual, "-b", "-s", "-l" ] +\
|
||||||
pppreset.split()
|
pppreset.split()
|
||||||
|
|
||||||
r = subprocess.call(command, **shellparams)
|
r = subprocess.call(command, **shellparams)
|
||||||
print(r)
|
outfile_results.flush()
|
||||||
|
|
||||||
if r and not failure:
|
if r and not failure:
|
||||||
result.fail(fullpath, outfile_expect, pppreset, IMPORT_FAILURE, r)
|
result.fail(fullpath, outfile_expect, pppreset, IMPORT_FAILURE, r)
|
||||||
|
outfile_results.write("Failed to import\n")
|
||||||
continue
|
continue
|
||||||
elif failure and not r:
|
elif failure and not r:
|
||||||
result.fail(fullpath, outfile_expect, pppreset, EXPECTED_FAILURE_NOT_MET)
|
result.fail(fullpath, outfile_expect, pppreset, EXPECTED_FAILURE_NOT_MET)
|
||||||
|
outfile_results.write("Expected import to fail\n")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
with open(outfile_expect, "wb") as s:
|
with open(outfile_expect, "wb") as s:
|
||||||
|
@ -227,21 +221,24 @@ def process_dir(d, outfile_results, zipin, result):
|
||||||
except IOError:
|
except IOError:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
outfile_results.write("Expected data length: {0}\n".format(len(input_expected)))
|
||||||
|
outfile_results.write("Actual data length: {0}\n".format(len(input_actual)))
|
||||||
|
failed = False
|
||||||
if len(input_expected) != len(input_actual):
|
if len(input_expected) != len(input_actual):
|
||||||
result.fail(fullpath, outfile_expect, pppreset, DATABASE_LENGTH_MISMATCH,
|
result.fail(fullpath, outfile_expect, pppreset, DATABASE_LENGTH_MISMATCH,
|
||||||
len(input_expected), len(input_actual))
|
len(input_expected), len(input_actual))
|
||||||
continue
|
# Still compare the dumps to see what the difference is
|
||||||
|
failed = True
|
||||||
|
|
||||||
outfile_results.write("assimp cmpdump "+"-"*80+"\n")
|
outfile_results.write("assimp cmpdump "+"-"*80+"\n")
|
||||||
outfile_results.flush()
|
outfile_results.flush()
|
||||||
|
|
||||||
command = [ assimp_bin_path, 'cmpdump', outfile_actual, outfile_expect ]
|
command = [ assimp_bin_path, 'cmpdump', outfile_actual, outfile_expect ]
|
||||||
if subprocess.call(command, **shellparams) != 0:
|
if subprocess.call(command, **shellparams) != 0:
|
||||||
|
if not failed:
|
||||||
result.fail(fullpath, outfile_expect, pppreset, DATABASE_VALUE_MISMATCH)
|
result.fail(fullpath, outfile_expect, pppreset, DATABASE_VALUE_MISMATCH)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
result.ok(fullpath, pppreset, COMPARE_SUCCESS,
|
result.ok(fullpath, pppreset, COMPARE_SUCCESS, len(input_expected))
|
||||||
len(input_expected))
|
|
||||||
|
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
def del_folder_with_contents(folder):
|
def del_folder_with_contents(folder):
|
||||||
|
|
Loading…
Reference in New Issue