diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f69ad00b20dbea13e3c27698530c622f55d50734..6975805bc2b8b09b64bacce2fcf4838856c313b9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,6 @@ build_ip_and_tests: only: &only - master # Run on all changes to master branch - tags # Run on all tags - - schedules # Run on schedule - triggers # Run by trigger (on merge request) - web # Run by manual request from web UI @@ -26,34 +25,34 @@ build_ip_and_tests: - cd driver - "make -j`nproc`" -test_ip_unit: +test_ip_fast: stage: test only: *only dependencies: [build_ip_and_tests] script: - cd test - - make test_unit XUNIT=1 + - make test_fast - make coverage coverage: "/lines......: ([^%]+%)/" artifacts: when: always paths: - test/code_html - - test/test_unit.xml + - test/tests_fast.xml - test/xunit.xsl -test_ip_sanity: +test_ip_nightly: stage: test dependencies: [build_ip_and_tests] only: - schedules script: - cd test - - make test_sanity XUNIT=1 + - make test_nightly artifacts: when: always paths: - - test/test_sanity.xml + - test/test_nightly.xml - test/xunit.xsl pages: diff --git a/test/Makefile b/test/Makefile index ffe537966f23ff604662e87ebaa8f10ffb10aa52..78b878b1b5295e3b7b710a87328fde32b295a8eb 100644 --- a/test/Makefile +++ b/test/Makefile @@ -3,26 +3,13 @@ XUNIT ?= 0 TEST_FLAGS = -p`nproc` -ifeq ($(XUNIT),0) - TEST_FLAGS += - POSTPROC := : -else - TEST_FLAGS += --xunit-xml ../$@.xml1 - POSTPROC = ret=$$?; (echo ''; echo ''; cat $@.xml1) >$@.xml; rm $@.xml1; exit $$ret -endif - all: test coverage elaborate: - $(PYTHON) run.py --elaborate + $(PYTHON) run.py test tests_fast.yml -- --elaborate $(TEST_FLAGS) -test: - $(PYTHON) run.py $(TEST_FLAGS); $(POSTPROC) -test_unit: - $(PYTHON) run.py $(TEST_FLAGS) 'lib.tb_*_unit_test.*'; $(POSTPROC) -test_feature: -test_sanity: - $(PYTHON) run.py $(TEST_FLAGS) 'lib.tb_sanity.*'; $(POSTPROC) +test_%: tests_%.yml FORCE + $(PYTHON) run.py test $< -- $(TEST_FLAGS) coverage: lcov --capture --directory build --output-file code_coverage.info @@ -31,4 +18,6 @@ coverage: clean: -rm -Rf build -.PHONY: all elaborate test test_unit test_feature test_sanity clean +FORCE: + +.PHONY: all elaborate clean diff --git a/test/testfw/data/pkg_feature_exec_dispath-body.vhd b/test/testfw/data/pkg_feature_exec_dispath-body.vhd index e893a2eee7ec15b1f63d0a7b72b496f96ec02dfd..169263adef5268fab48710c11846992c0e66e9c9 100644 --- a/test/testfw/data/pkg_feature_exec_dispath-body.vhd +++ b/test/testfw/data/pkg_feature_exec_dispath-body.vhd @@ -33,7 +33,7 @@ begin if false then {% for test in tests %} - elsif run("{{ test }}") then + elsif str_equal(test_name, "{{ test }}") then {{ test }}_feature_exec( o => o, rand_ctr => rand_ctr, diff --git a/test/tests_fast.yml b/test/tests_fast.yml index 430c9fb0b998d5087cb92f7adf38cda07f653230..4e5305b56fc60f6deb3b57b3070bf339d645f676 100644 --- a/test/tests_fast.yml +++ b/test/tests_fast.yml @@ -1,4 +1,4 @@ -.unit: +unit: default: log_level: warning error_tolerance: 0 @@ -36,7 +36,7 @@ feature: log_level: warning error_tolerance: 0 iterations: 50 - timeout: 100 ms + timeout: 1 ms tests: abort_transmittion: arbitration: diff --git a/test/tests_nightly.yml b/test/tests_nightly.yml new file mode 100644 index 0000000000000000000000000000000000000000..6efced866f525f5dee3627c21878a6d48537c4d4 --- /dev/null +++ b/test/tests_nightly.yml @@ -0,0 +1,73 @@ +_default: &default + log_level: info + error_tolerance: 0 +unit: + default: + <<: *default + iterations: 50 + timeout: 100 ms + tests: + bit_stuffing: + iterations: 10 + wave: unit/Bit_Stuffing/bsdt_unit.tcl + apb: + iterations: 1 + bus_sync: + wave: unit/Bus_Sampling/bsnc_unit.tcl + crc: + wave: unit/CRC/crct_unit.tcl + fault_confinement: + wave: unit/Fault_confinement/fault_conf_unit.tcl + int_man: + wave: unit/Int_Manager/intm_unit.tcl + mess_filt: + wave: unit/Message_filter/msft_unit.tcl + presc: + wave: unit/Prescaler/prsc_unit.tcl + protocol_control: + wave: unit/Protocol_Control/pctl_unit.tcl + rx_buf: + wave: unit/RX_Buffer/rxbf_unit.tcl + iterations: 10 + tx_arb: + wave: unit/TX_Arbitrator/txar_unit.tcl + tx_buf: + wave: unit/TX_Buffer/txbf_unit.tcl +feature: + default: + <<: *default + iterations: 50 + timeout: 1 ms + tests: + abort_transmittion: + arbitration: + fault_confinement: + forbid_fd: + interrupt: + invalid_configs: + overload: + retr_limit: + rx_status: + spec_mode: + traf_meas: + tran_delay: + tx_arb_time_tran: + +sanity: + default: + <<: *default + iterations: 10 + timeout: 2 sec + error_tolerance: 0 + gauss_iter: 40 + tests: + "1Mb/10Mb 20 m Star": + topology: star + bus_len_v: [10.0, 10.0, 10.0, 10.0, 0.0, 0.0] + trv_del_v: [10, 10, 10, 10] + osc_tol_v: [0, 5, 10, 15] + nw_mean: 70.0 + nw_var: 5.0 + ng_mean: 300000.0 + ng_var: 100000.0 + timing_config: [4, 1, 8, 8, 8, 3, 3, 1, 5, 2]