Commit 16a3eb3e by Zhenyao Mo

Fix compiler test initialization issues.

We should call ShInitialize() / ShFinalize() once per process, so moving them out of individual test's Setup() / Shutdown() to the test main(). BUG= R=alokp@chromium.org Review URL: https://codereview.appspot.com/13568048
parent 23175c55
#define MAJOR_VERSION 1
#define MINOR_VERSION 2
#define BUILD_VERSION 0
#define BUILD_REVISION 2447
#define BUILD_REVISION 2448
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -72,7 +72,7 @@
'../third_party/googlemock/include',
],
'sources': [
'../third_party/googlemock/src/gmock_main.cc',
'compiler_tests/compiler_test_main.cpp',
],
},
],
......
......@@ -22,17 +22,9 @@ protected:
virtual void SetUp()
{
memset(&resources, 0, sizeof(resources));
ASSERT_TRUE(ShInitialize() != 0) << "Could not ShInitialize";
GenerateResources(&resources);
}
virtual void TearDown()
{
ASSERT_TRUE(ShFinalize() != 0);
}
// Set up the per compile resources
void GenerateResources(ShBuiltInResources* resources)
{
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "GLSLANG/ShaderLang.h"
int main(int argc, char** argv) {
testing::InitGoogleMock(&argc, argv);
ShInitialize();
int rt = RUN_ALL_TESTS();
ShFinalize();
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