-
-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Count points based on the number of passed/failed cases? #386
Comments
Hi again, I am trying to use understand how to use reporter but when I used |
do you mean that the code here doesn't compile? I just tested it with GCC and it compiled... Also the example compiles with a bunch of compilers on different OS-es: |
Yep, unfortunately both of them are not working for me. Here is the error message:
I am using CLion on Ubuntu. |
Well this is different from what you previously said ( You need at least 1 |
Sorry I forgot the #define DOCTEST_CONFIG_IMPLEMENT. |
well in that case I need to know which version of GCC (or clang) you are using - CLion is just an IDE afaik... sounds really strange to me... can you give more information? Are you including other headers? perhaps there is some preprocessor macro problem? |
GCC version is 7.5.0. The interesting thing is REGISTER_LISTENER is fine for me, tho. |
well the difference between registering a reporter or a listener is a boolean true/false within the macros... One thing I would suggest is that you run the tests of doctest itself - just call Apart from that I'm clueless - you'll have to debug this locally - there must be something different in your setup. |
I just looked into the code - for each of the reporter/listener macros I use this at the end: Is the typedef error a compilation error from GCC or is it an error from the intellisense of CLion - within the IDE? |
The error is showed in the IDE and I can still compile the code and run it. However, the reporter is not working when I use the reporter filter to define it. |
Well in that case that's a problem with CLion - for not properly handling how are you using the reporter filter? |
By |
shouldn't it be |
Yeah it was, but I changed the name. |
what do you mean by The reporter code in the example/docs is a stub - it doesn't do anything - it's up to you to implement whatever you need. For that you might look into the doctest header itself to figure things out... I guess one option would be to inherit from one of the 2 reporters in doctest and just override a specific method so that you don't have to redefine everything |
I am trying to use the code in https://github.com/onqtam/doctest/issues/344 |
well I just tested that code and for the following asserts: TEST_CASE("tests 1") {
CHECK(1 == 1);
CHECK(1 == 1);
CHECK(1 == 2);
}
TEST_CASE("tests 2") {
CHECK(1 == 1);
} I got the following output:
It printed |
Yep, I know this is how it should output, but I am not able to get the |
Let me try to compile it on macOS. |
It is working now, thank you so much for your help. |
I wouldn't recommend trying to recover after a segmentation fault... the next tests might crash as well because of corruption from the previous one. sounds to me you need something more advanced than a testing framework - perhaps a judge system which has sandboxed execution - protecting from crashes, exploits, measuring the time, etc. - there are many such systems out there which you can setup on a server |
Thank you so much for your suggestion and all the help! I will take a look at it later on. For now, everything is working properly. |
Hi guys, I am now trying to use doctest to grade c++ code assignments, and this is my first time to use doctest. Just one question, is there any way that I can count the points based on how many testcases are passed? Or is there any way that I can perform like IF test case passed, THEN grade ++, something like that?
Thanks a lot!
The text was updated successfully, but these errors were encountered: