Comments (4)
Things we found when experimenting with this today:
- CppUTest executes test from the end of the file, in reverse order
- As soon as an exception is thrown in any source file, execution in that file halts
I wonder if this long discussion on a merged CppUTest PR provides any hints on how to work around this: cpputest/cpputest#1550
from approvaltests.cpp.
I wonder if this long discussion on a merged CppUTest PR provides any hints on how to work around this: cpputest/cpputest#1550
Yes, it did. Adding either of these two command-line arguments when running the tests makes both test failures be shown:
-e - do not rethrow unexpected exceptions on failure
-ci - continuous integration mode (equivalent to -e)
Confirmed with this change:
git diff
diff --git a/Makefile b/Makefile
index 86536c0..fd89508 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ clean :
git clean -fx
test: ExampleTestAndApprovalTest
- ./ExampleTestAndApprovalTest
+ ./ExampleTestAndApprovalTest -e
exampleonly: OnlyExampleTest
./OnlyExampleTest
The console output is then:
gitpod /workspace/approvals-cpp-exception (main) $ make test
./ExampleTestAndApprovalTest -e
./ExampleTestAndApprovalTest.cc:31: error: Failure in TEST(TestGroup, ApprovalTestsTest)
Unexpected exception of type 'ApprovalTests::ApprovalMismatchException' was thrown: Failed Approval:
Received does not match approved
Received : "./ExampleTestAndApprovalTest.TestGroup.ApprovalTestsTest.received.txt"
Approved : "./ExampleTestAndApprovalTest.TestGroup.ApprovalTestsTest.approved.txt"
.
./ExampleTestAndApprovalTest.cc:28: error: Failure in TEST(TestGroup, ExampleBasedTest)
expected <a>
but was <b>
difference starts at position 0 at: < b >
^
.
Errors (2 failures, 2 tests, 2 ran, 1 checks, 0 ignored, 0 filtered out, 3 ms)
make: *** [Makefile:24: test] Error 2
gitpod /workspace/approvals-cpp-exception (main) $
from approvaltests.cpp.
We should probably add this to the documentation on the Approval Tests/CppUTest integration.
from approvaltests.cpp.
super!
thanks so much for taking the time!
from approvaltests.cpp.
Related Issues (20)
- Provide a script to allow users to generate the single header from the current code, without doing a release HOT 9
- Add a documentation example showing how to obtain ApprovalTests.cpp via CPM.cmake HOT 1
- Add vcpkg to our release process HOT 2
- Document how to use Approval Tests with vcpkg HOT 1
- Bullet lists not rendered correcting on Read the Docs version of our documentation HOT 3
- Add a copyright statement to the released single header HOT 1
- GitHub Actions: Don't run scheduled tasks on forked repos
- Using kdiff3 as diff tool, user has to specify name of output file after merge
- cygwin CI build hangs for 6 hours then fails HOT 5
- warning C4459 in MSVC with /W4 HOT 1
- Does not compile with clang13 due to -Werror/-Wdeprecated-copy-with-dtor HOT 2
- Ninja + Catch2 + mingw64
- useApprovalsSubdirectory() doesn't create the output directory in the expected location HOT 3
- "Unable to create directory" - unable to run test build with mingw provided by qt-installer HOT 5
- add `code -d {Received} {Approved}` to Reporters list
- Catch2 integration does not handle Generators inside sections HOT 1
- Catch2 v3 integration HOT 5
- Bug with {fmt} integration HOT 2
- CLion reporter does not open correctly if CLion is already open
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 approvaltests.cpp.