Skip to content
Snippets Groups Projects
Commit 0fc55ad8 authored by dam1n19's avatar dam1n19
Browse files

Updated regression flow to properly handle timeouts

parent a026bed2
No related branches found
No related tags found
No related merge requests found
......@@ -202,28 +202,28 @@ TEST_LIST_VCS = $(shell cat $(TEST_LIST_FILE) | while read line || [ -n "$$line"
# Create templates for Make Targets
define mti_template
.PHONY: $(1)
.PHONY: mti_$(1)
mti_$(1):
@echo Starting Test $(1)
@timeout $(TIMEOUT) $$(MAKE) run_mti TESTNAME=$(1) > $$(REGRESSION)/$(1).log || true
@$$(MAKE) regression_test_mti TESTNAME=$(1) >> /dev/null 2>&1
@if cat $$(REGRESSION)/$(1).log | grep " TEST PASSED "; then echo "$(1): PASSED" >> $$(REGRESSION)/RESULTS.log; elif cat $$(REGRESSION)/$(1).log | grep " TEST SKIPPED "; then echo "$(1): SKIPPED"; else echo "$(1): FAILED" >> $$(REGRESSION)/RESULTS.log; fi > /dev/null
@echo Finished Test $(1)
endef
define xm_template
.PHONY: $(1)
.PHONY: xm_$(1)
xm_$(1):
@echo Starting Test $(1)
@timeout $(TIMEOUT) $$(MAKE) -j1 run_xm TESTNAME=$(1) > $$(REGRESSION)/$(1).log || true
@$$(MAKE) regression_test_xm TESTNAME=$(1) >> /dev/null 2>&1
@if cat $$(REGRESSION)/$(1).log | grep " TEST PASSED "; then echo "$(1): PASSED" >> $$(REGRESSION)/RESULTS.log; elif cat $$(REGRESSION)/$(1).log | grep " TEST SKIPPED "; then echo "$(1): SKIPPED"; else echo "$(1): FAILED" >> $$(REGRESSION)/RESULTS.log; fi > /dev/null
@echo Finished Test $(1)
endef
define vcs_template
.PHONY: $(1)
.PHONY: vcs_$(1)
vcs_$(1):
@echo Starting Test $(1)
@timeout $(TIMEOUT) $$(MAKE) -j1 run_vcs TESTNAME=$(1) > $$(REGRESSION)/$(1).log || true
@$$(MAKE) regression_test_vcs TESTNAME=$(1) >> /dev/null 2>&1
@if cat $$(REGRESSION)/$(1).log | grep -i " TEST PASSED "; then echo "$(1): PASSED" >> $$(REGRESSION)/RESULTS.log; elif cat $$(REGRESSION)/$(1).log | grep -i " TEST SKIPPED "; then echo "$(1): SKIPPED"; else echo "$(1): FAILED" >> $$(REGRESSION)/RESULTS.log; fi > /dev/null
@echo Finished Test $(1)
endef
......@@ -233,6 +233,16 @@ $(foreach TESTNAME,$(TEST_LIST), $(eval $(call mti_template,$(TESTNAME))))
$(foreach TESTNAME,$(TEST_LIST), $(eval $(call xm_template,$(TESTNAME))))
$(foreach TESTNAME,$(TEST_LIST), $(eval $(call vcs_template,$(TESTNAME))))
# Make Simulate Targets with timeouts
regression_test_mti:
@timeout $(TIMEOUT) $(MAKE) run_mti TESTNAME=$(TESTNAME) > $(REGRESSION)/$(TESTNAME).log || true
regression_test_xm:
@timeout $(TIMEOUT) $(MAKE) run_xm TESTNAME=$(TESTNAME) > $(REGRESSION)/$(TESTNAME).log || true
regression_test_vcs:
@timeout $(TIMEOUT) $(MAKE) run_vxs TESTNAME=$(TESTNAME) > $(REGRESSION)/$(TESTNAME).log || true
# Create a List of PHONY Targets
.PHONY: run_$(SIMULATOR) sim_$(SIMULATOR) all_$(SIMULATOR) test_$(SIMULATOR)
......@@ -326,8 +336,13 @@ run_mti : code compile_mti
@echo "run -all" > $(SIM_DIR)/run.tcl.tmp
@echo "quit -f" >> $(SIM_DIR)/run.tcl.tmp
@mv $(SIM_DIR)/run.tcl.tmp $(SIM_DIR)/run.tcl
cd $(SIM_DIR); vsim $(MTI_RUN_OPTIONS) -c $(TB_TOP) -do run.tcl | tee logs/run_$(TESTNAME).log ;
cd $(SIM_DIR); vsim $(MTI_RUN_OPTIONS) -c $(TB_TOP) -do run.tcl | tee $(SIM_DIR)/logs/run_$(TESTNAME).log ;
run_mti_to:
timeout 2s $(MAKE) run_mti >> /dev/null 2>&1
run_mti_wrap:
$(MAKE) run_mti_to
test_mti:
@echo $(TESTNAME)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment