]> mj.ucw.cz Git - libucw.git/blob - debug/check-configs
Unicode: Reject denormalized UTF-8 sequences
[libucw.git] / debug / check-configs
1 #!/bin/bash
2 # A script for testing compilability of different configurations
3 # (c) 2004--2010 Martin Mares <mj@ucw.cz>
4
5 set -e
6
7 TEST=0
8 ERR=
9 CC=${CC:-gcc}
10 MAKEOPTS=${MAKEOPTS:--j8}
11
12 function die
13 {
14         echo >&3 "      $@"
15         exit 1
16 }
17
18 function try
19 {
20         TEST=$(($TEST+1))
21         TDIR=tests/$TEST
22         mkdir $TDIR
23         echo "### Test $TEST: $@ ###" | tee $TDIR/log
24         CONFIG="$1"
25         shift
26         ARGS="$@ CC=$CC"
27
28         (
29                 cd $TDIR
30                 exec 3>&2 >>log 2>&1
31                 case $CONFIG in
32                         *)                      ../../configure $CONFIG CONFIG_LOCAL $ARGS || die "CANNOT CONFIGURE"
33                                                 ;;
34                 esac
35                 make $MAKEOPTS || die FAILED
36                 echo >&3 "      COMPILATION PASSED"
37                 if [ -z "$SKIP_TESTS" ] ; then
38                         make -k -j1 tests || die "TESTS FAILED"
39                         echo >&3 "      TESTS PASSED"
40                 fi
41         ) || ERR=1
42 }
43
44 rm -rf tests
45 mkdir tests
46 if [ "$1" == DARWIN ] ; then
47         # All tests on Darwin need CONFIG_SHARED, due to libucw-charset collision
48         # only visible with static linking.
49         FLAGS="CONFIG_SHARED"
50         try debug/default.cfg $FLAGS CONFIG_UCW_PCRE                                    # `make tests' does not work with non-local builds with shared libs
51 elif [ -n "$1" ] ; then
52         try "$@"
53 else
54         try default.cfg                                                                 # default configuration
55         try default.cfg -CONFIG_DEBUG                                                   # with no debugging code
56         try debug/default.cfg                                                           # debugging configuration
57         try debug/default.cfg -CONFIG_SHARED                                            # statically linked
58         try debug/default.cfg -CONFIG_UCW_THREADS                                       # non-threaded configuration
59         try debug/default.cfg -CONFIG_UCW_TLS                                           # threaded, but no TLS support in gcc
60         try debug/default.cfg -CONFIG_UCW_EPOLL -CONFIG_UCW_MONOTONIC_CLOCK             # without epoll and monotonic clock
61         try debug/default.cfg CONFIG_UCW_POSIX_REGEX                                    # different regex libs
62         try debug/default.cfg CONFIG_UCW_PCRE
63 fi
64
65 [ -z "$ERR" ]