aboutsummaryrefslogtreecommitdiffstats
path: root/testcase/ninja_validations.sh
diff options
context:
space:
mode:
authorPatrice Arruda <48073103+patricearruda@users.noreply.github.com>2020-06-25 14:12:17 -0400
committerGitHub <noreply@github.com>2020-06-25 14:12:17 -0400
commit003cf51e9b6da48063c90cf4c6710fde103c9c4a (patch)
tree01f4e8ee74775e749b2126109db4e27130daf40e /testcase/ninja_validations.sh
parent7a68538a09e1e0c56f936ccf20632314e74c10c0 (diff)
parentc81028400c8efb27df6a989abd2235b909cfb7c3 (diff)
downloadplatform_build_kati-003cf51e9b6da48063c90cf4c6710fde103c9c4a.tar.gz
platform_build_kati-003cf51e9b6da48063c90cf4c6710fde103c9c4a.tar.bz2
platform_build_kati-003cf51e9b6da48063c90cf4c6710fde103c9c4a.zip
Merge pull request #198 from colincross/ninja_validations
Support validations in ninja
Diffstat (limited to 'testcase/ninja_validations.sh')
-rw-r--r--testcase/ninja_validations.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/testcase/ninja_validations.sh b/testcase/ninja_validations.sh
new file mode 100644
index 0000000..cd77a01
--- /dev/null
+++ b/testcase/ninja_validations.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+# TODO(ninja): enable once upstream ninja supports validations
+#
+# Copyright 2015 Google Inc. All rights reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http:#www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e
+
+mk="$@"
+
+cat <<EOF >Makefile
+all: a c
+
+a:
+ echo a
+
+b:
+ echo b
+
+a: .KATI_VALIDATIONS := b
+
+c:
+ echo c
+
+d: c
+ echo d
+
+c: .KATI_VALIDATIONS := d
+EOF
+
+all="a b c d"
+if echo "${mk}" | grep kati > /dev/null; then
+ mk="${mk} --use_ninja_validations"
+ all="a c"
+fi
+${mk} -j1 $all
+if [ -e ninja.sh ]; then
+ ./ninja.sh -j1 -w dupbuild=err $all
+fi
+