Skip to content

Commit 55355af

Browse files
committed
Add coverage for app tests
1 parent 9f1dd45 commit 55355af

1 file changed

Lines changed: 24 additions & 7 deletions

File tree

.github/workflows/code-coverage.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
coverage:
4747
name: Coverage
4848
runs-on: ubuntu-latest
49-
timeout-minutes: 30
49+
timeout-minutes: 45
5050
needs: build_wolfssl
5151
steps:
5252
- name: Checkout wolfSSH
@@ -87,20 +87,37 @@ jobs:
8787
LLVM_PROFILE_FILE="$PWD/prof/%p-%m.profraw" \
8888
timeout -k 30 1200 make check
8989
90+
# 'make check' does not execute wolfsshd, so run it separately
91+
- name: Run wolfSSHd tests
92+
working-directory: ./apps/wolfsshd/test
93+
run: |
94+
prof="$GITHUB_WORKSPACE/prof/%p-%m.profraw"
95+
sudo LLVM_PROFILE_FILE="$prof" SSHD_ENV="LLVM_PROFILE_FILE=$prof" \
96+
./run_all_sshd_tests.sh
97+
sudo chown -R "$(id -u):$(id -g)" "$GITHUB_WORKSPACE/prof"
98+
9099
- name: Report coverage
91100
run: |
92101
llvm-profdata-18 merge -sparse prof/*.profraw -o wolfssh.profdata
93102
# llvm-cov takes one binary positionally and the rest via -object.
94-
# Tests linking the shared library are libtool wrapper scripts, so
95-
# take the real binary from .libs when one is there.
103+
# Programs linking the shared library are libtool wrapper scripts, so
104+
# take the real binary from .libs when one is there. The apps are
105+
# optional, so skip whatever this configuration did not build.
96106
first=""
97107
args=()
98-
for t in tests/*.test; do
99-
real="tests/.libs/$(basename "$t")"
108+
for t in tests/*.test apps/wolfssh/wolfssh apps/wolfsshd/wolfsshd \
109+
apps/wolfsshd/test/test_configuration; do
110+
[ -e "$t" ] || continue
111+
real="$(dirname "$t")/.libs/$(basename "$t")"
100112
[ -x "$real" ] || real="$t"
101-
if [ -z "$first" ]; then first="$real"; else args+=(-object "$real"); fi
113+
if [ -z "$first" ]; then
114+
first="$real"
115+
else
116+
args+=(-object "$real")
117+
fi
102118
done
103-
ignore='(tests|examples|apps)/.*|.*/include/wolfssl/.*|.*/wolfssh/.*\.h'
119+
ignore='(tests|examples)/.*|apps/wolfsshd/test/.*'
120+
ignore="$ignore"'|.*/include/wolfssl/.*|.*/wolfssh/.*\.h'
104121
llvm-cov-18 report "$first" "${args[@]}" \
105122
-instr-profile=wolfssh.profdata \
106123
--show-mcdc-summary \

0 commit comments

Comments
 (0)