blob: 798c9cf4723d9bb7ac3bf86974775e9b6dfbef4d [file] [log] [blame]
Dan Sinclair5553d8b2018-01-03 09:44:28 -05001// Copyright 2018 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Tom Sepezeaf9d212020-07-22 16:24:00 +00005#include "build/build_config.h"
Dan Sinclair5553d8b2018-01-03 09:44:28 -05006#include "core/fxcrt/fx_memory.h"
7#include "testing/gmock/include/gmock/gmock.h"
8#include "testing/gtest/include/gtest/gtest.h"
Dan Sinclair5553d8b2018-01-03 09:44:28 -05009
Tom Sepezeaf9d212020-07-22 16:24:00 +000010#ifdef PDF_ENABLE_V8
11#include "testing/v8_test_environment.h"
12#endif // PDF_ENABLE_V8
13
Tom Sepezaf33f512020-06-12 01:00:10 +000014// Can't use gtest-provided main since we need to create our own
15// testing environment which needs the executable path in order to
16// find the external V8 binary data files.
Dan Sinclair5553d8b2018-01-03 09:44:28 -050017int main(int argc, char** argv) {
Dan Sinclair5553d8b2018-01-03 09:44:28 -050018 FXMEM_InitializePartitionAlloc();
19
Tom Sepezeaf9d212020-07-22 16:24:00 +000020#ifdef PDF_ENABLE_V8
Dan Sinclair5553d8b2018-01-03 09:44:28 -050021 // The env will be deleted by gtest.
Tom Sepezeaf9d212020-07-22 16:24:00 +000022 AddGlobalTestEnvironment(new V8TestEnvironment(argv[0]));
23#endif // PDF_ENABLE_V8
Dan Sinclair5553d8b2018-01-03 09:44:28 -050024
25 testing::InitGoogleTest(&argc, argv);
26 testing::InitGoogleMock(&argc, argv);
27
Tom Sepezaf33f512020-06-12 01:00:10 +000028 return RUN_ALL_TESTS();
Dan Sinclair5553d8b2018-01-03 09:44:28 -050029}