Skip to content

Conversation

hartwork
Copy link
Contributor

Before

# USER= make -C tests/lcov/extract/ check 
make: Entering directory '[..]/tests/lcov/extract'
Starting tests
lcov/extract/extract.sh ........... [fail] (time 4.7s, mem 58.8MB)
    Skipping 228 previous lines (see [..]/tests//test.log)
    ...
      functions...: 28.6% (2 of 7 functions)
      branches....: 33.3% (8 of 24 branches)
    Filter suppressions:
      region:
        2 instances
        5 coverpoints
    Message summary:
      no messages were reported
    Error:  did not find expected context field
  EXITCODE ...: 1
1 tests executed, 0 passed, 1 failed, 0 skipped (time 4.7s, mem 58.8MB)
Result log stored in [..]/tests/test.log
make: *** [../../common.mak:116: check] Error 1
make: Leaving directory '[..]/tests/lcov/extract'

After

# USER= make -C tests/lcov/extract/ check 
make: Entering directory '[..]/tests/lcov/extract'
Starting tests
lcov/extract/extract.sh ........... [pass] (time 23.1s, mem 58.9MB)
1 tests executed, 1 passed, 0 failed, 0 skipped (time 23.1s, mem 58.9MB)
Result log stored in [..]/tests/test.log
make: Leaving directory '[..]/tests/lcov/extract'

@henry2cox henry2cox merged commit f53848b into linux-test-project:master Jan 11, 2025
5 checks passed
@hartwork hartwork deleted the issue-378-make-extraction-tests-work-without-dollar-user branch January 24, 2025 23:39
@gfim
Copy link

gfim commented May 18, 2025

I'm still seeing this error with release 2.3.1. This is on RHEL 8. I've installed the Perl dependencies and done "sudo make install". But when I do make test, I get:

[user@swip-lnx-3 lcov-2.3.1]$ make test
Creating coverage files (2 tests, 5 source files)
Source tree ......... done (950 lines, 50 functions, 3428 branches)
Full coverage ....... done
Target coverage ..... done
Partial coverage .... done
Zero coverage ....... done
Starting tests
genhtml/full.sh ................... [pass] (time 0.5s, mem 49.0MB)
genhtml/zero.sh ................... [pass] (time 0.5s, mem 48.9MB)
genhtml/demangle.sh ............... [pass] (time 1.5s, mem 41.1MB)
genhtml/relative/relative.sh ...... [pass] (time 0.3s, mem 41.3MB)
genhtml/lambda/lambda.sh .......... [pass] (time 2.0s, mem 116.4MB)
lcov/add/zero.sh .................. [pass] (time 0.4s, mem 39.0MB)
lcov/add/zero2.sh ................. [pass] (time 0.6s, mem 44.1MB)
lcov/add/full.sh .................. [pass] (time 0.4s, mem 39.3MB)
lcov/add/full2.sh ................. [pass] (time 0.7s, mem 44.3MB)
lcov/add/prune.sh ................. [pass] (time 0.9s, mem 35.4MB)
lcov/add/track.sh ................. [pass] (time 0.2s, mem 34.8MB)
lcov/misc/help.sh ................. [pass] (time 0.2s, mem 34.3MB)
lcov/misc/version.sh .............. [pass] (time 0.2s, mem 34.0MB)
lcov/summary/zero.sh .............. [pass] (time 0.3s, mem 39.1MB)
lcov/summary/full.sh .............. [pass] (time 0.3s, mem 39.2MB)
lcov/extract/extract.sh ........... [fail] (time 3.4s, mem 55.8MB)
Skipping 231 previous lines (see /home/user/lcov-2.3.1/tests//test.log)
...
region:
2 instances
5 coverpoints
Message summary:
no messages were reported
{"filter":0.0244338512420654,"parse":{"./unused.gcno":0.0172600746154785,"./a-extract.gcda":0.0183939933776855},"chunk":{"2":0.03183913230896,"1":0.0310859680175781},"child":{"2":0.0206761360168457,"1":0.0195209980010986},"find":{".":0.0100140571594238},"order":{"./a-extract.gcda":2,"./unused.gcno":1},"config":{"version":"LCOV version 2.3.1-1","tool":"geninfo","cores":45,"cmdLine":"geninfo . --branch-coverage --parallel 0 --profile --all -o context.info --context /home/user/lcov-2.3.1/scripts/context.pm","maxParallel":45,"tool_dir":"/home/user/lcov-2.3.1/bin","date":"Mon May 19 08:21:57 AEST 2025","bin":"/home/user/lcov-2.3.1/bin","uname":"Linux swip-lnx-3 4.18.0-553.51.1.el8_10.x86_64 #1 SMP Fri Apr 25 00:55:37 EDT 2025 x86_64 x86_64 x86_64 GNU/Linux","hostname":"swip-lnx-3","url":"https://github.com//linux-test-project/lcov","buildDir":"/home/user/lcov-2.3.1/tests/lcov/extract"},"interval":0,"chunkSize":1,"file":{"./a-extract.gcda":0.0184040069580078,"./unused.gcno":0.0172691345214844},"exec":{"./unused.gcno":0.00353384017944336,"./a-extract.gcda":0.00407290458679199},"nFiles":2,"append":{"./unused.gcno":5.00679016113281e-06,"2":2.90870666503906e-05,"./a-extract.gcda":5.00679016113281e-06},"process":{"2":0.0202021598815918,"1":0.0190179347991943},"undump":{"2":0.00049591064453125,"1":0.000461816787719727},"read":{"./a-extract.gcda":0.0119268894195557,"./unused.gcno":0.0120220184326172},"emit":0.0250489711761475,"work":{"1":0.0190238952636719,"2":0.0202322006225586},"context":{"user":"user","perl":"/usr/bin/perl","perl_version":"v5.26.3"},"queue":{"2":0.010159969329834,"1":0.0105922222137451},"write":0.000610113143920898,"total":0.0773239135742188,"nChunks":2,"check_consistency":{"/opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/basic_string.tcc":0.000108957290649414},"merge":{"1":5.96046447753906e-06,"2":3.00407409667969e-05},"translate":{"./a-extract.gcda":0.00178194046020508,"./unused.gcno":0.000803947448730469}}
SF:/home/user/lcov-2.3.1/tests/lcov/extract/extract.cpp
SF:/home/user/lcov-2.3.1/tests/lcov/extract/unused.c
Error: did not expect to find context field in info
EXITCODE ...: 1
make[3]: *** [../../common.mak:116: check] Error 1
make[2]: *** [../common.mak:116: check] Error 1
16 tests executed, 15 passed, 1 failed, 0 skipped (time 13.3s, mem 736.4MB)
Result log stored in /home/user/lcov-2.3.1/tests/test.log
make[1]: *** [common.mak:116: check] Error 1
make: *** [Makefile:272: check] Error 2
[user@swip-lnx-3 lcov-2.3.1]$ echo $USER
user
[user@swip-lnx-3 lcov-2.3.1]$ id -u -n
user
[user@swip-lnx-3 lcov-2.3.1]$

@hartwork
Copy link
Contributor Author

@gfim the error seems different:

  • mine was "did not find expected context field"
  • yours is "did not expect to find context field in info"

It sounds like opposites to me but I could be wrong. Also ${USER} is set in your case.

I'm not a maintainer here, but please open a dedicated issue if you want this to get the attention it deserves and not fall through the cracks. if you can provide and attach a Dockerfile there that reproduces the issue out of thing air, that would rock. Without more details in a dedicated and more detailed issue, it will be hard to reproduce and fix. Thank you.

@henry2cox
Copy link
Collaborator

The issue is that the test is simply looking for the string 'user' in the output context (and not expecting to find it) - whereas your run directory appears to be /home/user/lcov-2.3.1/... - which matches in an unexpected way.
I'll check if this can be easily resolved.

henry2cox added a commit to henry2cox/lcov that referenced this pull request May 23, 2025
henry2cox added a commit that referenced this pull request May 23, 2025
@henry2cox
Copy link
Collaborator

@gfim - issue should be resolved now.

@gfim
Copy link

gfim commented May 27, 2025

yes, fixed - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants