File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed
Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 5252 run : cd src && nmake.exe /F Makefile.windows.mk
5353 - name : Test
5454 run : ./loda.exe test
55+ code-coverage :
56+ runs-on : ubuntu-22.04
57+ steps :
58+ - uses : actions/checkout@v2
59+ - name : Generate
60+ run : sudo apt install lcov && cd src && make -f Makefile.linux-x86.mk coverage
61+ - name : Upload
62+ uses : actions/upload-artifact@v4
63+ with :
64+ name : code-coverage-report
65+ path : src/coverage/
Original file line number Diff line number Diff line change 66* .o
77* .obj
88* .pdb
9+ /src /coverage /
910/src /loda
1011/src /loda.exe
1112/tests /programs /local /
Original file line number Diff line number Diff line change 1- CXXFLAGS += -I. -O2 - g -Wall -Werror -fmessage-length=0 -std=c++17
1+ CXXFLAGS += -I. -g -Wall -Werror -fmessage-length=0 -std=c++17
22
33ifdef LODA_VERSION
44CXXFLAGS += -DLODA_VERSION=$(LODA_VERSION )
@@ -17,10 +17,23 @@ OBJS = cmd/benchmark.o cmd/boinc.o cmd/commands.o cmd/main.o cmd/test.o \
1717 oeis/oeis_list.o oeis/oeis_manager.o oeis/oeis_program.o oeis/oeis_sequence.o \
1818 sys/file.o sys/git.o sys/jute.o sys/log.o sys/metrics.o sys/process.o sys/setup.o sys/util.o sys/web_client.o
1919
20+ loda : CXXFLAGS += -O2
2021loda : $(OBJS )
2122 $(CXX ) $(LDFLAGS ) -o loda $(OBJS )
2223 [ -L ../loda ] || ( cd .. && ln -s src/loda loda )
2324 du -sh loda
2425
26+ coverage : CXXFLAGS += -O0 -fprofile-arcs -ftest-coverage
27+ coverage : LDFLAGS += --coverage
28+ coverage : $(OBJS )
29+ $(CXX ) $(LDFLAGS ) -o loda $(OBJS )
30+ [ -L ../loda ] || ( cd .. && ln -s src/loda loda )
31+ cd .. && ./loda test && cd src
32+ gcov $(OBJS:.o=.cpp )
33+ mkdir coverage
34+ lcov -c -d . -o coverage/coverage.info
35+ lcov -r coverage/coverage.info ' /Library/*' ' /usr/*' -o coverage/coverage-clean.info
36+ genhtml coverage/coverage-clean.info -o coverage
37+
2538clean :
26- rm -R -f $(OBJS ) loda ../loda
39+ rm -R -f $(OBJS ) $( OBJS:.o=.gcda ) $( OBJS:.o=.gcno ) * .gcov coverage loda ../loda
You can’t perform that action at this time.
0 commit comments