summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-02-22 12:15:17 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-02-22 13:21:32 -0500
commit587751eb663c8c52133d9a90a6bc8b7b84bdfcc6 (patch)
treed2238b0dbc14175d33c12d5204aa2de23a98e50e /test
parenta4ae7f1d739cc011b5312a8bfba99971bce0e7c3 (diff)
udev-test.pl: add --strace option
It's useful when trying to see what the tests are doing. I hardcoded '-efile' as the option to strace, but in the future it might be useful to make this configurable.
Diffstat (limited to 'test')
-rwxr-xr-xtest/udev-test.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/udev-test.pl b/test/udev-test.pl
index 638c3e8f4e..b047493f6b 100755
--- a/test/udev-test.pl
+++ b/test/udev-test.pl
@@ -23,8 +23,10 @@ use strict;
my $udev_bin = "./test-udev";
my $valgrind = 0;
my $gdb = 0;
+my $strace = 0;
my $udev_bin_valgrind = "valgrind --tool=memcheck --leak-check=yes --track-origins=yes --quiet $udev_bin";
my $udev_bin_gdb = "gdb --args $udev_bin";
+my $udev_bin_strace = "strace -efile $udev_bin";
my $udev_dev = "test/dev";
my $udev_run = "test/run";
my $udev_rules_dir = "$udev_run/udev/rules.d";
@@ -1330,6 +1332,8 @@ sub udev {
system("$udev_bin_valgrind $action $devpath");
} elsif ($gdb > 0) {
system("$udev_bin_gdb $action $devpath");
+ } elsif ($strace > 0) {
+ system("$udev_bin_strace $action $devpath");
} else {
system("$udev_bin", "$action", "$devpath");
}
@@ -1509,6 +1513,9 @@ foreach my $arg (@ARGV) {
} elsif ($arg =~ m/--gdb/) {
$gdb = 1;
printf("using gdb\n");
+ } elsif ($arg =~ m/--strace/) {
+ $strace = 1;
+ printf("using strace\n");
} else {
push(@list, $arg);
}