Commit 77c04c94 authored by Martin Jeřábek's avatar Martin Jeřábek

testfw: feature tests pass, fix CI

parent b5d52ea1
...@@ -14,7 +14,6 @@ build_ip_and_tests: ...@@ -14,7 +14,6 @@ build_ip_and_tests:
only: &only only: &only
- master # Run on all changes to master branch - master # Run on all changes to master branch
- tags # Run on all tags - tags # Run on all tags
- schedules # Run on schedule
- triggers # Run by trigger (on merge request) - triggers # Run by trigger (on merge request)
- web # Run by manual request from web UI - web # Run by manual request from web UI
...@@ -26,34 +25,34 @@ build_ip_and_tests: ...@@ -26,34 +25,34 @@ build_ip_and_tests:
- cd driver - cd driver
- "make -j`nproc`" - "make -j`nproc`"
test_ip_unit: test_ip_fast:
stage: test stage: test
only: *only only: *only
dependencies: [build_ip_and_tests] dependencies: [build_ip_and_tests]
script: script:
- cd test - cd test
- make test_unit XUNIT=1 - make test_fast
- make coverage - make coverage
coverage: "/lines......: ([^%]+%)/" coverage: "/lines......: ([^%]+%)/"
artifacts: artifacts:
when: always when: always
paths: paths:
- test/code_html - test/code_html
- test/test_unit.xml - test/tests_fast.xml
- test/xunit.xsl - test/xunit.xsl
test_ip_sanity: test_ip_nightly:
stage: test stage: test
dependencies: [build_ip_and_tests] dependencies: [build_ip_and_tests]
only: only:
- schedules - schedules
script: script:
- cd test - cd test
- make test_sanity XUNIT=1 - make test_nightly
artifacts: artifacts:
when: always when: always
paths: paths:
- test/test_sanity.xml - test/test_nightly.xml
- test/xunit.xsl - test/xunit.xsl
pages: pages:
......
...@@ -3,26 +3,13 @@ XUNIT ?= 0 ...@@ -3,26 +3,13 @@ XUNIT ?= 0
TEST_FLAGS = -p`nproc` TEST_FLAGS = -p`nproc`
ifeq ($(XUNIT),0)
TEST_FLAGS +=
POSTPROC := :
else
TEST_FLAGS += --xunit-xml ../$@.xml1
POSTPROC = ret=$$?; (echo '<?xml version="1.0" encoding="utf-8"?>'; echo '<?xml-stylesheet href="xunit.xsl" type="text/xsl"?>'; cat $@.xml1) >$@.xml; rm $@.xml1; exit $$ret
endif
all: test coverage all: test coverage
elaborate: elaborate:
$(PYTHON) run.py --elaborate $(PYTHON) run.py test tests_fast.yml -- --elaborate $(TEST_FLAGS)
test: test_%: tests_%.yml FORCE
$(PYTHON) run.py $(TEST_FLAGS); $(POSTPROC) $(PYTHON) run.py test $< -- $(TEST_FLAGS)
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)
coverage: coverage:
lcov --capture --directory build --output-file code_coverage.info lcov --capture --directory build --output-file code_coverage.info
...@@ -31,4 +18,6 @@ coverage: ...@@ -31,4 +18,6 @@ coverage:
clean: clean:
-rm -Rf build -rm -Rf build
.PHONY: all elaborate test test_unit test_feature test_sanity clean FORCE:
.PHONY: all elaborate clean
...@@ -33,7 +33,7 @@ begin ...@@ -33,7 +33,7 @@ begin
if false then if false then
{% for test in tests %} {% for test in tests %}
elsif run("{{ test }}") then elsif str_equal(test_name, "{{ test }}") then
{{ test }}_feature_exec( {{ test }}_feature_exec(
o => o, o => o,
rand_ctr => rand_ctr, rand_ctr => rand_ctr,
......
.unit: unit:
default: default:
log_level: warning log_level: warning
error_tolerance: 0 error_tolerance: 0
...@@ -36,7 +36,7 @@ feature: ...@@ -36,7 +36,7 @@ feature:
log_level: warning log_level: warning
error_tolerance: 0 error_tolerance: 0
iterations: 50 iterations: 50
timeout: 100 ms timeout: 1 ms
tests: tests:
abort_transmittion: abort_transmittion:
arbitration: arbitration:
......
_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]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment