[ https://issues.apache.org/jira/browse/PROTON-2357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17313905#comment-17313905 ]
ASF GitHub Bot commented on PROTON-2357: ---------------------------------------- jiridanek commented on pull request #303: URL: https://github.com/apache/qpid-proton/pull/303#issuecomment-812554756 > Now I wonder if there is any way to run make coverage for a single file too? Here's the finest-grain way of running tests that is available (that I know of): Use `ctest -VV -N -R cpp-url-test` to ask ctest to print you the test command. Then add --help at the end, and you'd get a help text from Catch1: ``` $ /nix/store/33abxyajzdaggfbcrxzzpslc4582r84l-python3-3.7.9/bin/python3.7 "/home/jdanek/repos/qpid/qpid-proton/scripts/env.py" "--" "TEST_EXE_PREFIX=/nix/store/7kw3730vr14phxld7l0dm7jslkac8fly-valgrind-3.16.1/bin/valgrind --tool=memcheck --leak-check=full --error-exitcode=42 --quiet --suppressions=/home/jdanek/repos/qpid/qpid-proton/tests/valgrind.supp" "PN_SASL_CONFIG_PATH=/home/jdanek/repos/qpid/qpid-proton/cmake-build-debug/cpp/testdata/sasl-conf" "/nix/store/7kw3730vr14phxld7l0dm7jslkac8fly-valgrind-3.16.1/bin/valgrind" "--tool=memcheck" "--leak-check=full" "--error-exitcode=42" "--quiet" "--suppressions=/home/jdanek/repos/qpid/qpid-proton/tests/valgrind.supp" "/home/jdanek/repos/qpid/qpid-proton/cmake-build-debug/cpp/cpp-test" "[url]" --help Catch v1.12.2 usage: cpp-test [<test name, pattern or tags> ...] [options] where options are: -?, -h, --help display usage information -l, --list-tests list all/matching test cases -t, --list-tags list all/matching tags -s, --success include successful tests in output -b, --break break into debugger on failure -e, --nothrow skip exception tests -i, --invisibles show invisibles (tabs, newlines) -o, --out <filename> output filename -r, --reporter <name> reporter to use (defaults to console) -n, --name <name> suite name -a, --abort abort at first failure -x, --abortx <no. failures> abort after x failures -w, --warn <warning name> enable warnings -d, --durations <yes|no> show test durations -f, --input-file <filename> load test names to run from a file -#, --filenames-as-tags adds a tag for the filename -c, --section <section name> specify section to run --list-test-names-only list all/matching test cases names only --list-extra-info list all/matching test cases with more info --list-reporters list all reporters --order <decl|lex|rand> test case order (defaults to decl) --rng-seed <'time'|number> set a specific seed for random numbers --force-colour force colourised output (deprecated) --use-colour <yes|no> should output be colourised --libidentify report name and version according to libidentify standard --wait-for-keypress <start|exit|both> waits for a keypress before exiting For more detail usage please see the project docs ``` Similarly, if you run `VERBOSE=1 make coverage`, it will print you what commands it is running. To get a clean coverage result, you have to delete the temporary files that contain previously recorded coverage, then run a test (the command from ctest), and then run the command generating the html report (from make coverage). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > [cpp] Improve test coverage in url.cpp > -------------------------------------- > > Key: PROTON-2357 > URL: https://issues.apache.org/jira/browse/PROTON-2357 > Project: Qpid Proton > Issue Type: Test > Components: cpp-binding > Reporter: Justin Ross > Assignee: Justin Ross > Priority: Major > Labels: starter > > *Assignee: Rakhi Kumari* > Url.cpp currently has 76% line coverage after running the tests. Increase > the coverage to 100% or as close as is practical. To do this, add or modify > tests in url_test.cpp. > To set up coverage builds: > # Install lcov, the code coverage tool > # Configure the build for coverage analysis: cmake > -DCMAKE_BUILD_TYPE=Coverage [...] > # Build the code: make build > # Run the tests: make test > # Generate coverage results: make coverage > # View the results at <build>/coverage_results -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org