mirror of
https://github.com/denoland/deno.git
synced 2025-01-03 04:48:52 -05:00
Move C++ test main function to its own file.
This commit is contained in:
parent
936c8f6e4c
commit
2c30a25568
4 changed files with 15 additions and 10 deletions
|
@ -42,10 +42,10 @@ install:
|
|||
- gn args $BUILD_PATH --list
|
||||
- ccache -s
|
||||
# Travis hangs without -j2 argument to ninja.
|
||||
- ninja -j2 -C $BUILD_PATH mock_runtime_test handlers_test deno_cc deno_cc_nosnapshot deno deno_nosnapshot
|
||||
- ninja -j2 -C $BUILD_PATH test_cc handlers_test deno_cc deno_cc_nosnapshot deno deno_nosnapshot
|
||||
script:
|
||||
- ./tools/lint.py
|
||||
- $BUILD_PATH/mock_runtime_test
|
||||
- $BUILD_PATH/test_cc
|
||||
- $BUILD_PATH/handlers_test
|
||||
- $BUILD_PATH/deno_cc foo bar
|
||||
- $BUILD_PATH/deno_cc_nosnapshot foo bar
|
||||
|
|
3
BUILD.gn
3
BUILD.gn
|
@ -72,13 +72,14 @@ executable("deno_cc_nosnapshot") {
|
|||
configs += [ ":deno_config" ]
|
||||
}
|
||||
|
||||
executable("mock_runtime_test") {
|
||||
executable("test_cc") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"src/file_util_test.cc",
|
||||
"src/flatbuffer_builder_test.cc",
|
||||
"src/from_snapshot.cc",
|
||||
"src/mock_runtime_test.cc",
|
||||
"src/test.cc",
|
||||
]
|
||||
deps = [
|
||||
":create_snapshot_mock_runtime",
|
||||
|
|
|
@ -174,10 +174,3 @@ TEST(MockRuntimeTest, ErrorHandling) {
|
|||
EXPECT_EQ(count, 1);
|
||||
deno_delete(d);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
deno_init();
|
||||
deno_set_flags(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
|
11
src/test.cc
Normal file
11
src/test.cc
Normal file
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2018 Ryan Dahl <ry@tinyclouds.org>
|
||||
// All rights reserved. MIT License.
|
||||
#include "deno.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
deno_init();
|
||||
deno_set_flags(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
Loading…
Reference in a new issue