diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-05-07 20:46:36 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-05-20 15:44:31 +0200 |
commit | c6448ee39eaf5cba6676239576a745cc5dabc154 (patch) | |
tree | 8f462c22ea823687a0f4ca2ff608c51ad71cc1dc /tools | |
parent | a188bcffc3007178ac3367176ab996eeec9d5b29 (diff) | |
download | systemd-c6448ee39eaf5cba6676239576a745cc5dabc154.tar.gz systemd-c6448ee39eaf5cba6676239576a745cc5dabc154.tar.bz2 systemd-c6448ee39eaf5cba6676239576a745cc5dabc154.zip |
test: run check-directives.sh as part of the test suite
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/check-directives.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/check-directives.sh b/tools/check-directives.sh index 46f770222f..a90fb604ae 100755 --- a/tools/check-directives.sh +++ b/tools/check-directives.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +which perl &>/dev/null || exit 77 + function generate_directives() { perl -aF'/[\s,]+/' -ne ' if (my ($s, $d) = ($F[0] =~ /^([^\s\.]+)\.([^\s\.]+)$/)) { $d{$s}{"$d="} = 1; } @@ -11,22 +13,22 @@ function generate_directives() { ret=0 if ! diff \ - <(generate_directives src/network/networkd-network-gperf.gperf | sort) \ - <(cat test/fuzz/fuzz-network-parser/directives.network | sort); then + <(generate_directives "$1"/src/network/networkd-network-gperf.gperf | sort) \ + <(cat "$1"/test/fuzz/fuzz-network-parser/directives.network | sort); then echo "Looks like test/fuzz/fuzz-network-parser/directives.network hasn't been updated" ret=1 fi if ! diff \ - <(generate_directives src/network/netdev/netdev-gperf.gperf | sort) \ - <(cat test/fuzz/fuzz-netdev-parser/directives.netdev | sort); then + <(generate_directives "$1"/src/network/netdev/netdev-gperf.gperf | sort) \ + <(cat "$1"/test/fuzz/fuzz-netdev-parser/directives.netdev | sort); then echo "Looks like test/fuzz/fuzz-netdev-parser/directives.netdev hasn't been updated" ret=1 fi if ! diff \ - <(generate_directives src/udev/net/link-config-gperf.gperf | sort) \ - <(cat test/fuzz/fuzz-link-parser/directives.link | sort) ; then + <(generate_directives "$1"/src/udev/net/link-config-gperf.gperf | sort) \ + <(cat "$1"/test/fuzz/fuzz-link-parser/directives.link | sort) ; then echo "Looks like test/fuzz/fuzz-link-parser/directives.link hasn't been updated" ret=1 fi |