generated from bazel-contrib/rules-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.cpp
41 lines (34 loc) · 924 Bytes
/
test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <lib.h>
#include <gtest/gtest.h>
namespace my {
namespace project {
namespace {
#ifdef __cplusplus
extern "C" {
#endif
void library_init();
void library_deinit();
int add5(int);
#ifdef __cplusplus
}
#endif
class SharedLibTest : public testing::Test {
protected:
void SetUp() override {
library_init();
}
void TearDown() override {
library_deinit();
}
};
// Tests that Foo does Xyz.
TEST_F(SharedLibTest, CallsImportedFunction) {
EXPECT_EQ(add5(5), 10);
}
} // namespace
} // namespace project
} // namespace my
int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}