Commit e643f226 authored by Mostyn Bramley-Moore's avatar Mostyn Bramley-Moore Committed by Commit Bot

add jumbo support when building gn itself

Change-Id: Ia9af79c05b910e2fa345825d225ff6cfc3a1ec78
Reviewed-on: https://chromium-review.googlesource.com/791590Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@vewd.com>
Cr-Commit-Position: refs/heads/master@{#519597}
parent 8e4e785c
......@@ -2,12 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/jumbo.gni")
import("//testing/test.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
defines = [ "GN_BUILD" ]
static_library("gn_lib") {
jumbo_static_library("gn_lib") {
configs += [ "//build/config:precompiled_headers" ]
sources = [
......@@ -276,6 +277,18 @@ executable("gn") {
}
test("gn_unittests") {
deps = [
":gn_unittests_sources",
]
data = [
"format_test_data/",
]
}
jumbo_source_set("gn_unittests_sources") {
testonly = true
sources = [
"action_target_generator_unittest.cc",
"analyzer_unittest.cc",
......@@ -342,11 +355,7 @@ test("gn_unittests") {
"xml_element_writer_unittest.cc",
]
data = [
"format_test_data/",
]
deps = [
public_deps = [
":gn_lib",
"//base/test:run_all_unittests",
"//base/test:test_support",
......
......@@ -10,7 +10,7 @@
#include "tools/gn/settings.h"
#include "tools/gn/source_file.h"
namespace {
namespace gn_analyzer_unittest {
class MockLoader : public Loader {
public:
......@@ -111,8 +111,6 @@ class AnalyzerTest : public testing::Test {
std::string tc_name_;
};
} // namespace
TEST_F(AnalyzerTest, AllWasPruned) {
RunBasicTest(
R"({
......@@ -231,3 +229,5 @@ TEST_F(AnalyzerTest, BuildFilesWereModifiedAndCompilingAll) {
R"("test_targets":["//:a"])"
"}");
}
} // namespace gn_analyzer_unittest
......@@ -10,7 +10,7 @@
#include "tools/gn/test_with_scope.h"
#include "tools/gn/toolchain.h"
namespace {
namespace gn_builder_unittest {
class MockLoader : public Loader {
public:
......@@ -89,8 +89,6 @@ class BuilderTest : public testing::Test {
Scope scope_;
};
} // namespace
TEST_F(BuilderTest, BasicDeps) {
SourceDir toolchain_dir = settings_.toolchain_label().dir();
std::string toolchain_name = settings_.toolchain_label().name();
......@@ -246,3 +244,5 @@ TEST_F(BuilderTest, ConfigLoad) {
// Should have requested that B is loaded.
EXPECT_TRUE(loader_->HasLoadedOne(SourceFile("//b/BUILD.gn")));
}
} // namespace gn_builder_unittest
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment