Commit 7effbee7 authored by Martin Jeřábek's avatar Martin Jeřábek
Browse files

ci: fix flags, add makefile

parent 7f916b97
......@@ -7,9 +7,9 @@ build_ip_and_tests:
allow_failure: true
script:
- cd test
- python run.py --elaborate
- make elaborate
build_driver:
.build_driver:
stage: build
allow_failure: true
script:
......@@ -21,5 +21,10 @@ test_ip:
allow_failure: true
script:
- cd test
- python run.py --xunit-xml test_output.xml
- "gcov -s `realpath ..` *.gcda | tail -n1"
- make test XUNIT=1
- make coverage
coverage: "/lines......: ([^%]+%)/"
artifacts:
paths:
- code_html
- test.xml
PYTHON := python3
XUNIT ?= 0
TEST_FLAGS = -p`nproc`
ifeq ($(XUNIT),0)
TEST_FLAGS +=
else
TEST_FLAGS += --xunit-xml $@.xml
endif
all: test coverage
elaborate:
$(PYTHON) run.py --elaborate
test:
$(PYTHON) run.py $(TEST_FLAGS)
test_unit:
test_feature:
test_sanity:
coverage:
lcov --capture --directory . --output-file $@
genhtml code_coverage.info --output-directory code_html
clean:
-rm -Rf *.gcno *.gcda vunit_out
.PHONY: all elaborate test test_unit test_feature test_sanity clean
......@@ -47,17 +47,9 @@ for pattern in ['../src/**/*.vhd', '*.vhd', 'unit/**/*.vhd', 'sanity/*.vhd', 'li
for f in glob(p, recursive=True):
lib.add_source_file(str(f))
lib.add_compile_option("ghdl.flags", ["-Wc,-g"])
#ui.add_compile_option('ghdl.flags', ['--ieee=synopsys'])
#lib.add_compile_option("ghdl.flags", ["-Wc,-g"])
lib.add_compile_option("ghdl.flags", ["-fprofile-arcs", "-ftest-coverage"])
ui.set_sim_option("ghdl.elab_flags", ["-Wl,-lgcov", "-Wl,--coverage", "-Wl,-no-pie"])
ui.set_sim_option("ghdl.sim_flags", ["--ieee-asserts=disable-at-0"])
try:
ui.main()
except SystemExit as exc:
all_ok = exc.code == 0
#if all_ok:
# subprocess.call(["lcov", "--capture", "--directory", ".", "--output-file", "code_coverage.info"])
# subprocess.call(["genhtml", "code_coverage.info", "--output-directory", "code_html"])
ui.main()
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