summaryrefslogtreecommitdiffstats
path: root/tools/gn/config_values_extractors_unittest.cc
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2014-09-16 18:07:14 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-17 01:07:38 +0000
commitc2e821a33bf4ffdf9d325bb0876bd9924284e228 (patch)
tree73e9eab69d291f86c93189582dd7c7530a512ddd /tools/gn/config_values_extractors_unittest.cc
parent7ac26543e7a224a231e5ab3ed8a83ad5b94472a3 (diff)
downloadchromium_src-c2e821a33bf4ffdf9d325bb0876bd9924284e228.zip
chromium_src-c2e821a33bf4ffdf9d325bb0876bd9924284e228.tar.gz
chromium_src-c2e821a33bf4ffdf9d325bb0876bd9924284e228.tar.bz2
Add public deps to GN.
Renamed datadeps to data_deps for consistency. Renamed direct_dependent_configs to public_configs for consistency with the public deps. This is also easier to understand and hopefully will encourage people to do this instead of use all_dependent_configs. Now that there are so many types of deps, added a DepsIterator that allows easy iterating over all of them (or only the linked ones). This simplified some code. This simplified the header checker significantly since it had complicated logic to find direct_dependent_configs and prefer paths with those forwarded. Removed a bunch of weird group special-casing. Groups no longer have their deps copied into the target, but are dependents like everything else. For now, unless you explicitly specify public_deps, all group deps will default to public. I'd like to change this in a future pass. Added a bool return value to the target generator functions that fill values. Since I originally did that, I've started both returning a bool and setting an Err, which makes checking for the error and early-returning easier to remember. I did this because I found yet another case of forgetting to check err, which gives very strange results. Review URL: https://codereview.chromium.org/561273003 Cr-Commit-Position: refs/heads/master@{#295203}
Diffstat (limited to 'tools/gn/config_values_extractors_unittest.cc')
-rw-r--r--tools/gn/config_values_extractors_unittest.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/gn/config_values_extractors_unittest.cc b/tools/gn/config_values_extractors_unittest.cc
index b0c65ca..fa0d070 100644
--- a/tools/gn/config_values_extractors_unittest.cc
+++ b/tools/gn/config_values_extractors_unittest.cc
@@ -46,9 +46,10 @@ TEST(ConfigValuesExtractors, IncludeOrdering) {
Target dep2(setup.settings(), Label(SourceDir("//dep2/"), "dep2"));
dep2.set_output_type(Target::SOURCE_SET);
+ dep2.visibility().SetPublic();
dep2.SetToolchain(setup.toolchain());
dep2.all_dependent_configs().push_back(LabelConfigPair(&dep2_all));
- dep2.direct_dependent_configs().push_back(LabelConfigPair(&dep2_direct));
+ dep2.public_configs().push_back(LabelConfigPair(&dep2_direct));
// Set up dep1, direct and all dependent configs.
Config dep1_all(setup.settings(), Label(SourceDir("//dep1/"), "all"));
@@ -62,10 +63,11 @@ TEST(ConfigValuesExtractors, IncludeOrdering) {
Target dep1(setup.settings(), Label(SourceDir("//dep1/"), "dep1"));
dep1.set_output_type(Target::SOURCE_SET);
+ dep1.visibility().SetPublic();
dep1.SetToolchain(setup.toolchain());
dep1.all_dependent_configs().push_back(LabelConfigPair(&dep1_all));
- dep1.direct_dependent_configs().push_back(LabelConfigPair(&dep1_direct));
- dep1.deps().push_back(LabelTargetPair(&dep2));
+ dep1.public_configs().push_back(LabelConfigPair(&dep1_direct));
+ dep1.private_deps().push_back(LabelTargetPair(&dep2));
// Set up target, direct and all dependent configs.
Config target_all(setup.settings(), Label(SourceDir("//target/"), "all"));
@@ -90,9 +92,9 @@ TEST(ConfigValuesExtractors, IncludeOrdering) {
target.set_output_type(Target::SOURCE_SET);
target.SetToolchain(setup.toolchain());
target.all_dependent_configs().push_back(LabelConfigPair(&target_all));
- target.direct_dependent_configs().push_back(LabelConfigPair(&target_direct));
+ target.public_configs().push_back(LabelConfigPair(&target_direct));
target.configs().push_back(LabelConfigPair(&target_config));
- target.deps().push_back(LabelTargetPair(&dep1));
+ target.private_deps().push_back(LabelTargetPair(&dep1));
// Additionally add some values directly on "target".