]>
git.saurik.com Git - apt.git/blob - test/libapt/gtest_runner.cc
1 #include <gtest/gtest.h>
3 #include <apt-pkg/configuration.h>
4 #include <apt-pkg/pkgsystem.h>
5 #include <apt-pkg/error.h>
6 #include <apt-pkg/init.h>
8 int main(int argc
, char **argv
) {
9 ::testing::InitGoogleTest(&argc
, argv
);
10 if (pkgInitSystem(*_config
, _system
) == false)
12 int const result
= RUN_ALL_TESTS();
13 if (_error
->empty() == false)
15 std::cerr
<< "The test generated the following global messages:" << std::endl
;
16 _error
->DumpErrors(std::cerr
);
17 // messages on the stack can't be right, error out
18 // even if we have no idea where this message came from
21 std::cerr
<< "All tests successful, but messages were generated, so still a failure!" << std::endl
;