Hash :
b6046502
Author :
Date :
2013-10-23T13:11:32
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>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
//
// 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;
}