Add badges to README, add code coverage to pipeline

This commit is contained in:
zvon 2020-04-16 15:06:15 +02:00
parent ff4be474e4
commit 7db446dd8d
3 changed files with 39 additions and 10 deletions

View File

@ -31,6 +31,23 @@ linux:test:
script: script:
- ./tv_rename --help - ./tv_rename --help
linux:codacy:
image: debian
stage: test
needs: []
before_script:
- apt update
- apt install -y libsqlite3-dev libcurl4-openssl-dev g++ make build-essential gettext git gcovr
- export CXX=g++
- git submodule update --init rapidjson
script:
- make test.out
- make check
after_script:
- find . -type f -name "*.gcno" -execdir gcov -pb -r {} +
- gcovr --root . -k -j 2 --xml -o gcovr_report.xml --exclude-directories "tests" --exclude-directories "gtk" --exclude-directories "win*" --exclude-directories "sqlite-am*" --exclude-directories "rapidjson"
- bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r "gcovr_report.xml" --language CPP --force-language
formatting:test: formatting:test:
image: debian image: debian
stage: test stage: test
@ -41,7 +58,7 @@ formatting:test:
- apt install -y clang-format - apt install -y clang-format
script: script:
- FORMAT="ok" - FORMAT="ok"
- while read f ; do clang-format -style=file "$f" > temp.pp ; if [ $(diff temp.pp "$f" | wc -l) -gt 0 ] ; then echo "$f needs reformatting" ; FORMAT="nok" ; fi ; done <<< $(find . -iname "*pp") - while read f ; do clang-format -style=file "$f" > temp.pp ; if [ "$f" == "./tests/catch.hpp" ] ; then continue ; fi ; if [ $(diff temp.pp "$f" | wc -l) -gt 0 ] ; then echo "$f needs reformatting" ; FORMAT="nok" ; fi ; done <<< $(find . -iname "*pp")
- rm temp.pp - rm temp.pp
- 'if [ "$FORMAT" = "nok" ] ; then exit 1 ; fi' - 'if [ "$FORMAT" = "nok" ] ; then exit 1 ; fi'

View File

@ -15,7 +15,8 @@ default: tv_rename
.PHONY: clean .PHONY: clean
clean: clean:
rm -Rf *.o tv_rename tv_rename_gui locale rm -Rf *.o tv_rename tv_rename_gui locale *.gcda *.gcno *.gcov\
gcovr_report.xml
.PHONY: install .PHONY: install
install: tv_rename install: tv_rename
@ -139,25 +140,25 @@ WINDOWS_GUI_OBJECTS = gui.obj mainwindow.obj\
progresswindow.obj seasonwindow.obj\ progresswindow.obj seasonwindow.obj\
databasewindow.obj searchwindow.obj databasewindow.obj searchwindow.obj
gui.obj: windows/gui.cpp gui.obj: win32/gui.cpp
$(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c $(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c
mainwindow.obj: windows/mainwindow.cpp mainwindow.obj: win32/mainwindow.cpp
$(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c $(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c
gui_functions.obj: windows/gui_functions.cpp gui_functions.obj: win32/gui_functions.cpp
$(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c $(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c
filesystem.obj: windows/filesystem.cpp filesystem.obj: windows/filesystem.cpp
$(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c $(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c
network.obj: windows/network.cpp network.obj: windows/network.cpp
$(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c $(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c
patternwindow.obj: windows/patternwindow.cpp patternwindow.obj: win32/patternwindow.cpp
$(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c $(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c
progresswindow.obj: windows/progresswindow.cpp progresswindow.obj: win32/progresswindow.cpp
$(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c $(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c
seasonwindow.obj: windows/seasonwindow.cpp seasonwindow.obj: win32/seasonwindow.cpp
$(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c $(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c
databasewindow.obj: windows/databasewindow.cpp databasewindow.obj: win32/databasewindow.cpp
$(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c $(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c
searchwindow.obj: windows/searchwindow.cpp searchwindow.obj: win32/searchwindow.cpp
$(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c $(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c
tv_rename.obj: tv_rename.cpp tv_rename.obj: tv_rename.cpp
$(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c $(CXX) -MD -EHsc -Fo"$@" $^ -DGUI -D_WIN32 -DUNICODE -c
@ -184,3 +185,11 @@ locale/%/LC_MESSAGES:
locale/%/LC_MESSAGES/tv_rename.mo: translations/%.po locale/%/LC_MESSAGES locale/%/LC_MESSAGES/tv_rename.mo: translations/%.po locale/%/LC_MESSAGES
msgfmt -c $< -o $<.mo msgfmt -c $< -o $<.mo
mv $<.mo $@ mv $<.mo $@
test.out: tests/test.cpp functions.cpp unix/network.cpp progress.cpp\
unix/filesystem.cpp tv_rename.cpp
$(CXX) $^ -lcurl -lsqlite3 --coverage -o test.out
.PHONY: check
check: test.out
./test.out

View File

@ -1,3 +1,6 @@
[![pipeline status](https://gitlab.com/zvon/tv_rename_cpp/badges/tests/pipeline.svg)](https://gitlab.com/zvon/tv_rename_cpp/-/commits/tests)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9aace967ca614da4bdb7a500f63858dd)](https://www.codacy.com/manual/tom.zvon/tv_rename_cpp?utm_source=gitlab.com&amp;utm_medium=referral&amp;utm_content=zvon/tv_rename_cpp&amp;utm_campaign=Badge_Grade)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/9aace967ca614da4bdb7a500f63858dd)](https://www.codacy.com/manual/tom.zvon/tv_rename_cpp?utm_source=gitlab.com&utm_medium=referral&utm_content=zvon/tv_rename_cpp&utm_campaign=Badge_Coverage)
# Rename TV Show files # Rename TV Show files
This program downloads episode names from <http://thetvdb.com> and adds them as a suffix to the appropriate files This program downloads episode names from <http://thetvdb.com> and adds them as a suffix to the appropriate files