const char* kStringValue = "coconuts";
class ElfTest : public ::testing::Test {
- public:
- // Path to the test binary itself; set by main()
- static std::string binaryPath;
-
- ElfTest() : elfFile_(binaryPath.c_str()) {}
- ~ElfTest() override {}
-
protected:
- ElfFile elfFile_;
+ ElfFile elfFile_{"/proc/self/exe"};
};
-std::string ElfTest::binaryPath;
-
TEST_F(ElfTest, IntegerValue) {
auto sym = elfFile_.getSymbolByName("kIntegerValue");
EXPECT_NE(nullptr, sym.first) << "Failed to look up symbol kIntegerValue";
EXPECT_NE(nullptr, phdr);
EXPECT_GE(phdr->p_filesz, 0);
}
-
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
- gflags::ParseCommandLineFlags(&argc, &argv, true);
- ElfTest::binaryPath = argv[0];
- return RUN_ALL_TESTS();
-}
raise(SIGUSR1);
EXPECT_TRUE(handled);
}
-
-int main(int argc, char* argv[]) {
- testing::InitGoogleTest(&argc, argv);
- gflags::ParseCommandLineFlags(&argc, &argv, true);
- google::InitGoogleLogging(argv[0]);
- return RUN_ALL_TESTS();
-}