From e690513e4103ea8fc2f09408636eef0cce51b65e 2012-04-24 07:46:59 From: Michal Klocek Date: 2012-04-24 07:46:59 Subject: [PATCH] Adds converage support to pro files, renames scatterseries -> scatterchart --- diff --git a/charts.pro b/charts.pro index fea227b..e8d7b22 100644 --- a/charts.pro +++ b/charts.pro @@ -37,3 +37,25 @@ win32:{ docs.depends = FORCE QMAKE_EXTRA_TARGETS += docs +coverage:{ + + CONFIG+=debug + QMAKE_DISTCLEAN += -r ./coverage + QMAKE_CLEAN += build/*.gcda build/*.gcno + QMAKE_EXTRA_TARGETS += buildcoverage runcoverage gencoverage + + buildcoverage.target = build_coverage + buildcoverage.depends = all + buildcoverage.commands = mkdir -p ./coverage; \ + make -C src prepare_coverage; + + runcoverage.target = run_coverage + runcoverage.depends = buildcoverage + runcoverage.commands = for f in `ls ./bin/test/tst_*` ; do echo "processing \$\$f test..."; \$\$f >> unit.log; done ; + + gencoverage.target = gen_coverage + gencoverage.depends = runcoverage + gencoverage.commands = make -C src gen_coverage; \ + genhtml -o ./coverage ./coverage/coverage.info --prefix $$PWD +} + diff --git a/src/scatterseries/qscatterseries.cpp b/src/scatterchart/qscatterseries.cpp similarity index 100% rename from src/scatterseries/qscatterseries.cpp rename to src/scatterchart/qscatterseries.cpp diff --git a/src/scatterseries/qscatterseries.h b/src/scatterchart/qscatterseries.h similarity index 100% rename from src/scatterseries/qscatterseries.h rename to src/scatterchart/qscatterseries.h diff --git a/src/scatterseries/qscatterseries_p.h b/src/scatterchart/qscatterseries_p.h similarity index 100% rename from src/scatterseries/qscatterseries_p.h rename to src/scatterchart/qscatterseries_p.h diff --git a/src/scatterseries/scatter.pri b/src/scatterchart/scatter.pri similarity index 100% rename from src/scatterseries/scatter.pri rename to src/scatterchart/scatter.pri diff --git a/src/scatterseries/scatterchartitem.cpp b/src/scatterchart/scatterchartitem.cpp similarity index 100% rename from src/scatterseries/scatterchartitem.cpp rename to src/scatterchart/scatterchartitem.cpp diff --git a/src/scatterseries/scatterchartitem_p.h b/src/scatterchart/scatterchartitem_p.h similarity index 100% rename from src/scatterseries/scatterchartitem_p.h rename to src/scatterchart/scatterchartitem_p.h diff --git a/src/src.pro b/src/src.pro index e2b0877..6be657a 100644 --- a/src/src.pro +++ b/src/src.pro @@ -64,7 +64,7 @@ include(barchart/barchart.pri) include(legend/legend.pri) include(linechart/linechart.pri) include(piechart/piechart.pri) -include(scatterseries/scatter.pri) +include(scatterchart/scatter.pri) include(splinechart/splinechart.pri) include(themes/themes.pri) include(xychart/xychart.pri) @@ -208,3 +208,29 @@ win32:QMAKE_DISTCLEAN += /Q \ $$CHART_BUILD_HEADER_DIR \ $$CHART_BUILD_LIB_DIR +############################## COVERAGE ######################################### + +coverage:{ + +QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage +QMAKE_LDFLAGS += -fprofile-arcs -ftest-coverage + +LIBS += -lgcov +CONFIG += debug + +QMAKE_CLEAN += $$OBJECTS_DIR/*.gcda $$OBJECTS_DIR/*.gcno $$PWD/*.gcov ../coverage/*.info +QMAKE_EXTRA_TARGETS += preparecoverage gencoverage + +preparecoverage.target = prepare_coverage +preparecoverage.depends = all +preparecoverage.commands = lcov --directory $$OBJECTS_DIR --zerocounters ;\ + lcov -i -d $$OBJECTS_DIR -c -o ../coverage/base.info -b $$PWD; + +gencoverage.target = gen_coverage +gencoverage.depends = all +gencoverage.commands = lcov -d $$OBJECTS_DIR -c -o ../coverage/src.info -b $$PWD;\ + lcov -e ../coverage/base.info $$PWD/* $$PWD/animations/* $$PWD/areachart/* $$PWD/axis/* $$PWD/barchart/* $$PWD/legend/* $$PWD/linechart/* $$PWD/piechart/* $$PWD/scatterchart/* $$PWD/splinechart/* $$PWD/themes/* $$PWD/xychart/* -o ../coverage/base.info;\ + lcov -e ../coverage/src.info $$PWD/* $$PWD/animations/* $$PWD/areachart/* $$PWD/axis/* $$PWD/barchart/* $$PWD/legend/* $$PWD/linechart/* $$PWD/piechart/* $$PWD/scatterchart/* $$PWD/splinechart/* $$PWD/themes/* $$PWD/xychart/* -o ../coverage/src.info;\ + lcov -a ../coverage/base.info -a ../coverage/src.info -o ../coverage/coverage.info; +} +