@@ -1,8 +1,8 @@ -CPPFLAGS := -I. -DUSE_TCL_STUBS=1 -DXVFS_MODE_FLEXIBLE -DXVFS_DEBUG -CFLAGS := -fPIC -g3 -ggdb3 -Wall -LDFLAGS := +CPPFLAGS := -I. -DUSE_TCL_STUBS=1 -DXVFS_MODE_FLEXIBLE -DXVFS_DEBUG $(XVFS_ADD_CPPFLAGS) +CFLAGS := -fPIC -g3 -ggdb3 -Wall $(XVFS_ADD_CFLAGS) +LDFLAGS := $(XVFS_ADD_LDFLAGS) LIBS := -ltclstub8.6 TCLSH := tclsh all: example.so @@ -28,14 +28,28 @@ rm -f __test__.tcl echo 'if {[catch { load ./example.so Xvfs_example; source //xvfs:/example/main.tcl }]} { puts stderr $$::errorInfo; exit 1 }; exit 0' > __test__.tcl $(GDB) $(TCLSH) __test__.tcl $(TCL_TEST_ARGS) rm -f __test__.tcl +coverage: + $(MAKE) clean + $(MAKE) example.so XVFS_ADD_CFLAGS=-coverage XVFS_ADD_LDFLAGS=-coverage + $(MAKE) test + rm -f xvfs-test-coverage.info + lcov --capture --directory . --output-file xvfs-test-coverage.info + rm -rf xvfs-test-coverage + mkdir xvfs-test-coverage + genhtml xvfs-test-coverage.info --output-directory xvfs-test-coverage + rm -f xvfs-test-coverage.info + clean: rm -f xvfs-create-standalone.new xvfs-create-standalone rm -f example.c example.c.new rm -f example.so example.o + rm -f example.gcda example.gcno rm -f __test__.tcl + rm -f xvfs-test-coverage.info + rm -rf xvfs-test-coverage distclean: clean -.PHONY: all clean distclean test +.PHONY: all clean distclean test coverage