]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add debug tests
authorOndrej Oprala <ooprala@redhat.com>
Wed, 13 Aug 2014 12:36:45 +0000 (14:36 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 13 Aug 2014 12:36:45 +0000 (14:36 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
tests/expected/libmount/debug-set-from-code [new file with mode: 0644]
tests/expected/libmount/debug-set-from-env-int [new file with mode: 0644]
tests/expected/libmount/debug-set-from-env-str [new file with mode: 0644]
tests/ts/libmount/debug [new file with mode: 0755]

diff --git a/tests/expected/libmount/debug-set-from-code b/tests/expected/libmount/debug-set-from-code
new file mode 100644 (file)
index 0000000..8cd28c2
--- /dev/null
@@ -0,0 +1 @@
+0x0016
diff --git a/tests/expected/libmount/debug-set-from-env-int b/tests/expected/libmount/debug-set-from-env-int
new file mode 100644 (file)
index 0000000..8cd28c2
--- /dev/null
@@ -0,0 +1 @@
+0x0016
diff --git a/tests/expected/libmount/debug-set-from-env-str b/tests/expected/libmount/debug-set-from-env-str
new file mode 100644 (file)
index 0000000..8cd28c2
--- /dev/null
@@ -0,0 +1 @@
+0x0016
diff --git a/tests/ts/libmount/debug b/tests/ts/libmount/debug
new file mode 100755 (executable)
index 0000000..da9ecc3
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# Copyright (C) 2014 Ondrej Oprala <ooprala@redhat.com
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="debugging"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+TESTPROG="$TS_HELPER_LIBMOUNT_DEBUG"
+
+[ -x $TESTPROG ] || ts_skip "test not compiled"
+
+# CACHE | LOCKS
+ts_init_subtest "set-from-code"
+ts_valgrind $TESTPROG 20 2>&1 | grep -o '0x.*' &> $TS_OUTPUT
+ts_finalize_subtest
+
+# CACHE | LOCKS
+ts_init_subtest "set-from-env-str"
+LIBMOUNT_DEBUG=cache,locks ts_valgrind $TESTPROG 2>&1 $TS_OUTPUT | grep -o '0x.*' &> $TS_OUTPUT
+ts_finalize_subtest
+
+# CACHE | LOCKS
+ts_init_subtest "set-from-env-int"
+LIBMOUNT_DEBUG=20 ts_valgrind $TESTPROG 2>&1 $TS_OUTPUT | grep -o '0x.*' &> $TS_OUTPUT
+ts_finalize_subtest
+
+ts_finalize