You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
garble/testdata/scripts
Daniel Martí 1db6e1e230
make -coverprofile include toolexec processes (#216)
testscript already included magic to also account for commands in the
total code coverage. That does not happen with plain tests, since those
only include coverage from the main test process.

The main problem was that, before, indirectly executed commands did not
properly save their coverage profile anywhere for testscript to collect
it at the end. In other words, we only collected coverage from direct
garble executions like "garble -help", but not indirect ones like "go
build -toolexec=garble".

	$ go test -coverprofile=cover.out
	PASS
	coverage: 3.6% of statements
	total coverage: 16.6% of statements
	ok  	mvdan.cc/garble	6.453s

After the delicate changes to testscript, any direct or indirect
executions of commands all go through $PATH and properly count towards
the total coverage:

	$ go test -coverprofile=cover.out
	PASS
	coverage: 3.6% of statements
	total coverage: 90.5% of statements
	ok  	mvdan.cc/garble	33.258s

Note that we can also get rid of our code to set up $PATH, since
testscript now does it for us.

goversion.txt needed minor tweaks, since we no longer set up $WORK/.bin.

Finally, note that we disable the reuse of $GOCACHE when collecting
coverage information. This is to do "full builds", as otherwise the
cached package builds would result in lower coverage.

Fixes #35.
4 years ago
..
asm.txt testdata: don't let tests rely on rewriting mod files 5 years ago
basic.txt make -coverprofile include toolexec processes (#216) 4 years ago
cgo.txt testdata: don't let tests rely on rewriting mod files 5 years ago
debugdir.txt testdata: don't let tests rely on rewriting mod files 5 years ago
goprivate.txt obfuscate fewer std packages (#196) 4 years ago
goversion.txt make -coverprofile include toolexec processes (#216) 4 years ago
help.txt Share data between processes via a shared file. (#192) 5 years ago
implement.txt testdata: don't let tests rely on rewriting mod files 5 years ago
imports.txt fix garbling names belonging to indirect imports (#203) 4 years ago
init.txt testdata: add test case for init funcs in many files (#208) 4 years ago
ldflags.txt testdata: don't let tests rely on rewriting mod files 5 years ago
linkname.txt fixed some bugs related to additional linkname corner cases (#210) 4 years ago
literals.txt do not try to obfuscate huge literals (#204) 4 years ago
modinfo.txt testdata: don't let tests rely on rewriting mod files 5 years ago
plugin.txt testdata: don't let tests rely on rewriting mod files 5 years ago
seed.txt testdata: don't let tests rely on rewriting mod files 5 years ago
syntax.txt rewrite go:linkname directives with garbled names (#200) 4 years ago
test.txt testdata: don't let tests rely on rewriting mod files 5 years ago
tiny.txt testdata: don't let tests rely on rewriting mod files 5 years ago