diff options
author | Timothy Pearson <[email protected]> | 2011-07-10 15:24:15 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-07-10 15:24:15 -0500 |
commit | bd0f3345a938b35ce6a12f6150373b0955b8dd12 (patch) | |
tree | 7a520322212d48ebcb9fbe1087e7fca28b76185c /config.tests/unix | |
download | qt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.tar.gz qt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.zip |
Add Qt3 development HEAD version
Diffstat (limited to 'config.tests/unix')
-rwxr-xr-x | config.tests/unix/checkavail | 124 | ||||
-rwxr-xr-x | config.tests/unix/cups.test | 82 | ||||
-rwxr-xr-x | config.tests/unix/endian.test | 30 | ||||
-rw-r--r-- | config.tests/unix/endian/endiantest.cpp | 8 | ||||
-rw-r--r-- | config.tests/unix/endian/endiantest.pro | 5 | ||||
-rwxr-xr-x | config.tests/unix/ipv6.test | 31 | ||||
-rw-r--r-- | config.tests/unix/ipv6/ipv6test.cpp | 20 | ||||
-rw-r--r-- | config.tests/unix/ipv6/ipv6test.pro | 5 | ||||
-rwxr-xr-x | config.tests/unix/largefile.test | 31 | ||||
-rw-r--r-- | config.tests/unix/largefile/largefiletest.cpp | 32 | ||||
-rw-r--r-- | config.tests/unix/largefile/largefiletest.pro | 5 | ||||
-rwxr-xr-x | config.tests/unix/nis.test | 87 | ||||
-rwxr-xr-x | config.tests/unix/precomp.test | 22 | ||||
-rwxr-xr-x | config.tests/unix/ptrsize.test | 26 | ||||
-rw-r--r-- | config.tests/unix/ptrsize/ptrsizetest.cpp | 9 | ||||
-rw-r--r-- | config.tests/unix/ptrsize/ptrsizetest.pro | 5 | ||||
-rwxr-xr-x | config.tests/unix/stl.test | 31 | ||||
-rw-r--r-- | config.tests/unix/stl/stltest.cpp | 83 | ||||
-rw-r--r-- | config.tests/unix/stl/stltest.pro | 5 | ||||
-rwxr-xr-x | config.tests/unix/which.test | 39 |
20 files changed, 680 insertions, 0 deletions
diff --git a/config.tests/unix/checkavail b/config.tests/unix/checkavail new file mode 100755 index 0000000..43cec94 --- /dev/null +++ b/config.tests/unix/checkavail @@ -0,0 +1,124 @@ +#!/bin/sh +# +# usage: $1 is featurename, $2 verbose +# $3..$n librarynames like '-llibmysqlclient.*' or (optional) extra library paths like '-L/usr/local/lib' +# or filenames like "mysql.h" and (optional) extra include paths like '-I/usr/local/include' +# returns 0 on success + +SUCCESS= +MODULE_NAME=$1 +VERBOSE=$2 +shift 2 +LIBDIRS="/lib /usr/lib" +LIBNAMES="" +INCLUDEDIRS="/usr/include" +INCLUDES="" + +PARAMS=$@ +for PARAM in $PARAMS +do + PREFIX=`echo $PARAM | sed 's/^\(..\).*/\1/'` + case $PREFIX in + -L) + CLIBDIR=`echo $PARAM | sed -e 's/^-L//'` + LIBDIRS="$LIBDIRS $CLIBDIR" + ;; + -l) + CLIBNAME=`echo $PARAM | sed -e 's/^-l//'` + LIBNAMES="$LIBNAMES lib${CLIBNAME}.*" + ;; + -I) + CINCDIR=`echo $PARAM | sed -e 's/^-I//'` + INCLUDEDIRS="$INCLUDEDIRS $CINCDIR" + ;; + *) + INCLUDES="$PARAM $INCLUDES" + ;; + esac +done + +# debuggery + +if [ "$VERBOSE" = "yes" ] +then + echo "$MODULE_NAME auto-detection..." +# echo "searching for $LIBNAMES in $LIBDIRS" +# echo "and $INCLUDES in $INCLUDEDIRS" +fi + + +# check for lib +for LIBNAME in $LIBNAMES +do + SUCCESS="" + for LIBDIR in $LIBDIRS + do + FOUND_LIB=`ls $LIBDIR/$LIBNAME 2>/dev/null` + if [ ! -z "$FOUND_LIB" ] + then + SUCCESS=yes + if [ "$VERBOSE" = "yes" ] + then + echo " Found $LIBNAME in $LIBDIR" + fi + break + fi + done + if [ -z "$SUCCESS" ] + then + SUCCESS=no + if [ "$VERBOSE" = "yes" ] + then + echo " Could not find $LIBNAME anywhere in $LIBDIRS" + fi + break + fi +done + +# check for includes +if [ "$SUCCESS" = "yes" ] +then + for INCLUDE in $INCLUDES + do + SUCCESS="" + for INCLUDEDIR in $INCLUDEDIRS + do + FOUND_INC=`ls $INCLUDEDIR/$INCLUDE 2>/dev/null` + if [ ! -z "$FOUND_INC" ] + then + SUCCESS=yes + if [ "$VERBOSE" = "yes" ] + then + echo " Found $INCLUDE in $INCLUDEDIR" + fi + break + fi + done + if [ -z "$SUCCESS" ] + then + SUCCESS=no + if [ "$VERBOSE" = "yes" ] + then + echo " Could not find $INCLUDE anywhere in $INCLUDEDIRS" + fi + break + fi + done +fi + +if [ "$SUCCESS" != "yes" ] +then + if [ "$VERBOSE" = "yes" ] + then + echo "$MODULE_NAME disabled." + fi + exit 1 +else + if [ "$VERBOSE" = "yes" ] + then + echo "$MODULE_NAME enabled." + fi + exit 0 +fi +exit 1 + diff --git a/config.tests/unix/cups.test b/config.tests/unix/cups.test new file mode 100755 index 0000000..0b97e2b --- /dev/null +++ b/config.tests/unix/cups.test @@ -0,0 +1,82 @@ +#!/bin/sh + +CUPS=yes +XPLATFORM=`basename $1` +XCONFIG=$1/qmake.conf +VERBOSE=$2 +shift 2 +IN_INCDIRS="" +PARAMS=$@ +for PARAM in $PARAMS; do + PREFIX=`echo $PARAM | sed 's/^\(..\).*/\1/'` + case $PREFIX in + -L) + CLIBDIR=`echo $PARAM | sed -e 's/^-L//'` + IN_LIBDIRS="$IN_LIBDIRS $CLIBDIR" + ;; + -I) + CINCDIR=`echo $PARAM | sed -e 's/^-I//'` + IN_INCDIRS="$IN_INCDIRS $CINCDIR" + ;; + *) ;; + esac +done + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "CUPS auto-detection... ($*)" + +# check for the CUPS library +LIBS=cups +LIBDIRS="$IN_LIBDIRS /usr/shlib /usr/lib /lib" +if [ -z "$LIBS" ]; then + CUPS=no + [ "$VERBOSE" = "yes" ] && echo " No CUPS libraries specified." +else + for L in $LIBS; do + FOUND_LIB= + F= + for LIBDIR in $LIBDIRS; do + FOUND_LIB=`ls $LIBDIR/lib$L.* 2>/dev/null` + if [ ! -z "$FOUND_LIB" ]; then + F=yes + [ "$VERBOSE" = "yes" ] && echo " Found $L lib in $LIBDIR" + break + fi + done + if [ -z "$F" ]; then + CUPS=no + [ "VERBOSE" = "yes" ] && echo " Could not find CUPS lib anywhere in $LIBDIRS" + fi + done +fi + +# check for cups/cups.h +if [ "$CUPS" = "yes" ] +then + INCS="cups/cups.h" + INCDIRS="$IN_INCDIRS /usr/include /include" + + for I in $INCS; do + F= + for INCDIR in $INCDIRS; do + if [ -f $INCDIR/$I ]; then + F=yes + [ "$VERBOSE" = "yes" ] && echo " Found $I in $INCDIR" + break + fi + done + if [ -z "$F" ]; then + CUPS=no + [ "$VERBOSE" = "yes" ] && echo " Could not find $I anywhere in $INCDIRS" + fi + done +fi + +# done +if [ "$CUPS" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "CUPS disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "CUPS enabled." + exit 1 +fi diff --git a/config.tests/unix/endian.test b/config.tests/unix/endian.test new file mode 100755 index 0000000..9f5c566 --- /dev/null +++ b/config.tests/unix/endian.test @@ -0,0 +1,30 @@ +#!/bin/sh + +QMKSPEC=$1 +VERBOSE=$2 +SRCDIR=$3 +OUTDIR=$4 + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "Determining machine byte-order... ($*)" + +# build and run a test program +test -d $OUTDIR/config.tests/unix/endian || mkdir -p $OUTDIR/config.tests/unix/endian +$OUTDIR/bin/qmake -nocache -spec "$QMKSPEC" $SRCDIR/config.tests/unix/endian/endiantest.pro -o $OUTDIR/config.tests/unix/endian/Makefile >/dev/null 2>&1 +cd $OUTDIR/config.tests/unix/endian + +if [ "$VERBOSE" = "yes" ]; then + (make && ./endiantest) +else + (make && ./endiantest) >/dev/null 2>&1 +fi +ENDIAN=$? + +# done +if [ "$ENDIAN" -eq 0 ]; then + [ "$VERBOSE" = "yes" ] && echo "Using big endian." + exit 1 +else + [ "$VERBOSE" = "yes" ] && echo "Using little endian." + exit 0 +fi diff --git a/config.tests/unix/endian/endiantest.cpp b/config.tests/unix/endian/endiantest.cpp new file mode 100644 index 0000000..d4133cd --- /dev/null +++ b/config.tests/unix/endian/endiantest.cpp @@ -0,0 +1,8 @@ +int main(int, char **) +{ + unsigned char bytes[] = { 0x01, 0x02, 0x03, 0x04 }; + unsigned int *integer = (unsigned int *) bytes; + return (*integer == 0x01020304 ? + 0 : // big endian + 1); // little endian +} diff --git a/config.tests/unix/endian/endiantest.pro b/config.tests/unix/endian/endiantest.pro new file mode 100644 index 0000000..ab8c008 --- /dev/null +++ b/config.tests/unix/endian/endiantest.pro @@ -0,0 +1,5 @@ +TARGET=endiantest +CONFIG-=qt opengl x11sm dylib +CONFIG+=console +TEMPLATE=app +SOURCES=endiantest.cpp diff --git a/config.tests/unix/ipv6.test b/config.tests/unix/ipv6.test new file mode 100755 index 0000000..5df87d6 --- /dev/null +++ b/config.tests/unix/ipv6.test @@ -0,0 +1,31 @@ +#!/bin/sh + +IPV6=0 +QMKSPEC=$1 +VERBOSE=$2 +SRCDIR=$3 +OUTDIR=$4 + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "Testing IPv6 support..." + +# build a test program +test -d $OUTDIR/config.tests/unix/ipv6 || mkdir -p $OUTDIR/config.tests/unix/ipv6 +$OUTDIR/bin/qmake -nocache -spec "$QMKSPEC" $SRCDIR/config.tests/unix/ipv6/ipv6test.pro -o $OUTDIR/config.tests/unix/ipv6/Makefile >/dev/null 2>&1 +cd $OUTDIR/config.tests/unix/ipv6 + +if [ "$VERBOSE" = "yes" ]; then + (make && ./ipv6test) +else + (make && ./ipv6test) >/dev/null 2>&1 +fi +IPV6=$? + +# done +if [ "$IPV6" -ne 0 ]; then + [ "$VERBOSE" = "yes" ] && echo "IPv6 support disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "IPv6 support enabled." + exit 1 +fi diff --git a/config.tests/unix/ipv6/ipv6test.cpp b/config.tests/unix/ipv6/ipv6test.cpp new file mode 100644 index 0000000..4700ae6 --- /dev/null +++ b/config.tests/unix/ipv6/ipv6test.cpp @@ -0,0 +1,20 @@ +/* Sample program for configure to test IPv6 support on target +platforms. We check for the required IPv6 data structures. */ + +#if defined(__hpux) +#define _HPUX_SOURCE +#endif + +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> + +int main() +{ + sockaddr_in6 tmp; + sockaddr_storage tmp2; + (void)tmp; + (void)tmp2; + + return 0; +} diff --git a/config.tests/unix/ipv6/ipv6test.pro b/config.tests/unix/ipv6/ipv6test.pro new file mode 100644 index 0000000..ec4e875 --- /dev/null +++ b/config.tests/unix/ipv6/ipv6test.pro @@ -0,0 +1,5 @@ +TARGET=ipv6test +CONFIG += console +CONFIG-=qt opengl x11sm dylib +TEMPLATE=app +SOURCES=ipv6test.cpp diff --git a/config.tests/unix/largefile.test b/config.tests/unix/largefile.test new file mode 100755 index 0000000..f8cde73 --- /dev/null +++ b/config.tests/unix/largefile.test @@ -0,0 +1,31 @@ +#!/bin/sh + +LARGEFILE=0 +QMKSPEC=$1 +VERBOSE=$2 +SRCDIR=$3 +OUTDIR=$4 + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "Testing Large File support... ($*)" + +# build and run a test program +test -d $OUTDIR/config.tests/unix/largefile || mkdir -p $OUTDIR/config.tests/unix/largefile +$OUTDIR/bin/qmake -nocache -spec "$QMKSPEC" $SRCDIR/config.tests/unix/largefile/largefiletest.pro -o $OUTDIR/config.tests/unix/largefile/Makefile >/dev/null 2>&1 +cd $OUTDIR/config.tests/unix/largefile + +if [ "$VERBOSE" = "yes" ]; then + (make && ./largefiletest) +else + (make && ./largefiletest) >/dev/null 2>&1 +fi +LARGEFILE=$? + +# done +if [ "$LARGEFILE" -ne 0 ]; then + [ "$VERBOSE" = "yes" ] && echo "Large File support disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "Large File support enabled." + exit 1 +fi diff --git a/config.tests/unix/largefile/largefiletest.cpp b/config.tests/unix/largefile/largefiletest.cpp new file mode 100644 index 0000000..ed04e7a --- /dev/null +++ b/config.tests/unix/largefile/largefiletest.cpp @@ -0,0 +1,32 @@ +/* Sample program for configure to test Large File support on target +platforms. +*/ + +#define _LARGEFILE_SOURCE +#define _LARGE_FILES +#define _FILE_OFFSET_BITS 64 +#include <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <assert.h> +#include <stdio.h> + +int main( int, char **argv ) +{ +// check that off_t can hold 2^63 - 1 and perform basic operations... +#define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + if (OFF_T_64 % 2147483647 != 1) + return 1; + + // stat breaks on SCO OpenServer + struct stat buf; + stat( argv[0], &buf ); + if (!S_ISREG(buf.st_mode)) + return 2; + + FILE *file = fopen( argv[0], "r" ); + off_t offset = ftello( file ); + fseek( file, offset, SEEK_CUR ); + fclose( file ); + return 0; +} diff --git a/config.tests/unix/largefile/largefiletest.pro b/config.tests/unix/largefile/largefiletest.pro new file mode 100644 index 0000000..918e8cc --- /dev/null +++ b/config.tests/unix/largefile/largefiletest.pro @@ -0,0 +1,5 @@ +TARGET=largefiletest +CONFIG-=qt opengl x11sm dylib +CONFIG+=console +TEMPLATE=app +SOURCES=largefiletest.cpp diff --git a/config.tests/unix/nis.test b/config.tests/unix/nis.test new file mode 100755 index 0000000..2dc4c5a --- /dev/null +++ b/config.tests/unix/nis.test @@ -0,0 +1,87 @@ +#!/bin/sh + +NIS=yes +XPLATFORM=`basename $1` +XCONFIG=$1/qmake.conf +VERBOSE=$2 +shift 2 +IN_INCDIRS="" +PARAMS=$@ +for PARAM in $PARAMS; do + PREFIX=`echo $PARAM | sed 's/^\(..\).*/\1/'` + case $PREFIX in + -L) + CLIBDIR=`echo $PARAM | sed -e 's/^-L//'` + IN_LIBDIRS="$IN_LIBDIRS $CLIBDIR" + ;; + -I) + CINCDIR=`echo $PARAM | sed -e 's/^-I//'` + IN_INCDIRS="$IN_INCDIRS $CINCDIR" + ;; + *) ;; + esac +done + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "NIS auto-detection... ($*)" + +# check for the NIS library +if echo $XPLATFORM | grep '^solaris-' >/dev/null; then + # on Solaris it's -lnsl, it's not specified because X11 already links it + LIBS=nsl +else + LIBS=`sed -n -e '/^QMAKE_LIBS_NIS[ ]*=/ { s/[^=]*=[ ]*//; s/-l/ /g; p; }' $XCONFIG` +fi +LIBDIRS="$IN_LIBDIRS /usr/shlib /usr/lib /lib" +if [ -z "$LIBS" ]; then + NIS=no + [ "$VERBOSE" = "yes" ] && echo " No NIS libraries specified." +else + for L in $LIBS; do + FOUND_LIB= + F= + for LIBDIR in $LIBDIRS; do + FOUND_LIB=`ls $LIBDIR/lib$L.* 2>/dev/null` + if [ ! -z "$FOUND_LIB" ]; then + F=yes + [ "$VERBOSE" = "yes" ] && echo " Found $L lib in $LIBDIR" + break + fi + done + if [ -z "$F" ]; then + NIS=no + [ "VERBOSE" = "yes" ] && echo " Could not find NIS lib anywhere in $LIBDIRS" + fi + done +fi + +# check for rpcsvc/ypclnt.h and rpcsvc/yp_prot.h +if [ "$NIS" = "yes" ] +then + INCS="rpcsvc/ypclnt.h rpcsvc/yp_prot.h" + INCDIRS="$IN_INCDIRS /usr/include /include" + + for I in $INCS; do + F= + for INCDIR in $INCDIRS; do + if [ -f $INCDIR/$I ]; then + F=yes + [ "$VERBOSE" = "yes" ] && echo " Found $I in $INCDIR" + break + fi + done + if [ -z "$F" ]; then + NIS=no + [ "$VERBOSE" = "yes" ] && echo " Could not find $I anywhere in $INCDIRS" + fi + done +fi + +# done +if [ "$NIS" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "NIS disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "NIS enabled." + exit 1 +fi diff --git a/config.tests/unix/precomp.test b/config.tests/unix/precomp.test new file mode 100755 index 0000000..1a553d3 --- /dev/null +++ b/config.tests/unix/precomp.test @@ -0,0 +1,22 @@ +#!/bin/sh + +PRECOMP_SUPPORT=no +XPLATFORM=`basename $1` +XCONFIG=$1/qmake.conf +VERBOSE=$2 + +>precomp_header.h +COMPILER=`grep QMAKE_CC $XCONFIG | sed "s,.*= *,,"` +if $COMPILER -x c-header precomp_header.h >/dev/null 2>&1; then + $COMPILER -x c++-header precomp_header.h && PRECOMP_SUPPORT=yes +fi +rm -f precomp_header.h precomp_header.h.gch + +# done +if [ "$PRECOMP_SUPPORT" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support enabled." + exit 1 +fi diff --git a/config.tests/unix/ptrsize.test b/config.tests/unix/ptrsize.test new file mode 100755 index 0000000..0d0337d --- /dev/null +++ b/config.tests/unix/ptrsize.test @@ -0,0 +1,26 @@ +#/bin/sh + +LARGEFILE=0 +QMKSPEC=$1 +VERBOSE=$2 +SRCDIR=$3 +OUTDIR=$4 + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "Testing size of pointers ... ($*)" + +# build and run a test program +test -d $OUTDIR/config.tests/unix/ptrsize || mkdir -p $OUTDIR/config.tests/unix/ptrsize +$OUTDIR/bin/qmake -nocache -spec "$QMKSPEC" $SRCDIR/config.tests/unix/ptrsize/ptrsizetest.pro -o $OUTDIR/config.tests/unix/ptrsize/Makefile >/dev/null 2>&1 +cd $OUTDIR/config.tests/unix/ptrsize + +if [ "$VERBOSE" = "yes" ]; then + (make clean && make && ./ptrsizetest) +else + (make clean && make && ./ptrsizetest) >/dev/null 2>&1 +fi +PTRSIZE=$? + +# done +[ "$VERBOSE" = "yes" ] && echo "Pointersize: $PTRSIZE" +exit $PTRSIZE diff --git a/config.tests/unix/ptrsize/ptrsizetest.cpp b/config.tests/unix/ptrsize/ptrsizetest.cpp new file mode 100644 index 0000000..f2de943 --- /dev/null +++ b/config.tests/unix/ptrsize/ptrsizetest.cpp @@ -0,0 +1,9 @@ +/* Sample program for configure to test pointer size on target +platforms. +*/ + +int main( int, char ** ) +{ + return sizeof(void *); +} + diff --git a/config.tests/unix/ptrsize/ptrsizetest.pro b/config.tests/unix/ptrsize/ptrsizetest.pro new file mode 100644 index 0000000..dfff44f --- /dev/null +++ b/config.tests/unix/ptrsize/ptrsizetest.pro @@ -0,0 +1,5 @@ +TARGET=ptrsizetest +CONFIG-=qt opengl x11sm dylib +CONFIG+=console +TEMPLATE=app +SOURCES=ptrsizetest.cpp diff --git a/config.tests/unix/stl.test b/config.tests/unix/stl.test new file mode 100755 index 0000000..90c1925 --- /dev/null +++ b/config.tests/unix/stl.test @@ -0,0 +1,31 @@ +#!/bin/sh + +STL=0 +QMKSPEC=$1 +VERBOSE=$2 +SRCDIR=$3 +OUTDIR=$4 + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "Testing STL support..." + +# build a test program +test -d $OUTDIR/config.tests/unix/stl || mkdir -p $OUTDIR/config.tests/unix/stl +$OUTDIR/bin/qmake -nocache -spec "$QMKSPEC" $SRCDIR/config.tests/unix/stl/stltest.pro -o $OUTDIR/config.tests/unix/stl/Makefile >/dev/null 2>&1 +cd $OUTDIR/config.tests/unix/stl + +if [ "$VERBOSE" = "yes" ]; then + (make && ./stltest) +else + (make && ./stltest) >/dev/null 2>&1 +fi +STL=$? + +# done +if [ "$STL" -ne 0 ]; then + [ "$VERBOSE" = "yes" ] && echo "STL support disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "STL support enabled." + exit 1 +fi diff --git a/config.tests/unix/stl/stltest.cpp b/config.tests/unix/stl/stltest.cpp new file mode 100644 index 0000000..979d5c4 --- /dev/null +++ b/config.tests/unix/stl/stltest.cpp @@ -0,0 +1,83 @@ +/* Sample program for configure to test STL support on target +platforms. We are mainly concerned with being able to instantiate +templates for common STL container classes. +*/ + +#include <iterator> +#include <map> +#include <vector> +#include <algorithm> +#include <iostream> + +int main() +{ + int rval = 0; + + std::vector<int> v1; + v1.push_back( 0 ); + v1.push_back( 1 ); + v1.push_back( 2 ); + v1.push_back( 3 ); + v1.push_back( 4 ); + if ( v1.size() != 5 ) { + std::cout << "stltest: vector failed size check, expected 5, got " << v1.size(); + ++rval; + } + if ( v1.capacity() < 5 ) { + std::cout << "stltest: vector failed capacity check, expected >= 5, got " << v1.capacity(); + ++rval; + } + std::vector<int>::iterator v1it = std::find( v1.begin(), v1.end(), 99 ); + if ( v1it != v1.end() ) { + std::cout << "stltest: find failed, expected end(), got " << *v1it; + ++rval; + } + v1it = std::find( v1.begin(), v1.end(), 3 ); + if ( v1it == v1.end() ) { + std::cout << "stltest: find failed, expected to find element, got end()"; + ++rval; + } + std::vector<int> v2; + std::copy( v1.begin(), v1it, std::back_inserter( v2 ) ); + if ( v2.size() != 3 ) { + std::cout << "stltest: copy failed, expected 3 elements, got " << v2.size(); + ++rval; + } + + std::map<int, double> m1; + m1.insert( std::make_pair( 1, 2.0 ) ); + m1.insert( std::make_pair( 3, 2.0 ) ); + m1.insert( std::make_pair( 5, 2.0 ) ); + m1.insert( std::make_pair( 7, 2.0 ) ); + if ( m1.size() != 4 ) { + std::cout << "stltest: map failed size check, expected 4, got " << m1.size(); + ++rval; + } + std::map<int,double>::iterator m1it = m1.begin(); + for ( ; m1it != m1.end(); ++m1it ) { + if ( (*m1it).second != 2 ) { + std::cout << "stltest: iterator failed, expected 2, got " << (*m1it).second; + ++rval; + } + } + std::map< int, double > m2( m1 ); + if ( m2.size() != m1.size() ) { + std::cout << "stltest: map copy failed, expected " << m1.size() << " elements, got " << m2.size(); + ++rval; + } + + return rval; +} + + +// something mean to see if the compiler and C++ standard lib are good enough +template<class K, class T> +class DummyClass +{ + // everything in std namespace ? + typedef std::bidirectional_iterator_tag i; + typedef std::ptrdiff_t d; + // typename implemented ? + typedef typename std::map<K,T>::iterator MyIterator; +}; + diff --git a/config.tests/unix/stl/stltest.pro b/config.tests/unix/stl/stltest.pro new file mode 100644 index 0000000..e40708a --- /dev/null +++ b/config.tests/unix/stl/stltest.pro @@ -0,0 +1,5 @@ +TARGET=stltest +CONFIG+=console +CONFIG-=qt opengl x11sm dylib +TEMPLATE=app +SOURCES=stltest.cpp diff --git a/config.tests/unix/which.test b/config.tests/unix/which.test new file mode 100755 index 0000000..37c858c --- /dev/null +++ b/config.tests/unix/which.test @@ -0,0 +1,39 @@ +#!/bin/sh + +HOME=/dev/null +export HOME + +unset which + +WHICH=`which which 2>/dev/null` +if echo $WHICH | grep 'shell built-in command' >/dev/null 2>&1; then + WHICH=which +elif [ -z "$WHICH" ]; then + if which which >/dev/null 2>&1; then + WHICH=which + else + for a in /usr/ucb /usr/bin /bin /usr/local/bin; do + if [ -x $a/which ]; then + WHICH=$a/which + break; + fi + done + fi +fi + +if [ -z "$WHICH" ]; then + IFS=: + for a in $PATH; do + if [ -x $a/$1 ]; then + echo "$a/$1" + exit 0 + fi + done +else + a=`"$WHICH" "$1" 2>/dev/null` + if [ ! -z "$a" -a -x "$a" ]; then + echo "$a" + exit 0 + fi +fi +exit 1 |