From 49a1e42cf883e3a68ed45a2ad7577d98222cf109 Mon Sep 17 00:00:00 2001 From: sidheshenator Date: Tue, 14 Apr 2015 13:16:49 -0400 Subject: [PATCH] gold files are easily available in th OP folder in case of diff --- test/script/regression.py | 6 ++++++ test/script/tskdbdiff.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/test/script/regression.py b/test/script/regression.py index 5f5f09dd65..8db5bf0d10 100755 --- a/test/script/regression.py +++ b/test/script/regression.py @@ -848,6 +848,12 @@ class TestResultsDiffer(object): dffcmdlst = ["diff", output_file, gold_file] subprocess.call(dffcmdlst, stdout = diff_file) Errors.add_errors_out(diff_path) + + # create file path for gold files inside report output folder. In case of diff, both gold and current run + # Exception.txt files are available in the report output folder. Prefix Gold- is added to the filename. + gold_file_in_output_dir = output_file[:output_file.rfind("\\")] + "Gold-" + output_file[output_file.rfind("\\")+1:] + shutil.copy(gold_file, gold_file_in_output_dir) + return False else: return True diff --git a/test/script/tskdbdiff.py b/test/script/tskdbdiff.py index e88a471b7e..6a8f5f6727 100755 --- a/test/script/tskdbdiff.py +++ b/test/script/tskdbdiff.py @@ -141,6 +141,12 @@ class TskDbDiff(object): diff_file = codecs.open(diff_path, "wb", "utf_8") dffcmdlst = ["diff", gold_file, output_file] subprocess.call(dffcmdlst, stdout = diff_file) + + # create file path for gold files inside output folder. In case of diff, both gold and current run files + # are available in the report output folder. Prefix Gold- is added to the filename. + gold_file_in_output_dir = output_file[:output_file.rfind("/")] + "/Gold-" + output_file[output_file.rfind("/")+1:] + shutil.copy(gold_file, gold_file_in_output_dir) + return False