diff --git a/Tupfile b/Tupfile index 64ea80e..a5a3491 100644 --- a/Tupfile +++ b/Tupfile @@ -1,4 +1,5 @@ -LDFLAGS += `pkg-config --libs jack sndfile cairomm-1.0 ntk ntk_images` +LDFLAGS +=`pkg-config --libs jack sndfile cairomm-1.0 ntk ntk_images` +LDFLAGS +=-lgcov : src/*.o |> g++ %f $(LDFLAGS) -o %o |> luppp diff --git a/src/Tupfile b/src/Tupfile index b532d8a..d0cfdfc 100644 --- a/src/Tupfile +++ b/src/Tupfile @@ -1,10 +1,10 @@ # Tup build file for Luppp +# +CFLAGS += -g -Wall -march=native -msse -mfpmath=sse -ffast-math -fprofile-arcs -ftest-coverage -CFLAGS += -g -Wall -march=native -msse -mfpmath=sse -ffast-math - -INCLUDES += `pkg-config --cflags jack sndfile cairomm-1.0 ntk ntk_images` +INCLUDES += `pkg-config --cflags jack sndfile cairomm-1.0 ntk ntk_images` : foreach *.cxx observer/*.cxx state/*.cxx cjson/*.c dsp/*.cxx controller/*.cxx \ -avtk/*.cxx |> g++ $(CFLAGS) -c %f $(INCLUDES) -o %o |> %B.o +avtk/*.cxx |> ^c^ g++ $(CFLAGS) -c %f $(INCLUDES) -o %o |> %B.o | %B.gcno diff --git a/src/config.hxx b/src/config.hxx index 8370161..28a6bfc 100644 --- a/src/config.hxx +++ b/src/config.hxx @@ -6,28 +6,30 @@ #define NAME "Luppp" /// TEST OPTIONS -#define BUILD_TESTS 1 +#define BUILD_TESTS 1 +// only works with BUILD TESTS +#define BUILD_COVERAGE_TEST 1 /// DEBUG OPTIONS // Track operations -#define DEBUG_TRACKS 1 +#define DEBUG_TRACKS 1 // Clip selection / queueing -#define DEBUG_CLIP 1 +#define DEBUG_CLIP 1 // Buffer loading / resizing -#define DEBUG_BUFFER 1 +#define DEBUG_BUFFER 1 // Logic : Warning NON RT! -#define DEBUG_LOGIC 1 +#define DEBUG_LOGIC 1 // State save / load -#define DEBUG_STATE 1 +#define DEBUG_STATE 1 /// COMPILE OPTIONS -#define DEBUG_KILL_ON_ERR 1 +#define DEBUG_KILL_ON_ERR 1 /// General Options diff --git a/src/main.cxx b/src/main.cxx index 2b1b430..c6cd0af 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -38,10 +38,17 @@ int main(int argc, char** argv) jack = new Jack(); #ifdef BUILD_TESTS - cout << "New GUI, JACK() made" << endl; jack->getGridLogic()->runTests(); - cout << "Done testing." << endl; + +#ifdef BUILD_COVERAGE_TEST + LUPPP_NOTE("%s","Done testing, quitting!"); + return 0; #endif + + // FIXME: Reset the state of GUI / GridLogic here. Create a "new session"? + +#endif + cout << "Done testing... launching Luppp." << endl; jack->activate(); gui->show(); } diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..fb463a7 --- /dev/null +++ b/test.sh @@ -0,0 +1,29 @@ + +# Compile with: +#define BUILD_TESTS +#define BUILD_COVERAGE_TEST +-lgcov + +# Run program, the runtime determines the output! + +# Run gcov on each file, it shows output data: +gcov -r -b *.gcda + +# Make lcov update the stats in its info file +lcov --directory . -zerocounters +lcov --directory . --capture --output-file lcov.info + +# Generate HTML output +genhtml lcov.info + +rm src/*.gcda +rm src/*.gcno + +rm src/lcov.info +rm src/gcov.css +rm src/*.html +rm src/*.png + +rm gcov.data + +