1// 2// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved. 3// Use of this source code is governed by a BSD-style license that can be 4// found in the LICENSE file. 5// 6 7#include "gtest/gtest.h" 8#include "GLSLANG/ShaderLang.h" 9 10class CompilerTestEnvironment : public testing::Environment 11{ 12 public: 13 virtual void SetUp() 14 { 15 if (!ShInitialize()) 16 { 17 FAIL() << "Failed to initialize the compiler."; 18 } 19 } 20 21 virtual void TearDown() 22 { 23 if (!ShFinalize()) 24 { 25 FAIL() << "Failed to finalize the compiler."; 26 } 27 } 28}; 29 30int main(int argc, char** argv) 31{ 32 testing::InitGoogleTest(&argc, argv); 33 testing::AddGlobalTestEnvironment(new CompilerTestEnvironment()); 34 int rt = RUN_ALL_TESTS(); 35 return rt; 36} 37