OLD | NEW |
| (Empty) |
1 // Copyright 2014 the V8 project 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 | |
5 #include <cstdlib> | |
6 #include <cstring> | |
7 #include <memory> | |
8 | |
9 #include "include/libplatform/libplatform.h" | |
10 #include "test/unittests/unittests.h" | |
11 #include "testing/gmock/include/gmock/gmock.h" | |
12 | |
13 using ::testing::IsNull; | |
14 using ::testing::NotNull; | |
15 | |
16 namespace v8 { | |
17 namespace internal { | |
18 | |
19 // static | |
20 v8::Platform* EngineTest::platform_ = NULL; | |
21 | |
22 | |
23 // static | |
24 void EngineTest::SetUpTestCase() { | |
25 EXPECT_THAT(platform_, IsNull()); | |
26 platform_ = v8::platform::CreateDefaultPlatform(); | |
27 EXPECT_THAT(platform_, NotNull()); | |
28 v8::V8::InitializePlatform(platform_); | |
29 EXPECT_TRUE(v8::V8::Initialize()); | |
30 } | |
31 | |
32 | |
33 // static | |
34 void EngineTest::TearDownTestCase() { | |
35 EXPECT_THAT(platform_, NotNull()); | |
36 v8::V8::Dispose(); | |
37 v8::V8::ShutdownPlatform(); | |
38 delete platform_; | |
39 platform_ = NULL; | |
40 } | |
41 | |
42 } // namespace internal | |
43 } // namespace v8 | |
44 | |
45 | |
46 int main(int argc, char** argv) { | |
47 testing::InitGoogleMock(&argc, argv); | |
48 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); | |
49 return RUN_ALL_TESTS(); | |
50 } | |
OLD | NEW |