Changeset 2520


Ignore:
Timestamp:
Jul 11, 2011, 5:55:27 PM (10 years ago)
Author:
Peter
Message:

use new functions (r2519) in tests and simplify code

Location:
trunk/test
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/common_defs.sh.in

    r2519 r2520  
    4040run ()
    4141{
    42     test $# -ge 2 || exit 1
     42    test $# -ge 2 || exit_fatal
    4343    foo_prog=$1
    4444    shift
     
    4949    cat stderr >&2
    5050    cat stdout
    51     test $exitcode = $expected_exitcode || exit 1
     51    test $exitcode = $expected_exitcode || Exit 1
    5252}
    5353
  • trunk/test/help_test.sh

    r2458 r2520  
    2424set -e
    2525
    26 . ./common_defs.sh || exit 1
     26. ./common_defs.sh || exit 99
    2727
    2828run ../../help.test 0 --nonsense --help
    29 test -s stderr && exit 1
    30 grep 'Usage:' stdout || exit 1
     29test -s stderr && exit_fail
     30grep 'Usage:' stdout || exit_fail
    3131
    3232run ../../help.test 0 -nonsense --help
    33 test -s stderr && exit 1
    34 grep 'Usage:' stdout || exit 1
     33test -s stderr && exit_fail
     34grep 'Usage:' stdout || exit_fail
    3535
    3636run ../../help.test 0 nonsense --help
    37 test -s stderr && exit 1
    38 grep 'Usage:' stdout || exit 1
     37test -s stderr && exit_fail
     38grep 'Usage:' stdout || exit_fail
    3939
    4040run ../../help.test 1 --help-me
    41 test -s stderr || exit 1
    42 grep 'help.test:.*help-me' stderr || exit 1
     41test -s stderr || exit_fail
     42grep 'help.test:.*help-me' stderr || exit_fail
    4343
    44 exit 0
     44exit_success
  • trunk/test/static_test.sh

    r2244 r2520  
    2626set -e
    2727
    28 . ./common_defs.sh || exit 1
     28. ./common_defs.sh || exit 99
    2929
    3030cat >> configure.ac <<EOF
     
    4646
    4747make
    48 ./hello || exit 1
    49 
    50 echo "Test is OK"
     48./hello || exit_fail
  • trunk/test/yat_config_cblas_test.sh

    r2384 r2520  
    2626set -e
    2727
    28 . ./common_defs.sh || exit 1
     28. ./common_defs.sh || exit 99
    2929
    3030export YAT_CBLAS_LIB=BOGUSBOGUS
    3131ret_str=`$abs_top_builddir/build_support/yat-config --libs`
    32 echo $ret_str | grep BOGUSBOGUS || exit 1
    33 exit 0
     32echo $ret_str | grep BOGUSBOGUS || exit_fail
     33exit_success
  • trunk/test/yat_config_test.sh

    r2473 r2520  
    2626set -e
    2727
    28 . ./common_defs.sh || exit 1
     28. ./common_defs.sh || exit 99
    2929
    3030prog=${abs_top_builddir}/build_support/for_installation/yat-config
     
    3232for opt in --version --help; do
    3333run sh 0 $prog ${opt}
    34 test -s stderr && exit 1
    35 test -s stdout || exit 1
     34test -s stderr && exit_fail
     35test -s stdout || exit_fail
    3636done
    3737
    38 grep '^installed=yes' ${prog} || exit 1
     38grep '^installed=yes' ${prog} || exit_fail
    3939
    4040run sh 1 $prog --nonsense
    41 grep 'yat-config:.*--nonsense' stderr || exit 1
    42 grep 'for more information' stderr || exit 1
     41grep 'yat-config:.*--nonsense' stderr || exit_fail
     42grep 'for more information' stderr || exit_fail
    4343
    44 exit 0
     44
  • trunk/test/yat_cpp_add_flag_test.sh

    r2384 r2520  
    2727set -e
    2828
    29 . ./common_defs.sh || exit 1
     29. ./common_defs.sh || exit 99
    3030
    3131cat >> configure.ac <<EOF
     
    4242./configure CXX=g++
    4343
    44 grep 'YAT_CPPFLAGS__' Makefile
     44grep 'YAT_CPPFLAGS__' Makefile || exit_fail
     45grep 'YAT_CPPFLAGS__.*HAVE_SOMETHING' Makefile || exit_fail
     46grep 'YAT_CPPFLAGS__.*SOMETHING.*SOMETHING' Makefile && exit_fail
     47grep 'YAT_CPPFLAGS__.*usr/' Makefile && exit_fail "found usr/"
    4548
    46 if test `grep 'YAT_CPPFLAGS__.*HAVE_SOMETHING' Makefile | wc -l` = 1; then
    47   echo "found HAVE_SOMETHING"
    48 else
    49   echo "ERROR: found no HAVE_SOMETHING"
    50   exit 1
    51 fi
    52 
    53 if test `grep 'YAT_CPPFLAGS__.*SOMETHING.*SOMETHING' Makefile|wc -l` = 0;
    54 then
    55   :
    56 else
    57   echo "ERROR: found double HAVE_SOMETHING"
    58   exit 1
    59 fi
    60 
    61 if test `grep 'YAT_CPPFLAGS__.*usr/' Makefile | wc -l` = 0; then
    62   echo "found no usr/"
    63 else
    64   echo "ERROR: found usr/"
    65   exit 1
    66 fi
    67 
    68 
    69 echo "Test is OK"
     49exit_success
  • trunk/test/yat_cxx_add_flag_test.sh

    r2384 r2520  
    2727set -e
    2828
    29 . ./common_defs.sh || exit 1
     29. ./common_defs.sh || exit 99
    3030
    3131cat >> configure.ac <<EOF
     
    4242grep 'YAT_CXXFLAGS__' Makefile
    4343
    44 if test `grep 'YAT_CXXFLAGS__.*SOMETHING' Makefile | wc -l` = 1; then
    45   echo "found SOMETHING"
    46 else
    47   echo "ERROR: found no SOMETHING"
    48   exit 1
    49 fi
     44grep 'YAT_CXXFLAGS__.*SOMETHING' Makefile || exit_fail found no SOMETHING
    5045
    5146if test `grep 'YAT_CXXFLAGS__.*SOMETHING.*SOMETHING' Makefile | wc -l` = 0; then
  • trunk/test/yat_ld_add_flag_test.sh

    r2384 r2520  
    2020
    2121
    22 # test that YAT_CPP_ADD_FLAG adds the passed flag and ignores standard
     22# test that YAT_LD_ADD_FLAG adds the passed flag and ignores standard
    2323# includes like `-L/usr/lib' and `-L/usr/local/lib'
    2424
     
    2727set -e
    2828
    29 . ./common_defs.sh || exit 1
     29. ./common_defs.sh || exit 99
    3030
    3131cat >> configure.ac <<EOF
     
    4242./configure CXX=g++
    4343
    44 grep 'YAT_LDFLAGS__' Makefile
     44grep 'YAT_LDFLAGS__' Makefile || exit_fail
     45grep 'YAT_LDFLAGS__.*opt' Makefile || exit_fail np opt
     46grep 'YAT_LDFLAGS__.*opt.*opt' Makefile && exit_fail found double opt
     47grep 'YAT_LDFLAGS__.*usr/' Makefile && exit_fail found usr/
    4548
    46 if test `grep 'YAT_LDFLAGS__.*opt' Makefile | wc -l` = 1; then
    47   echo "found opt"
    48 else
    49   echo "ERROR: found no opt"
    50   exit 1
    51 fi
    52 
    53 if test `grep 'YAT_LDFLAGS__.*opt.*opt' Makefile|wc -l` = 0;
    54 then
    55   :
    56 else
    57   echo "ERROR: found double opt"
    58   exit 1
    59 fi
    60 
    61 if test `grep 'YAT_LDFLAGS__.*usr/' Makefile | wc -l` = 0; then
    62   echo "found no usr/"
    63 else
    64   echo "ERROR: found usr/"
    65   exit 1
    66 fi
    67 
    68 
    69 echo "Test is OK"
     49exit_success
  • trunk/test/yat_lt_link_ifelse_test.sh

    r2451 r2520  
    2727set -e
    2828
    29 . ./common_defs.sh || exit 1
     29. ./common_defs.sh || exit 99
    3030
    3131cat >> configure.ac <<EOF
     
    7272else
    7373    tail -n 500 config.log;
    74     exit 1;
     74    exit_fail configure failed;
    7575fi
    7676
    77 grep test_result Makefile || exit 1
     77grep test_result Makefile || exit_fail
  • trunk/test/yat_m4_test.sh

    r2494 r2520  
    2727set -e
    2828
    29 . ./common_defs.sh || exit 1
     29. ./common_defs.sh || exit 99
    3030
    3131cat >> configure.ac <<EOF
     
    4545
    4646make
    47 ./hello || exit 1
     47./hello || exit_fail
    4848
    49 echo "Test is OK"
  • trunk/test/yat_m4_test2.sh

    r2384 r2520  
    2626set -e
    2727
    28 . ./common_defs.sh || exit 1
     28. ./common_defs.sh || exit 99
    2929
    3030cat >> configure.ac <<EOF
     
    4343make Makefile
    4444
    45 echo "Test is OK"
     45
  • trunk/test/yat_msg_error_test.sh

    r2495 r2520  
    2626set -e
    2727
    28 . ./common_defs.sh || exit 1
     28. ./common_defs.sh || exit 99
    2929
    3030specific_msg='some specific message a51965'
     
    4848bootstrap
    4949rm -f config.status
    50 exitcode=0
    51 ./configure > stdout 2> stderr || exitcode=$?
    52 cat stdout
    53 cat stderr >&2
    54 test $exitcode = 0 && exit 1
    55 grep "$specific_msg" stderr || exit 1
    56 grep "$specific_msg" config.log || exit 1
     50run ./configure 1
     51grep "$specific_msg" stderr || exit_fail
     52grep "$specific_msg" config.log || exit_fail
    5753
    5854# configure should abort before config.status creates Makefile
    59 test -f Makefile && exit 1
     55test -f Makefile && exit_fail
    6056
    61 grep 'for something more' stdout || exit 1
    62 
    63 echo "Test is OK"
     57grep 'for something more' stdout || exit_fail
  • trunk/test/yat_msg_error_test2.sh

    r2495 r2520  
    4444bootstrap
    4545rm -f config.status
    46 exitcode=0
    47 ./configure > stdout 2> stderr || exitcode=$?
    48 cat stdout
    49 cat stderr >&2
    50 test $exitcode = 0 || exit 1
     46run ./configure 0
    5147
    52 echo "Test is OK"
Note: See TracChangeset for help on using the changeset viewer.