Skip to content

Instantly share code, notes, and snippets.

@raimusyndrome
Created December 20, 2013 08:40
Show Gist options
  • Save raimusyndrome/8052017 to your computer and use it in GitHub Desktop.
Save raimusyndrome/8052017 to your computer and use it in GitHub Desktop.
GoogleTestを使用する場合のmain関数のテンプレート
#include <gtest/gtest.h>
class CustomEnvironment :
public ::testing::Environment
{
public:
virtual ~CustomEnvironment() {}
// 環境の初期化方法を定義するには,これをオーバーライドしてください.
virtual void SetUp() {
}
// 環境の終了処理を定義するには,これをオーバーライドしてください.
virtual void TearDown() {
}
};
int main(int argc, char* argv[]){
testing::InitGoogleTest(&argc, argv);
//::testing::AddGlobalTestEnvironment(new CustomEnvironment());
return RUN_ALL_TESTS();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment