diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-05-21 08:35:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-21 08:35:10 +0900 |
commit | d7c5b3ec3e5ea446c252c07d30c32170d4d1176a (patch) | |
tree | c3d23943553af2566dd107f9821780e77a677c33 /tools | |
parent | 3041250a9f7426b925498bdd9616e2172bd62a0a (diff) | |
parent | f7ebc1e29878d079f7ac1178b458229de051293b (diff) | |
download | systemd-d7c5b3ec3e5ea446c252c07d30c32170d4d1176a.tar.gz systemd-d7c5b3ec3e5ea446c252c07d30c32170d4d1176a.tar.bz2 systemd-d7c5b3ec3e5ea446c252c07d30c32170d4d1176a.zip |
Merge pull request #12510 from keszybz/test-directives
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 |