Commit b6046502 by Geoff Lang

Moved the compiler test initialization and tear down into a gtest environement class.

Change-Id: I1fd05a188830567b04b9341793e64488da027894 Reviewed-on: https://chromium-review.googlesource.com/179353Reviewed-by: 's avatarNicolas Capens <nicolascapens@chromium.org> Commit-Queue: Nicolas Capens <nicolascapens@chromium.org> Tested-by: 's avatarNicolas Capens <nicolascapens@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent bb134678
...@@ -8,11 +8,30 @@ ...@@ -8,11 +8,30 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "GLSLANG/ShaderLang.h" #include "GLSLANG/ShaderLang.h"
class CompilerTestEnvironment : public testing::Environment
{
public:
virtual void SetUp()
{
if (!ShInitialize())
{
FAIL() << "Failed to initialize the compiler.";
}
}
virtual void TearDown()
{
if (!ShFinalize())
{
FAIL() << "Failed to finalize the compiler.";
}
}
};
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
testing::InitGoogleMock(&argc, argv); testing::InitGoogleMock(&argc, argv);
ShInitialize(); testing::AddGlobalTestEnvironment(new CompilerTestEnvironment());
int rt = RUN_ALL_TESTS(); int rt = RUN_ALL_TESTS();
ShFinalize();
return rt; return rt;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment