Home | History | Annotate | Download | only in functional
      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 (at] linux.intel.com>
     17 #
     18 # HISTORY
     19 #      2009-Nov-9: Initial version by Darren Hart <dvhart (at] linux.intel.com>
     20 #      2010-Jan-6: Add futex_wait_uninitialized_heap and futex_wait_private_mapped_file
     21 #                  by KOSAKI Motohiro <kosaki.motohiro (at] jp.fujitsu.com>
     22 #
     23 ###############################################################################
     24 
     25 run_test()
     26 {
     27 	$@
     28 	if [ $? -ne 0 ]; then
     29 		rc=1
     30 	fi
     31 }
     32 
     33 # Test for a color capable console
     34 if [ -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
     40 fi
     41 if [ "$USE_COLOR" -eq 1 ]; then
     42     COLOR="-c"
     43 fi
     44 
     45 rc=0
     46 
     47 echo
     48 # requeue pi testing
     49 # without timeouts
     50 run_test ./futex_requeue_pi $COLOR
     51 run_test ./futex_requeue_pi $COLOR -b
     52 run_test ./futex_requeue_pi $COLOR -b -l
     53 run_test ./futex_requeue_pi $COLOR -b -o
     54 run_test ./futex_requeue_pi $COLOR -l
     55 run_test ./futex_requeue_pi $COLOR -o
     56 # with timeouts
     57 run_test ./futex_requeue_pi $COLOR -b -l -t 5000
     58 run_test ./futex_requeue_pi $COLOR -l -t 5000
     59 run_test ./futex_requeue_pi $COLOR -b -l -t 500000
     60 run_test ./futex_requeue_pi $COLOR -l -t 500000
     61 run_test ./futex_requeue_pi $COLOR -b -t 5000
     62 run_test ./futex_requeue_pi $COLOR -t 5000
     63 run_test ./futex_requeue_pi $COLOR -b -t 500000
     64 run_test ./futex_requeue_pi $COLOR -t 500000
     65 run_test ./futex_requeue_pi $COLOR -b -o -t 5000
     66 run_test ./futex_requeue_pi $COLOR -l -t 5000
     67 run_test ./futex_requeue_pi $COLOR -b -o -t 500000
     68 run_test ./futex_requeue_pi $COLOR -l -t 500000
     69 # with long timeout
     70 run_test ./futex_requeue_pi $COLOR -b -l -t 2000000000
     71 run_test ./futex_requeue_pi $COLOR -l -t 2000000000
     72 
     73 
     74 echo
     75 run_test ./futex_requeue_pi_mismatched_ops $COLOR
     76 
     77 echo
     78 run_test ./futex_requeue_pi_signal_restart $COLOR
     79 
     80 echo
     81 run_test ./futex_wait_timeout $COLOR
     82 
     83 echo
     84 run_test ./futex_wait_wouldblock $COLOR
     85 
     86 echo
     87 run_test ./futex_wait_uninitialized_heap $COLOR
     88 run_test ./futex_wait_private_mapped_file $COLOR
     89 
     90 exit $rc
     91