Comments (3)
Is this feature available?
No, it is not. Actually even the idea that someone might need this never came to my mind.
If not, do you like the idea?
Right now, I am more at the "no" side. But feel free to argue with me.
My point is that functioning program is expected to provide correct output within some domain of expected input. Yes, it may possibly crash, when it is fed with an input outside of the domain. But why should I care whether it does really crash or not?
Another disadvantage could be that running such a crashing test under debugger or valgrind or any other runtime checker will then typically lead to its interference and I am not sure that in general good test suites should have this property.
So, when exactly would be such feature useful?
I could try to write a patch for it if so.
If you can show me it would be good feature to have, feel free to try. But it may not be as simple as you think. Consider that:
- Test subprocesses work very differently on Windows then on a posix systems with
fork()
. - Running the tests as a subprocess is optional (although by default on, if supported, and not running under a debugger);
- On other systems (not Windows, not Posix-compliant), running a test in a subprocesses is not supported at all.
from acutest.
One more problem I can see with it:
If you have a test which is passing. Then you expect it provides some quite good guarantees at least as provided by all the checks it performs.
But with a crash, how would you distinguish "expected crash" and "unexpected crash" (i.e. when the test crashes elsewhere or differently)?
from acutest.
Thanks for the reply!
Actually you do have some good points. I wrote the issue thinking about how I wanted to test my code without first thinking if it was a good idea.
Yes, it may possibly crash, when it is fed with an input outside of the domain. But why should I care whether it does really crash or not?
The original intend of the test was to assure that incompatible flags introduced by commandline would exit the program and not execute incorrect tasks but probably I can implement this in a better way.
running such a crashing test under debugger or valgrind or any other runtime checker will then typically lead to its interference.
I agree with this and it would be difficult & tedious to debug.
how would you distinguish "expected crash" and "unexpected crash".
I can't think of a way that makes it 100% accurate but providing a expected error code to the test may be good enough. So If we are expecting an error and the exit code is the one provided in the test, it's an expected crash
.
Anyway I think your points are good enough to discard this as a posible feature, since it's not the best way to test a functionality and it would be hard to get it to work the way we expect.
Feel free to close this issue if you want or provide any other thoughs if any. :)
from acutest.
Related Issues (20)
- reserved identifier violation HOT 2
- Completion of error handling HOT 2
- #define ⇒ enum?
- Windows outputs "Debug Error - Abort() was called" on every failed test HOT 2
- Q: constructor/destructor functions? HOT 4
- TEST_STRING_EQUAL method HOT 2
- Compile works but program does not finish and takes 100% CPU ?! HOT 3
- Memory leak in children HOT 2
- Call cleanup handler after assert fail HOT 4
- travisci C std 17 HOT 1
- How can I compile multiple units to one executable? HOT 1
- Any way to test for a non-zero exit(status) condition? HOT 3
- flush stdout and stderr before aborting
- Allow TEST_CHECK for non-int conditions
- Can acutest add support like doctest's DOCTEST_CONFIG_DISABLE?
- Provide TEST_SKIP(message) macro
- Warning `warning: variable length array folded to constant array as an extension` on Clang 10 HOT 2
- Is this repo abandoned? HOT 2
- Any way to figure out code coverage or lines not covered? HOT 1
- Can exception handling be disabled for use in testing embedded C++ systems? HOT 1
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 acutest.