Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/shell/hush_test/run-all

    r1765 r2725  
    11#!/bin/sh
    22
    3 test -x hush || { echo "No ./hush?!"; exit; }
     3unset LANG LANGUAGE
     4unset LC_COLLATE
     5unset LC_CTYPE
     6unset LC_MONETARY
     7unset LC_MESSAGES
     8unset LC_NUMERIC
     9unset LC_TIME
     10unset LC_ALL
    411
    5 PATH="$PWD:$PATH" # for hush and recho/zecho/printenv
     12if test ! -x hush; then
     13    if test ! -x ../../busybox; then
     14        echo "Can't run tests. Put hush binary into this directory (`pwd`)"
     15        exit 1
     16    fi
     17    echo "No ./hush - creating a link to ../../busybox"
     18    ln -s ../../busybox hush
     19fi
     20if test ! -f .config; then
     21    if test ! -f ../../.config; then
     22        echo "Missing .config file"
     23        exit 1
     24    fi
     25    cp ../../.config . || exit 1
     26fi
     27
     28eval $(sed -e '/^#/d' -e '/^$/d' -e 's:^:export :' .config)
     29
     30PATH="`pwd`:$PATH" # for hush and recho/zecho/printenv
    631export PATH
    732
    8 THIS_SH="$PWD/hush"
     33THIS_SH="`pwd`/hush"
    934export THIS_SH
    1035
    1136do_test()
    1237{
    13     test -d "$1" || return 0
    14     (
    15     cd "$1" || { echo "cannot cd $1!"; exit 1; }
    16     for x in run-*; do
    17     test -f "$x" || continue
    18     case "$x" in
    19         "$0"|run-minimal|run-gprof) ;;
    20         *.orig|*~) ;;
    21         #*) echo $x ; sh $x ;;
    22         *)
    23         sh "$x" >"../$1-$x.fail" 2>&1 && \
    24         { echo "$1/$x: ok"; rm "../$1-$x.fail"; } || echo "$1/$x: fail";
    25         ;;
    26     esac
    27     done
    28     # Many bash run-XXX scripts just do this,
    29     # no point in duplication it all over the place
    30     for x in *.tests; do
     38    test -d "$1" || return 0
     39    d=${d%/}
     40#   echo Running tests in directory "$1"
     41    (
     42    tret=0
     43    cd "$1" || { echo "cannot cd $1!"; exit 1; }
     44    for x in run-*; do
     45        test -f "$x" || continue
     46        case "$x" in
     47            "$0"|run-minimal|run-gprof) ;;
     48            *.orig|*~) ;;
     49            #*) echo $x ; sh $x ;;
     50            *)
     51            sh "$x" >"../$1-$x.fail" 2>&1 && \
     52            { echo "$1/$x: ok"; rm "../$1-$x.fail"; } || echo "$1/$x: fail";
     53            ;;
     54        esac
     55    done
     56    # Many bash run-XXX scripts just do this,
     57    # no point in duplication it all over the place
     58    for x in *.tests; do
    3159    test -x "$x" || continue
    3260    name="${x%%.tests}"
    3361    test -f "$name.right" || continue
    34     {
    35         "$THIS_SH" "./$x" >"$name.xx" 2>&1
    36         diff -u "$name.xx" "$name.right" >"../$1-$x.fail" && rm -f "$name.xx" "../$1-$x.fail"
    37     } && echo "$1/$x: ok" || echo "$1/$x: fail"
    38     done
    39     )
     62#   echo Running test: "$x"
     63    (
     64        "$THIS_SH" "./$x" >"$name.xx" 2>&1
     65        # filter C library differences
     66        sed -i \
     67            -e "/: invalid option /s:'::g" \
     68            "$name.xx"
     69        test $? -eq 77 && rm -f "../$1-$x.fail" && exit 77
     70        diff -u "$name.xx" "$name.right" >"../$1-$x.fail" && rm -f "$name.xx" "../$1-$x.fail"
     71    )
     72    case $? in
     73        0)  echo "$1/$x: ok";;
     74        77) echo "$1/$x: skip (feature disabled)";;
     75        *)  echo "$1/$x: fail"; tret=1;;
     76    esac
     77    done
     78    exit ${tret}
     79    )
    4080}
    4181
     
    4383# Usage: run-all [directories]
    4484
     85ret=0
     86
    4587if [ $# -lt 1 ]; then
    46     # All sub directories
    47     modules=`ls -d hush-*`
     88    # All sub directories
     89    modules=`ls -d hush-*`
    4890
    49     for module in $modules; do
    50     do_test $module
    51     done
     91    for module in $modules; do
     92    do_test $module || ret=1
     93    done
    5294else
    53     while [ $# -ge 1 ]; do
     95    while [ $# -ge 1 ]; do
    5496    if [ -d $1 ]; then
    55         do_test $1
     97        do_test $1 || ret=1
    5698    fi
    5799    shift
    58     done
     100    done
    59101fi
     102
     103exit ${ret}
Note: See TracChangeset for help on using the changeset viewer.