Skip to content

Commit

Permalink
Fix problems with path-filtering in regression suite on Windows. (#19223
Browse files Browse the repository at this point in the history
) (#19224)

Added logic to handle cases where there are extra path-separator escapes when filtering paths in text to substitute VISIT_TOP_DIR.

Also reverted a change in Variant.C where unix-style paths were converted to Windows-style in 'EscapeQuotedString'.
  • Loading branch information
biagas committed Jan 11, 2024
1 parent a838768 commit d569ef8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/common/state/Variant.C
Original file line number Diff line number Diff line change
Expand Up @@ -2980,6 +2980,10 @@ Variant::TokenizeQuotedString(const string &val,stringVector &tokens)
// Kathleen Biagas, Fri Dec 1 2023
// If on Windows, also escape path separators and convert unix-style.
//
// Kathleen Biagas, Wed Jan 3 2024
// Revert conversion of unix-style path separator on Windows, it caused
// problems for 'dir/var' strings that weren't file-paths.
//
// ****************************************************************************
string
Variant::EscapeQuotedString(const string &val)
Expand All @@ -2999,11 +3003,6 @@ Variant::EscapeQuotedString(const string &val)
res.push_back('\\');
res.push_back('\\');
}
else if(val[i] == '/')
{
res.push_back('\\');
res.push_back('\\');
}
#endif
else
{
Expand Down
10 changes: 10 additions & 0 deletions src/test/py_src/visit_test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1681,6 +1681,10 @@ def ProcessDiffImage(case_name, baseimg, testimg, diffimg):
#
# Mark C. Miller, Fri Sep 11 19:55:17 PDT 2020
# Added numdifftol arg
#
# Kathleen Biagas, Tue Jan 2, 2024
# Handle cases where there are extra path-separator escapes on Windows.
#
# ----------------------------------------------------------------------------

def FilterTestText(inText, baseText, numdifftol):
Expand All @@ -1691,10 +1695,16 @@ def FilterTestText(inText, baseText, numdifftol):
# We have to filter out the absolute path information we might see in
# this string. runtest passes the value for visitTopDir here.
#

# handle cases where there are extra path-separator escapes
if platform.system() == "Windows":
inText = inText.replace("\\\\", "\\")

inText = inText.replace(TestEnv.params["run_dir"], "VISIT_TOP_DIR/test")
inText = inText.replace(out_path(), "VISIT_TOP_DIR/test")
inText = inText.replace(test_root_path(), "VISIT_TOP_DIR/test")
inText = inText.replace(data_path(), "VISIT_TOP_DIR/data")

#
# Only consider doing any string substitution if numerical diff threshold
# is non-zero
Expand Down

0 comments on commit d569ef8

Please sign in to comment.