test: add a script to check for leftover litest rules

An aborted test run can sometimes leave udev rules as detritus. Test for that
so we don't get test case failures triggered by those rules.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2018-03-23 10:29:28 +10:00
parent 48d6861e74
commit 75aee30919
3 changed files with 26 additions and 0 deletions

View file

@ -564,6 +564,9 @@ if get_option('tests')
config_h.set_quoted('ADDR2LINE', addr2line.path())
endif
leftover_rules = find_program('test/check-leftover-udev-rules.sh')
test('leftover-rules', leftover_rules, is_parallel : false)
dep_libunwind = dependency('libunwind', required : false)
config_h.set10('HAVE_LIBUNWIND', dep_libunwind.found())

View file

@ -0,0 +1,11 @@
#!/bin/bash
ls /run/udev/rules.d/*litest*.rules 2>/dev/null
if [[ $? -eq 0 ]]; then
exit 1
fi
ls /etc/udev/hwdb.d/*litest*REMOVEME*.hwdb 2>/dev/null
if [[ $? -eq 0 ]]; then
exit 1
fi

View file

@ -52,3 +52,15 @@
fun:ioctl
fun:libevdev_grab
}
{
bash:execute_command
Memcheck:Cond
...
fun:execute_command
}
{
bash:execute_command
Memcheck:Leak
...
fun:execute_command
}