diff options
| author | Colin Cross <ccross@android.com> | 2019-11-12 08:27:24 -0800 |
|---|---|---|
| committer | Colin Cross <ccross@android.com> | 2019-11-12 13:56:15 -0800 |
| commit | 4182efc18a6ddbeca64fa997d53c2df0f5122498 (patch) | |
| tree | 17e9596d428666702e996a91d992cb752655bf44 | |
| parent | 89f56d726ab4d019b827079aeada95d80525301f (diff) | |
| download | platform_build_kati-4182efc18a6ddbeca64fa997d53c2df0f5122498.tar.gz platform_build_kati-4182efc18a6ddbeca64fa997d53c2df0f5122498.tar.bz2 platform_build_kati-4182efc18a6ddbeca64fa997d53c2df0f5122498.zip | |
Add test for auto-detected goma pools
Make sure the autodetected pools based on the presence of /gomacc
still work.
Test: ./runtest.rb -c -n ninja_pool.sh
Change-Id: I24d2a82479307b8d648d4bce73bd6ecbc31e885e
| -rw-r--r-- | testcase/ninja_pool.sh | 45 |
1 files changed, 44 insertions, 1 deletions
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 |
