components/stdcxx/Solaris/run_regress_tests.sh
changeset 402 94ae4d75524c
equal deleted inserted replaced
401:bf52ef48020c 402:94ae4d75524c
       
     1 #!/bin/bash
       
     2 #
       
     3 # CDDL HEADER START
       
     4 #
       
     5 # The contents of this file are subject to the terms of the
       
     6 # Common Development and Distribution License (the "License").
       
     7 # You may not use this file except in compliance with the License.
       
     8 #
       
     9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
    10 # or http://www.opensolaris.org/os/licensing.
       
    11 # See the License for the specific language governing permissions
       
    12 # and limitations under the License.
       
    13 #
       
    14 # When distributing Covered Code, include this CDDL HEADER in each
       
    15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    16 # If applicable, add the following below this CDDL HEADER, with the
       
    17 # fields enclosed by brackets "[]" replaced with your own identifying
       
    18 # information: Portions Copyright [yyyy] [name of copyright owner]
       
    19 #
       
    20 # CDDL HEADER END
       
    21 #
       
    22 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
       
    23 #
       
    24 #
       
    25 
       
    26 unset LD_LIBRARY_PATH
       
    27 unset LD_LIBRARY_PATH_32
       
    28 unset LD_LIBRARY_PATH_64
       
    29 unset LD_PRELOAD
       
    30 unset LD_PRELOAD_32
       
    31 unset LD_PRELOAD_64
       
    32 
       
    33 export TOPDIR="../../"
       
    34 export DO_CLEANUP="no"
       
    35 export DO_RUN="no"
       
    36 export LD_LIBRARY_PATH="../lib"
       
    37 export LD_LIBRARY_PATH_32="../lib"
       
    38 export LD_LIBRARY_PATH_64="../lib"
       
    39 
       
    40 UNKNOWN_ARG=no
       
    41 PRINT_HELP=no
       
    42 
       
    43 check_args() {
       
    44 	while [ "$#" -gt 0 ] ; do
       
    45 		UNKNOWN_ARG=no
       
    46 		case "$1" in
       
    47 			--cleanup)
       
    48 			DO_CLEANUP=yes
       
    49 		;;
       
    50 		--run)
       
    51 		DO_RUN=yes
       
    52 		;;
       
    53 		*)
       
    54 		UNKNOWN_ARG=yes
       
    55 		;;
       
    56 		esac
       
    57 
       
    58 		if [ "${UNKNOWN_ARG}" = "yes" ] ; then
       
    59 			echo "$1: Invalid argument"
       
    60 			PRINT_HELP=yes
       
    61 			shift
       
    62 			continue
       
    63 		fi
       
    64 
       
    65 		shift
       
    66 	done
       
    67 
       
    68 	export DO_CLEANUP DO_RUN TOPDIR
       
    69 
       
    70 	if [ "$PRINT_HELP" = "yes" ] || [ "$UNKNOWN_ARG" = "yes" ] ; then
       
    71 		echo "Usage: `basename $0` [ --cleanup ] [ --run ]"
       
    72 		exit 1
       
    73 	fi
       
    74 }
       
    75 
       
    76 run_tests() {
       
    77 	if [ "${DO_RUN}" = "no" ] ; then
       
    78 		return
       
    79 	fi
       
    80 
       
    81 	for file in \
       
    82 		"18.limits.stdcxx-436" \
       
    83 		"18.limits.traps.stdcxx-624" \
       
    84 		"20.specialized.stdcxx-390" \
       
    85 		"21.string.append.stdcxx-438" \
       
    86 		"21.string.io.stdcxx-206" \
       
    87 		"21.string.io.stdcxx-250" \
       
    88 		"21.string.replace.stdcxx-175" \
       
    89 		"21.string.stdcxx-162" \
       
    90 		"21.string.stdcxx-231" \
       
    91 		"21.string.stdcxx-466" \
       
    92 		"22.locale.codecvt.stdcxx-435" \
       
    93 		"22.locale.cons.stdcxx-485" \
       
    94 		"22.locale.messages.stdcxx-542" \
       
    95 		"22.locale.money.get.stdcxx-62" \
       
    96 		"22.locale.num.put.stdcxx-2" \
       
    97 		"22.locale.stdcxx-554" \
       
    98 		"23.associative.stdcxx-16" \
       
    99 		"23.bitset.cons.stdcxx-297" \
       
   100 		"23.deque.special.stdcxx-127" \
       
   101 		"23.list.cons.stdcxx-268" \
       
   102 		"23.list.insert.stdcxx-331" \
       
   103 		"23.list.special.stdcxx-334" \
       
   104 		"23.set.stdcxx-216" \
       
   105 		"23.vector.bool.stdcxx-235" \
       
   106 		"23.vector.stdcxx-611" \
       
   107 		"24.istream.iterator.cons.stdcxx-645" \
       
   108 		"24.istream.iterator.ops.stdcxx-321" \
       
   109 		"24.operations.stdcxx-234" \
       
   110 		"26.valarray.binary.stdcxx-237" \
       
   111 		"26.valarray.members.stdcxx-313" \
       
   112 		"26.valarray.members.stdcxx-318" \
       
   113 		"26.valarray.sub.stdcxx-224" \
       
   114 		"26.valarray.sub.stdcxx-309" \
       
   115 		"26.valarray.sub.stdcxx-448" \
       
   116 		"26.valarray.transcend.stdcxx-315" \
       
   117 		"26.valarray.unary.stdcxx-314" \
       
   118 		"27.basic.ios.copyfmt.stdcxx-766" \
       
   119 		"27.basic.ios.tie.stdcxx-804" \
       
   120 		"27.cstdio.stdcxx-195" \
       
   121 		"27.filebuf.members.stdcxx-308" \
       
   122 		"27.filebuf.virtuals.stdcxx-522" \
       
   123 		"27.ostream.unformatted.stdcxx-626" \
       
   124 		"27.streambuf.imbue.stdcxx-307" \
       
   125 		"27.stringbuf.members.stdcxx-427" \
       
   126 		"27.stringbuf.overflow.stdcxx-795" \
       
   127 		"27.stringbuf.str.stdcxx-514" \
       
   128 		"27.stringbuf.xsputn.stdcxx-515" \
       
   129 		"27.stringbuf.xsputn.stdcxx-576"
       
   130 	do
       
   131         echo "------------------------------------------------------------"
       
   132         if [ -f ${file} ] ; then
       
   133 		    echo -n "Running regression test ${file} ... "
       
   134 		    ./${file} > ${file}.out 2>&1
       
   135             ret=$?
       
   136             if [ ${ret} -eq 0 ] ; then
       
   137                 echo "SUCCESS."
       
   138             else
       
   139                 echo "FAIL."
       
   140             fi
       
   141 			pat=`cat ${file}.out | egrep 'ASSERTION|ERROR|FATAL'`
       
   142 			if [ "x${pat}" != "x" ] ; then
       
   143 		        echo "############################################################"
       
   144 		        tail -9 ${file}.out | egrep 'ASSERTION|ERROR|FATAL' | egrep '%'
       
   145 		        echo "############################################################"
       
   146             fi
       
   147        else
       
   148             echo "Test program ${file} not found. Skipping."
       
   149 	   fi
       
   150        echo "------------------------------------------------------------"
       
   151 	done
       
   152 }
       
   153 
       
   154 do_cleanup() {
       
   155 	if [ "${DO_CLEANUP}" = "no" ] ; then
       
   156 		return
       
   157 	fi
       
   158 
       
   159 	for file in \
       
   160 		"18.limits.stdcxx-436" \
       
   161 		"18.limits.traps.stdcxx-624" \
       
   162 		"20.specialized.stdcxx-390" \
       
   163 		"21.string.append.stdcxx-438" \
       
   164 		"21.string.io.stdcxx-206" \
       
   165 		"21.string.io.stdcxx-250" \
       
   166 		"21.string.replace.stdcxx-175" \
       
   167 		"21.string.stdcxx-162" \
       
   168 		"21.string.stdcxx-231" \
       
   169 		"21.string.stdcxx-466" \
       
   170 		"22.locale.codecvt.stdcxx-435" \
       
   171 		"22.locale.cons.stdcxx-485" \
       
   172 		"22.locale.messages.stdcxx-542" \
       
   173 		"22.locale.money.get.stdcxx-62" \
       
   174 		"22.locale.num.put.stdcxx-2" \
       
   175 		"22.locale.stdcxx-554" \
       
   176 		"23.associative.stdcxx-16" \
       
   177 		"23.bitset.cons.stdcxx-297" \
       
   178 		"23.deque.special.stdcxx-127" \
       
   179 		"23.list.cons.stdcxx-268" \
       
   180 		"23.list.insert.stdcxx-331" \
       
   181 		"23.list.special.stdcxx-334" \
       
   182 		"23.set.stdcxx-216" \
       
   183 		"23.vector.bool.stdcxx-235" \
       
   184 		"23.vector.stdcxx-611" \
       
   185 		"24.istream.iterator.cons.stdcxx-645" \
       
   186 		"24.istream.iterator.ops.stdcxx-321" \
       
   187 		"24.operations.stdcxx-234" \
       
   188 		"26.valarray.binary.stdcxx-237" \
       
   189 		"26.valarray.members.stdcxx-313" \
       
   190 		"26.valarray.members.stdcxx-318" \
       
   191 		"26.valarray.sub.stdcxx-224" \
       
   192 		"26.valarray.sub.stdcxx-309" \
       
   193 		"26.valarray.sub.stdcxx-448" \
       
   194 		"26.valarray.transcend.stdcxx-315" \
       
   195 		"26.valarray.unary.stdcxx-314" \
       
   196 		"27.basic.ios.copyfmt.stdcxx-766" \
       
   197 		"27.basic.ios.tie.stdcxx-804" \
       
   198 		"27.cstdio.stdcxx-195" \
       
   199 		"27.filebuf.members.stdcxx-308" \
       
   200 		"27.filebuf.virtuals.stdcxx-522" \
       
   201 		"27.ostream.unformatted.stdcxx-626" \
       
   202 		"27.streambuf.imbue.stdcxx-307" \
       
   203 		"27.stringbuf.members.stdcxx-427" \
       
   204 		"27.stringbuf.overflow.stdcxx-795" \
       
   205 		"27.stringbuf.str.stdcxx-514" \
       
   206 		"27.stringbuf.xsputn.stdcxx-515" \
       
   207 		"27.stringbuf.xsputn.stdcxx-576"
       
   208 	do
       
   209 		rm -f "${file}.out"
       
   210 	done
       
   211 
       
   212 	if [ -f core ] ; then
       
   213 		rm -f core
       
   214 	fi
       
   215 }
       
   216 
       
   217 check_args $@
       
   218 run_tests
       
   219 do_cleanup
       
   220 
       
   221 exit 0
       
   222