From b2fcb76ee0dcbc43e2b12f9d4073dc691e9467bb Mon Sep 17 00:00:00 2001 From: Simon Kagstrom Date: Mon, 11 Mar 2024 16:39:32 +0100 Subject: [PATCH] test: Dump outpuit --- .github/workflows/ci.yml | 1 - .github/workflows/freebsd-build.sh | 1 + src/engines/bash-engine.cc | 1 + tests/tools/filter.py | 2 ++ 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ededda7..6c9cab9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,6 @@ jobs: sync: rsync prepare: pkg install -y binutils cmake elfutils python bash git python2 run: | - sudo ln -s /usr/local/bin/bash /bin/bash chmod u+x .github/workflows/freebsd-build.sh .github/workflows/ci-run-tests.sh .github/workflows/freebsd-build.sh x86_64 .github/workflows/ci-run-tests.sh diff --git a/.github/workflows/freebsd-build.sh b/.github/workflows/freebsd-build.sh index 4b9086a5..5427d363 100644 --- a/.github/workflows/freebsd-build.sh +++ b/.github/workflows/freebsd-build.sh @@ -17,6 +17,7 @@ run () { chmod u+x .github/workflows/test-executable.sh kcov --include-pattern=test-executable.sh coverage .github/workflows/test-executable.sh + cat coverage/test-executable.sh/coverage.json } run "$@" diff --git a/src/engines/bash-engine.cc b/src/engines/bash-engine.cc index 5d115bb1..92f6aeea 100644 --- a/src/engines/bash-engine.cc +++ b/src/engines/bash-engine.cc @@ -152,6 +152,7 @@ class BashEngine : public ScriptEngineBase const char **argv = conf.getArgv(); unsigned int argc = conf.getArgc(); int xtraceFd = 782; // Typical bash users use 3,4 etc but not high fd numbers (?) + if (0) { // However, the range of fd numbers that this process can use is limited by the caller of this process. // The following code specification will require discussion with many kcov users. diff --git a/tests/tools/filter.py b/tests/tools/filter.py index 4a80eee0..387b60c6 100644 --- a/tests/tools/filter.py +++ b/tests/tools/filter.py @@ -29,6 +29,8 @@ def runTest(self): rv,o = self.do(testbase.kcov + " --bash-dont-parse-binary-dir --include-path=" + testbase.sources + "/tests/bash/first-dir " + testbase.outbase + "/kcov " + testbase.sources + "/tests/bash/shell-main") dom = parse_cobertura.parseFile(testbase.outbase + "/kcov/shell-main/cobertura.xml") + f = open(testbase.outbase + "/kcov/shell-main/cobertura.xml").read() + print(f) assert parse_cobertura.hitsPerLine(dom, "shell-main", 29) == None assert parse_cobertura.hitsPerLine(dom, "c.sh", 3) >= 1 assert parse_cobertura.hitsPerLine(dom, "b.sh", 3) >= 1