Skip to content

Commit

Permalink
Modify regression tests to support custom files
Browse files Browse the repository at this point in the history
  • Loading branch information
ckendrick committed Jul 19, 2024
1 parent eebde4a commit 33a88c1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
14 changes: 14 additions & 0 deletions regression_tests/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ run_tests() {

# Compare results between the two
files_to_compare=(*)
# if the test has FILES defined, compare those files instead
if [[ ! -z "${FILES}" ]]; then
files_to_compare=(${FILES[@]})
fi
cd ${GITHUB_WORKSPACE}/build/tests

for f in "${files_to_compare[@]}"; do
Expand Down Expand Up @@ -145,6 +149,16 @@ run_tests() {
continue
fi
check_fail
elif [[ ! -z "${FILES}" ]]; then
echo "Comparing custom file ${f}"
if [[ $TYPE == "DMD" ]]; then
./fileComparator "${EX_DMD_PATH_BASELINE}/${f}" "${EX_DMD_PATH_LOCAL}/${f}" "1.0e-5"
elif [[ $TYPE == "PROM" ]]; then
./fileComparator "${EX_PROM_PATH_BASELINE}/${f}" "${EX_PROM_PATH_LOCAL}/${f}" "1.0e-5"
else
continue
fi
check_fail
fi
done
move_output_files
Expand Down
10 changes: 9 additions & 1 deletion regression_tests/tests/dmd/parametric_tw_csv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,13 @@ CMDS=(
"./parametric_tw_csv -o hc_local -train-set dmd_train_local -rdim 16 -dtc 0.01 -online"
)
TYPE="DMD"
OFFSET=5
OFFSET=0

# custom list of output files to compare
FILES=(
"./run/hc_local/window0/par0_eigenvalue.csv"
"./run/hc_local/window0/par0_singular_value.csv"
"./run/hc_local/dmd_par5_prediction_error.csv"
)

run_tests

0 comments on commit 33a88c1

Please sign in to comment.