From 7190404b14597fa0afffff1313b192c2b83e04cb Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Fri, 20 Nov 2026 22:44:17 +0100 Subject: test.bash: collect coverage from unit and integration tests Most of the test suite runs the gocryptfs binary, so "go test -cover" alone misses most of the coverage. test.bash now builds a separate coverage-instrumented binary into ./coverage (./gocryptfs stays a normal build, so "make install" does not pick it up) and points the tests at it via $GOCRYPTFS_TEST_BINARY. "go test -cover" overwrites $GOCOVERDIR with a temporary directory and ignores the data of other executables in it, so the directory is passed as $GOCRYPTFS_COVERAGE_DATA and test_helpers sets $GOCOVERDIR from it. Only our packages that go into the gocryptfs binary are instrumented, so the reported percentage is relative to that code. The merged result is written to coverage/coverage.out and coverage/coverage.html. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '.gitignore') diff --git a/.gitignore b/.gitignore index 73b7357..dac064a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,6 @@ gocryptfs.1 /VERSION # Ignore macos specific files -.DS_Store \ No newline at end of file +.DS_Store +# Coverage data written by test.bash +/coverage -- cgit v1.2.3