• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3
4###############################################################################
5#
6#   Copyright © International Business Machines  Corp., 2009
7#
8# DESCRIPTION
9#      Run tests in the current directory.
10#
11# AUTHOR
12#      Darren Hart <dvhart@linux.intel.com>
13#
14# HISTORY
15#      2009-Nov-9: Initial version by Darren Hart <dvhart@linux.intel.com>
16#      2010-Jan-6: Add futex_wait_uninitialized_heap and futex_wait_private_mapped_file
17#                  by KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
18#
19###############################################################################
20
21run_test()
22{
23	$@
24	if [ $? -ne 0 ]; then
25		rc=1
26	fi
27}
28
29# Test for a color capable console
30if [ -z "$USE_COLOR" ]; then
31    tput setf 7 || tput setaf 7
32    if [ $? -eq 0 ]; then
33        USE_COLOR=1
34        tput sgr0
35    fi
36fi
37if [ "$USE_COLOR" -eq 1 ]; then
38    COLOR="-c"
39fi
40
41rc=0
42
43echo
44# requeue pi testing
45# without timeouts
46run_test ./futex_requeue_pi $COLOR
47run_test ./futex_requeue_pi $COLOR -b
48run_test ./futex_requeue_pi $COLOR -b -l
49run_test ./futex_requeue_pi $COLOR -b -o
50run_test ./futex_requeue_pi $COLOR -l
51run_test ./futex_requeue_pi $COLOR -o
52# with timeouts
53run_test ./futex_requeue_pi $COLOR -b -l -t 5000
54run_test ./futex_requeue_pi $COLOR -l -t 5000
55run_test ./futex_requeue_pi $COLOR -b -l -t 500000
56run_test ./futex_requeue_pi $COLOR -l -t 500000
57run_test ./futex_requeue_pi $COLOR -b -t 5000
58run_test ./futex_requeue_pi $COLOR -t 5000
59run_test ./futex_requeue_pi $COLOR -b -t 500000
60run_test ./futex_requeue_pi $COLOR -t 500000
61run_test ./futex_requeue_pi $COLOR -b -o -t 5000
62run_test ./futex_requeue_pi $COLOR -l -t 5000
63run_test ./futex_requeue_pi $COLOR -b -o -t 500000
64run_test ./futex_requeue_pi $COLOR -l -t 500000
65# with long timeout
66run_test ./futex_requeue_pi $COLOR -b -l -t 2000000000
67run_test ./futex_requeue_pi $COLOR -l -t 2000000000
68
69
70echo
71run_test ./futex_requeue_pi_mismatched_ops $COLOR
72
73echo
74run_test ./futex_requeue_pi_signal_restart $COLOR
75
76echo
77run_test ./futex_wait_timeout $COLOR
78
79echo
80run_test ./futex_wait_wouldblock $COLOR
81
82echo
83run_test ./futex_wait_uninitialized_heap $COLOR
84run_test ./futex_wait_private_mapped_file $COLOR
85
86exit $rc
87