add testing infrastructure

This commit is contained in:
2026-05-06 23:05:14 -05:00
parent dc7ebdbb73
commit 35cc73b04f
6 changed files with 104 additions and 3 deletions

36
test/TestApp.cpp Normal file
View File

@@ -0,0 +1,36 @@
#include <gmock/gmock.h>
#include <memory>
#define private public
#include <App.hpp>
#undef private
class TestApp : public testing::Test {
protected:
void createUut() {
uut_ = std::make_unique<App>();
}
std::unique_ptr<App> uut_;
};
TEST_F(TestApp, TestApp_run_nominal) {
createUut();
uut_->run();
// no expect here
}
TEST_F(TestApp, TestApp_foo_nominal) {
createUut();
EXPECT_EQ(uut_->foo(), 12);
}