tests: Use global SetUp/TearDown for compiler setup
The GLSL compiler requires some one-time per process setup and
teardown to operate properly. Using gtest global environment to
manage those functions.
diff --git a/tests/xgltestframework.cpp b/tests/xgltestframework.cpp
index 917f031..8015cb0 100644
--- a/tests/xgltestframework.cpp
+++ b/tests/xgltestframework.cpp
@@ -73,19 +73,30 @@
#endif
+// Set up environment for GLSL compiler
+// Must be done once per process
+void TestEnvironment::SetUp()
+{
+ // Initialize GLSL to BIL compiler utility
+ glslang::InitializeProcess();
+}
+
+void TestEnvironment::TearDown()
+{
+ glslang::FinalizeProcess();
+}
+
XglTestFramework::XglTestFramework() :
m_glut_initialized( false ),
m_compile_options( 0 ),
m_num_shader_strings( 0 )
{
- // Initialize GLSL to BIL compiler utility
-// ShInitialize();
- glslang::InitializeProcess();
+
}
XglTestFramework::~XglTestFramework()
{
- glslang::FinalizeProcess();
+
}
// Define all the static elements