diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2010-09-21 12:45:52 +0200 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2010-09-21 12:45:52 +0200 |
commit | b2ad12eb0291832134bf3757f98abfeeec2fb166 (patch) | |
tree | 9b088e654df08400c537fedbb22f417ea3a77b0a /test/rules-test.sh | |
parent | c112a41a43ccede3b22bf242bcf8da455ca57c98 (diff) |
Add automatic rules syntax check
Add test/rule-syntax-check.py, a script for checking the syntax of all udev
rules files passed as command line arguments.
Add a wrapper test/rules-test.sh which calls rule-syntax-check.py on all udev
rules that we ship, but does nothing if Python is not available. Integrate this
into make check/distcheck.
Diffstat (limited to 'test/rules-test.sh')
-rwxr-xr-x | test/rules-test.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/rules-test.sh b/test/rules-test.sh new file mode 100755 index 0000000000..9d5a07c19e --- /dev/null +++ b/test/rules-test.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# Call the udev rule syntax checker on all rules that we ship +# +# (C) 2010 Canonical Ltd. +# Author: Martin Pitt <martin.pitt@ubuntu.com> + +set -e + +[ -n "$srcdir" ] || srcdir=`dirname $0`/.. + +# skip if we don't have python +type python >/dev/null 2>&1 || { + echo "$0: No python installed, skipping udev rule syntax check" + exit 0 +} + +$srcdir/test/rule-syntax-check.py `find $srcdir/rules -type f` |