Forum Discussion
Altera_Forum
Honored Contributor
13 years agoHere's the Makefile section:
# -----------------------------------------------------------------# Check target# -----------------------------------------------------------------# # Change into the control_test build directory so that the# exitstatus and log files are generated in the control_test# directory. 'make clean' will then remove that directory.# # The logic to test the exit code could be transformed into# a bash script that takes the executable as the argument.# Eg. check_exit_status $testbench# # Each testbench should have the generic makecheck, with a default# of 0. The makefile sets the parameter to 1. The exitstatus file# will not be created when makecheck = 0.#
.PHONY: check
check: $(CONTROL_TEST_LIB_DONE)
@cd $(CONTROL_TEST_DIR);
rm -f exitstatus;
for check in $(control_test_CHECKS); do
echo -n "TEST: $$check";
$(VSIM) $(VSIM_ARGS) -c control_test.$$check -gmakecheck=1
-do "run -a; q" &> $$check.log;
if ; then
if ; then
echo -e "\rFAIL: $$check (see $$check.log)";
rm exitstatus;
exit 1;
else
echo -e "\rPASS: $$check";
rm exitstatus;
fi;
else
echo -e "\rFAIL: $$check. `pwd`/exitstatus file not found. Check the testbench.";
exit 1;
fi;
done