From: Dmitry V. Levin Date: Fri, 21 Apr 2017 01:29:29 +0000 (+0000) Subject: tests: tabulate clock.test X-Git-Tag: v4.17~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3793ca561409cfa0b345d7efe2c9ac6646a195b9;p=strace tests: tabulate clock.test Rewrite clock.test using test_trace_expr(). * tests/gen_tests.in (clock): New entry. * tests/clock.in: New file, derived from a set of tests in clock.test. * tests/clock.test: Remove. * tests/Makefile.am (DECODER_TESTS): Remove clock.test. (EXTRA_DIST): Add clock.in. --- diff --git a/tests/Makefile.am b/tests/Makefile.am index ea078d84..78889d13 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -176,7 +176,6 @@ DECODER_TESTS = \ btrfs-w.test \ caps-abbrev.test \ caps.test \ - clock.test \ eventfd.test \ execve-v.test \ execve.test \ @@ -291,6 +290,7 @@ VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp EXTRA_DIST = \ caps-abbrev.awk \ caps.awk \ + clock.in \ count-f.expected \ eventfd.expected \ fadvise.h \ diff --git a/tests/clock.in b/tests/clock.in new file mode 100755 index 00000000..864de290 --- /dev/null +++ b/tests/clock.in @@ -0,0 +1,3 @@ +clock_adjtime -a37 +clock_nanosleep +clock_xettime -a36 diff --git a/tests/clock.test b/tests/clock.test deleted file mode 100755 index 5ed96c28..00000000 --- a/tests/clock.test +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# Check -e trace=/clock option. -# -# Copyright (c) 2017 The strace developers. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -. "${srcdir=.}/init.sh" - -while read w s; do { - try_run_prog "../$s" || continue - run_strace -a$w -e/clock ../$s > "$EXP" - match_diff "$LOG" "$EXP" -} < /dev/null; done << EOF -37 clock_adjtime -40 clock_nanosleep -36 clock_xettime -EOF - -# Surprised that fcntl* tests linked with musl use clock_gettime? Me too! -grep -E -v '^(#|clock_|times$|fcntl)' \ - < "$srcdir/pure_executables.list" > negative.list - -while read s; do { - try_run_prog "../$s" || continue - run_strace -qq -esignal=none -e/clock ../$s > /dev/null - match_diff "$LOG" /dev/null -} < /dev/null; done < negative.list diff --git a/tests/gen_tests.in b/tests/gen_tests.in index 692178db..e715c086 100644 --- a/tests/gen_tests.in +++ b/tests/gen_tests.in @@ -40,6 +40,7 @@ chmod -a28 chown -a28 chown32 -a31 chroot -a24 +clock test_trace_expr 'times|fcntl.*' -e/clock clock_adjtime -a37 clock_nanosleep -e trace=clock_nanosleep,clock_gettime clock_xettime -a36 -e trace=clock_getres,clock_gettime,clock_settime