aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcolincross <ccross@android.com>2019-11-13 11:51:25 -0800
committerGitHub <noreply@github.com>2019-11-13 11:51:25 -0800
commit577b7f24db7cc3a76213fb5c42e512c17ad326b3 (patch)
tree472bf876b9d65e3a0c299b995d0bae25c5084016
parent89f56d726ab4d019b827079aeada95d80525301f (diff)
parentea375ee8751ecbe0c9ce7f456d4f09e43732e677 (diff)
downloadplatform_build_kati-577b7f24db7cc3a76213fb5c42e512c17ad326b3.tar.gz
platform_build_kati-577b7f24db7cc3a76213fb5c42e512c17ad326b3.tar.bz2
platform_build_kati-577b7f24db7cc3a76213fb5c42e512c17ad326b3.zip
Merge pull request #173 from colincross/default_pool
Default pool
-rw-r--r--ninja.cc2
-rw-r--r--testcase/ninja_pool.sh45
2 files changed, 45 insertions, 2 deletions
diff --git a/ninja.cc b/ninja.cc
index 53810f0..c11bc56 100644
--- a/ninja.cc
+++ b/ninja.cc
@@ -580,7 +580,7 @@ class NinjaGenerator {
if (pool != "none") {
*o << " pool = " << pool << "\n";
}
- } else if (g_flags.default_pool) {
+ } else if (g_flags.default_pool && rule_name != "phony") {
*o << " pool = " << g_flags.default_pool << "\n";
} else if (use_local_pool) {
*o << " pool = local_pool\n";
diff --git a/testcase/ninja_pool.sh b/testcase/ninja_pool.sh
index 4d3d15c..2ae3240 100644
--- a/testcase/ninja_pool.sh
+++ b/testcase/ninja_pool.sh
@@ -21,7 +21,7 @@ mk="$@"
cat <<EOF > Makefile
-test: test_pool test_none test_default test_blank
+test: test_pool test_none test_default test_blank test_gomacc
test_pool: .KATI_NINJA_POOL := test_pool
test_pool:
@@ -38,8 +38,13 @@ test_blank: .KATI_NINJA_POOL :=
test_blank:
echo "PASS"
+test_gomacc:
+ echo ~/goma/gomacc > /dev/null
+ echo "PASS"
EOF
+
+# Test with no arguments
${mk} 2>${log}
if [ -e ninja.sh ]; then
mv build.ninja kati.ninja
@@ -65,8 +70,12 @@ if [ -e ninja.sh ]; then
if grep -A1 "build test_blank:" kati.ninja | grep -q "pool ="; then
echo "unexpected pool present for test_blank rule in build.ninja"
fi
+ if grep -A1 "build test_blank:" kati.ninja | grep -q "pool ="; then
+ echo "unexpected pool present for test_gomacc rule in build.ninja"
+ fi
fi
+# Test with --default_pool set
args=
if ! echo "${mk}" | grep -qv "kati"; then
args=--default_pool=default_pool
@@ -97,4 +106,38 @@ if [ -e ninja.sh ]; then
if ! grep -A1 "build test_blank:" kati.ninja | grep -q "pool = default_pool"; then
echo "default_pool not present for test_blank rule in build.ninja"
fi
+ if ! grep -A1 "build test_gomacc:" kati.ninja | grep -q "pool = default_pool"; then
+ echo "default_pool not present for test_gomacc rule in build.ninja"
+ fi
+fi
+
+# Test with USE_GOMA=true set
+${mk} USE_GOMA=true 2>${log}
+if [ -e ninja.sh ]; then
+ mv build.ninja kati.ninja
+ cat <<EOF > build.ninja
+pool test_pool
+ depth = 1
+pool default_pool
+ depth = 1
+include kati.ninja
+EOF
+ ./ninja.sh
+fi
+if [ -e ninja.sh ]; then
+ if ! grep -A1 "build test_pool:" kati.ninja | grep -q "pool = test_pool"; then
+ echo "test_pool not present for test_pool rule in build.ninja"
+ fi
+ if grep -A1 "build test_none:" kati.ninja | grep -q "pool = "; then
+ echo "unexpected pool present for test_none rule in build.ninja"
+ fi
+ if ! grep -A1 "build test_default:" kati.ninja | grep -q "pool = local_pool"; then
+ echo "local_pool not present for test_default rule in build.ninja"
+ fi
+ if ! grep -A1 "build test_blank:" kati.ninja | grep -q "pool = local_pool"; then
+ echo "local_pool not present for test_blank rule in build.ninja"
+ fi
+ if grep -A1 "build test_gomacc:" kati.ninja | grep -q "pool = "; then
+ echo "unexpected pool present for test_gomacc rule in build.ninja"
+ fi
fi