]>
Commit | Line | Data |
---|---|---|
f00832cc DK |
1 | #include <gtest/gtest.h> |
2 | #include <apt-pkg/error.h> | |
3 | int main(int argc, char **argv) { | |
4 | ::testing::InitGoogleTest(&argc, argv); | |
5 | int result = RUN_ALL_TESTS(); | |
6 | if (_error->empty() == false) | |
7 | { | |
8 | std::cerr << "The test generated the following global messages:" << std::endl; | |
9 | _error->DumpErrors(std::cerr); | |
10 | // messages on the stack can't be right, error out | |
11 | // even if we have no idea where this message came from | |
12 | if (result == 0) | |
13 | { | |
14 | std::cerr << "All tests successful, but messages were generated, so still a failure!" << std::endl; | |
15 | return 29; | |
16 | } | |
17 | } | |
18 | return result; | |
19 | } |