Check-in [77d5262842]
Overview
Comment:Added a coverage target to emit code coverage from tests
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 77d5262842564618876878ab74737097abda23b9aee16a7e2fe541d4979d11c7
User & Date: rkeene on 2019-09-16 20:04:14
Other Links: manifest | tags
Context
2019-09-16
20:43
More tests and small fixes check-in: 10f67b2ced user: rkeene tags: trunk
20:04
Added a coverage target to emit code coverage from tests check-in: 77d5262842 user: rkeene tags: trunk
19:48
Added file needed for tests check-in: ac265bf316 user: rkeene tags: trunk
Changes

Modified Makefile from [f9aa6c59be] to [be830d5dd1].

1
2
3
4
5
6
7
8
9
10
CPPFLAGS := -I. -DUSE_TCL_STUBS=1 -DXVFS_MODE_FLEXIBLE -DXVFS_DEBUG
CFLAGS   := -fPIC -g3 -ggdb3 -Wall
LDFLAGS  :=
LIBS     := -ltclstub8.6
TCLSH    := tclsh

all: example.so

example.c: $(shell find example -type f) $(shell find lib -type f) xvfs.c.rvt xvfs-create Makefile
	./xvfs-create --directory example --name example > example.c.new
|
|
|







1
2
3
4
5
6
7
8
9
10
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

example.c: $(shell find example -type f) $(shell find lib -type f) xvfs.c.rvt xvfs-create Makefile
	./xvfs-create --directory example --name example > example.c.new
26
27
28
29
30
31
32











33
34
35
36

37


38
39
40
41

test: example.so
	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












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 __test__.tcl



distclean: clean

.PHONY: all clean distclean test







>
>
>
>
>
>
>
>
>
>
>




>

>
>



|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

test: example.so
	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 coverage