diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2020-03-04 16:10:06 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2020-03-04 16:10:06 +1100 |
commit | c5995ddf4c20345886120048bf0cd8e8d7cc597f (patch) | |
tree | 4c0ed587f87bb0a35ab3770b8824925574840e9d | |
parent | e4ce227e89d7334c44e0018ae837e0a2a824a812 (diff) | |
download | device-tree-compiler-c5995ddf4c20345886120048bf0cd8e8d7cc597f.tar.gz |
tests: Honour NO_YAML make variable
Support for YAML output in dtc is optional (to cover systems that don't
have libyaml). Currently the tests for yaml output test if the libyaml
package is locally installed.
That duplicates similar logic in the Makefile, and worse it will cause
failed tests if the user explicitly disables YAML support, rather than
simply not having libyaml installed.
Fix this by having the test script use the NO_YAML variable exported by
make. Fall back to the current test if the variable isn't set, such as
when running the script manually.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rwxr-xr-x | tests/run_tests.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 7abcb03..b0a1fc3 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -25,6 +25,20 @@ else fi fi +if [ -n "$NO_YAML" ]; then + if [ "$NO_YAML" != "0" ]; then + no_yaml=true + else + no_yaml=false + fi +else + if pkg-config --exists yaml-0.1; then + no_yaml=false + else + no_yaml=true + fi +fi + # stat differs between platforms if [ -z "$STATSZ" ]; then stat --version 2>/dev/null | grep -q 'GNU' @@ -615,7 +629,7 @@ dtc_tests () { done # Check -Oyaml output - if pkg-config --exists yaml-0.1; then + if ! $no_yaml; then for tree in type-preservation; do run_dtc_test -I dts -O yaml -o $tree.test.dt.yaml "$SRCDIR/$tree.dts" run_wrap_test cmp "$SRCDIR/$tree.dt.yaml" $tree.test.dt.yaml |