[test] force to run git diff under root directory

This commit is contained in:
tangxifan 2022-05-23 10:32:43 +08:00
parent 488a934097
commit b41cbad5d3
1 changed files with 3 additions and 0 deletions

View File

@ -179,12 +179,15 @@ run-task _task_copy
echo -e "Testing output files without time stamp";
run-task basic_tests/no_time_stamp $@
# Run git-diff to ensure no changes on the golden netlists
# Switch to root path in case users are running the tests in another location
cd ${OPENFPGA_PATH}
git diff --name-status -- ':${OPENFPGA_PATH}/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/**'
if git diff --name-status --exit-code -- ':${OPENFPGA_PATH}/openfpga_flow/tasks/basic_tests/no_time_stamp/golden_outputs_no_time_stamp/**'; then
echo -e "Golden netlist remain unchanged"
else
echo -e "Detect changes in golden netlists"; exit 1;
fi
cd -
# Repgression test to test multi-user enviroment
# Note: Keep this task as the last one!!!