Edit

kc3-lang/angle/tests/compiler_tests/compiler_test_main.cpp

Branch :

  • Show log

    Commit

  • Author : Geoff Lang
    Date : 2013-10-23 13:11:32
    Hash : b6046502
    Message : Moved the compiler test initialization and tear down into a gtest environement class. Change-Id: I1fd05a188830567b04b9341793e64488da027894 Reviewed-on: https://chromium-review.googlesource.com/179353 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Commit-Queue: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>

  • tests/compiler_tests/compiler_test_main.cpp
  • //
    // Copyright (c) 2013 The ANGLE Project 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"
    
    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)
    {
        testing::InitGoogleMock(&argc, argv);
        testing::AddGlobalTestEnvironment(new CompilerTestEnvironment());
        int rt = RUN_ALL_TESTS();
        return rt;
    }