Comments (6)
Hi @falloutphil,
You mean that the tests don't fail, but you would like to see more output from the test run? Currently we only show output if an error happens, otherwise we don't show any output at all (as normal pytest runs usually do).
What you want is possible to support however, we would need to introduce a new --cpp-verbose
flag or something like that, which also outputs the stdout from calling the executable under test. Then you would be able to pass -s
and let the output show in the terminal during the run.
I probably won't tackle this anytime soon, but would love to review and merge a PR to that effect. 👍
from pytest-cpp.
Thanks @nicoddemus
Yes - I think it would be useful to see check-level output as well as test-case level output.
So in each (for example) BOOST_AUTO_TEST_CASE I have has a series of BOOST_TEST_WARN, BOOST_TEST, and BOOST_TEST_REQUIRE conditions within them. Each of these is actually testing the result of a single outcome and is referred to as a "check" by Boost. At test case is a collection of one or more checks.
At the moment, in pytest, we only see the output of a check, if a check fails. We don't get a list of successful checks within a test case. This is exactly the same if we run the cpp executable with no arguments.
I'd like to see a list of checks performed that passed as well as those that failed - exactly like if I pass "-l all" into the cpp executable.
No promises, but if I can find the time I'll look at doing a PR!
from pytest-cpp.
We can probably get away with just printing the full output from each test, and using -P
to print the captured output for even passing tests.
No promises, but if I can find the time I'll look at doing a PR!
OK, sounds good, thanks!
from pytest-cpp.
@nicoddemus @falloutphil what about adding he stdout of the tests in a log.info? something like this for gtest:
try:
log.info(
subprocess.check_output(
args, stderr=subprocess.STDOUT, universal_newlines=True
)
)
except subprocess.CalledProcessError as e:
log.info(e.output)
so you can toggle whether you get the logs or not using the --log-cli-level=INFO
from pytest-cpp.
so we got a side discussion on a PR implementing my comment above, I'd like to summarize that here so we can design a solution that suites us all :)
@nicoddemus :
I'm not sure I'm a fan of hijacking logging.info like that: pytest-cpp is often used to run other kinds of tests (like normal python tests) alongside C++ tests.How about the original idea, of just printing the output of the underlying executable to stdout? That's how other plugins do this, notably pytester.
FWIW I don't actively use this plugin, but I'd probably vote for a separate report section, similar to what e.g. pytest-qt does.
is mentioning Item.add_report_section. This will be displayed automatically by pytest if a test fails.
We could add the full test output like this: item.add_report_section("call", "c++", output).
me
but that wouldnt solve #41 as the output would be shown only in case of error
I'll explore add_report_section
idea as I am not understanding it completely :)
from pytest-cpp.
it was a great idea :)
from pytest-cpp.
Related Issues (20)
- Add support for Catch2 v3 HOT 12
- Catch2: escape special characters in test names HOT 1
- Google: Support expected failures HOT 11
- Type-Parametrized Gtests failure HOT 4
- marking cpp test targets. HOT 5
- Collect error when using xdist and temporary .pyc file is deleted
- Ignore python test files maybe? HOT 10
- Skipping invalid test suites HOT 3
- C++ tests not collected due to '*_test' mask on Windows HOT 4
- Add a way to use valgrind, catchsegv or similar tool HOT 2
- Add support for Catch testing framework HOT 4
- No skipped message is included in result.xml file
- Key Error after upgrade to 2.1.0 HOT 4
- Getting some warnings with pytest 7.0 HOT 2
- Incompatibility between pytest 6.x and pytest-cpp==2.1.2 HOT 2
- Error when using gtest arguments HOT 5
- Add type-checking with mypy
- Issues if a test exits before xml is created HOT 1
- Add support of prefix-ish parameter to run executable HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-cpp.