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