fix linux build (case sensitive folder Test -> test etc)
This commit is contained in:
38
test/hello_gtest/main.cpp
Normal file
38
test/hello_gtest/main.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
/////////////////////////////
|
||||
// In the header file
|
||||
|
||||
|
||||
#include <sstream>
|
||||
using namespace std;
|
||||
|
||||
class Salutation
|
||||
{
|
||||
public:
|
||||
static string greet(const string& name);
|
||||
};
|
||||
|
||||
///////////////////////////////////////
|
||||
// In the class implementation file
|
||||
|
||||
string Salutation::greet(const string& name) {
|
||||
ostringstream s;
|
||||
s << "Hello " << name << "!";
|
||||
return s.str();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////
|
||||
// In the test file
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(SalutationTest, Static) {
|
||||
EXPECT_EQ(string("Hello World!"), Salutation::greet("World"));
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#if _MSC_VER
|
||||
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
|
||||
//void *testWhetherMemoryLeakDetectionWorks = malloc(1);
|
||||
#endif
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
31
test/hello_gtest/premake4.lua
Normal file
31
test/hello_gtest/premake4.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
project "hello_gtest"
|
||||
|
||||
kind "ConsoleApp"
|
||||
|
||||
-- defines { }
|
||||
|
||||
targetdir "../../bin"
|
||||
|
||||
includedirs
|
||||
{
|
||||
".","../gtest-1.7.0/include"
|
||||
}
|
||||
|
||||
-- linkLib "gtest"
|
||||
links "gtest"
|
||||
|
||||
|
||||
files {
|
||||
"**.cpp",
|
||||
"**.h",
|
||||
-- "../gtest-1.7.0/src/gtest_main.cc"
|
||||
}
|
||||
if os.is("Windows") then
|
||||
end
|
||||
|
||||
if os.is("Linux") then
|
||||
end
|
||||
|
||||
if os.is("MacOSX") then
|
||||
end
|
||||
Reference in New Issue
Block a user