From: Amos Jeffries Date: Fri, 11 Jul 2008 14:24:10 +0000 (+1200) Subject: TestBed: Add master test scripts and some control files X-Git-Tag: SQUID_3_1_0_1~49^2~153 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bea1ee2ec732a80b229f095bdf228dce769f67bd;p=thirdparty%2Fsquid.git TestBed: Add master test scripts and some control files This adds the ./test-builds.sh script which runs over an optional OS specific control build and a set of layered configurations. Usage: bash ./test-builds.sh [os-name] Currently supported OS: debian, ubuntu A sub-level build script is also added as the main engine of this system. It takes a pair of control files and attempts a clean build of squid. Logging as much of the build output as possible for manual oversight. The component control files are a set of files providing configure options and environment settings for the build. Their design and use is detailed in: http://wiki.squid-cache.org/Features/CodeTestBed --- diff --git a/test-builds.sh b/test-builds.sh new file mode 100755 index 0000000000..3c003a1bc5 --- /dev/null +++ b/test-builds.sh @@ -0,0 +1,22 @@ +# #!/bin/bash +# +# Run specific build tests for a given OS environment. +# + +if test -f "./test-suite/buildtests/os-${1}.opts" ; then + echo "TESTING: ${1}" + ./test-suite/buildtest.sh ./test-suite/buildtests/os-${1} +fi + +# +# Run specific tests for each combination of configure-time +# Options. +# +# These layers are constructed from detailed knowledge of +# component dependencies. +# + +for f in `ls -1 ./test-suite/buildtests/layer*.opts` ; do + echo "TESTING: ${f/.opts}" + ./test-suite/buildtest.sh ${f/.opts} +done diff --git a/test-suite/buildtest.sh b/test-suite/buildtest.sh new file mode 100755 index 0000000000..07a2f5ed06 --- /dev/null +++ b/test-suite/buildtest.sh @@ -0,0 +1,48 @@ +# #!/bin/bash +# +# Configure and run a test build against any given set of configure options +# or compile-time flags. +# +# Should be run from the source package root directory with paths relative to there. +# + +dist="${1}" + +# Figure out where to log the test output +log=`echo "${dist}" | sed s/..test-suite.buildtests.//g ` + +# ... and send everything there... +( + +if test -f ${dist/.opts}.opts ; then + echo "BUILD: ${dist/.opts}.opts" + . ./${dist/.opts}.opts +else + echo "BUILD: DEFAULT" + OPTS="" +fi + +if test -f ${dist/.opts/}.flags ; then +# echo "DEBUG: ${dist/.opts}.flags" + FLAGS=`cat ./${dist}.flags` +# else nothing set for flags. +fi + +# +# empty all the existing code, reconfigure and builds test code + +make -k distclean + +# +# above command currently encounters dependancy problems on cleanup. +# +rm -f -r src/fs/aufs/.deps src/fs/diskd/.deps && + ./bootstrap.sh && + ./configure ${OPTS} && + make check && + make + + +) 2>&1 > ./buildtest_${log}.log + +# do not build any of the install's ... diff --git a/test-suite/buildtests/layer-00-default.opts b/test-suite/buildtests/layer-00-default.opts new file mode 100644 index 0000000000..5f4d232ef0 --- /dev/null +++ b/test-suite/buildtests/layer-00-default.opts @@ -0,0 +1,5 @@ +# +# Default configuration options. +# - Nothing special configured. Just whatever is found by "./configure" +# +OPTS="" diff --git a/test-suite/buildtests/os-debian.flags b/test-suite/buildtests/os-debian.flags new file mode 100644 index 0000000000..544b285b4d --- /dev/null +++ b/test-suite/buildtests/os-debian.flags @@ -0,0 +1,11 @@ +# #!//bin/bash + +# Debian for some reason builds using explicit 'cc' instead of 'gcc' or automatic +export build_alias="i486-linux-gnu" +export CC="cc" +export CFLAGS="-g -O2 -g -Wall -O2" +export LDFLAGS="" +export CPPFLAGS="" +export CXX="g++" +export CXXFLAGS="-g -O2 -g -Wall -O2" +export FFLAGS="-g -O2" diff --git a/test-suite/buildtests/os-debian.opts b/test-suite/buildtests/os-debian.opts new file mode 100644 index 0000000000..5dead2b53d --- /dev/null +++ b/test-suite/buildtests/os-debian.opts @@ -0,0 +1,46 @@ +# #!/bin/bash +# +# Configure options currently used by Debian Packaged Release +# +# This is to test any release build against what the package maintainers are seeing +# +OPTS=" \ + --build=i486-linux-gnu \ + --prefix=/usr \ + --includedir="\${prefix}/include" \ + --mandir="\${prefix}/share/man" \ + --infodir="\${prefix}/share/info" \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --libexecdir="\${prefix}/lib/squid3" \ + --disable-maintainer-mode \ + --disable-dependency-tracking \ + --srcdir=. \ + --datadir=/usr/share/squid3 \ + --sysconfdir=/etc/squid3 \ + --mandir=/usr/share/man \ + --with-cppunit-basedir=/usr \ + --enable-inline \ + --enable-async-io=8 \ + --enable-storeio="ufs,aufs,coss,diskd,null" \ + --enable-removal-policies="lru,heap" \ + --enable-poll \ + --enable-delay-pools \ + --enable-cache-digests \ + --enable-snmp \ + --enable-htcp \ + --enable-select \ + --enable-carp \ + --with-large-files \ + --enable-underscores \ + --enable-icap-client \ + --enable-auth="basic,digest,ntlm" \ + --enable-basic-auth-helpers="LDAP,MSNT,NCSA,PAM,SASL,SMB,YP,getpwnam,multi-domain-NTLM" \ + --enable-ntlm-auth-helpers="SMB" \ + --enable-digest-auth-helpers="ldap,password" \ + --enable-external-acl-helpers="ip_user,ldap_group,session,unix_group,wbinfo_group" \ + --with-filedescriptors=65536 \ + --with-default-user=proxy \ + --enable-epoll \ + --enable-linux-netfilter \ +" diff --git a/test-suite/buildtests/os-ubuntu.flags b/test-suite/buildtests/os-ubuntu.flags new file mode 100644 index 0000000000..12dcef9968 --- /dev/null +++ b/test-suite/buildtests/os-ubuntu.flags @@ -0,0 +1,9 @@ +# #!/bin/bash + +# Ubuntu for some reason built using 'cc' instead of gcc +export CC="/usr/bin/cc" +export CXX="g++" +export CFLAGS="-g -O2 -g -Wall -O2" +export CXXFLAGS="-g -O2 -g -Wall -O2" +export CPPFLAGS="" +export LDFLAGS="-Wl,-Bsymbolic-functions" diff --git a/test-suite/buildtests/os-ubuntu.opts b/test-suite/buildtests/os-ubuntu.opts new file mode 100644 index 0000000000..d9b2caeaf0 --- /dev/null +++ b/test-suite/buildtests/os-ubuntu.opts @@ -0,0 +1,46 @@ +# #!/bin/bash +# +# Configure options currently used by Ubuntu Packaged Release +# +# This is to test any release build against what the package maintainers are seeing +# +OPTS=" \ + --build=i486-linux-gnu \ + --prefix=/usr \ + --includedir="\${prefix}/include" \ + --mandir="\${prefix}/share/man" \ + --infodir="\${prefix}/share/info" \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --libexecdir="\${prefix}/lib/squid3" \ + --disable-maintainer-mode \ + --disable-dependency-tracking \ + --srcdir=. \ + --datadir=/usr/share/squid3 \ + --sysconfdir=/etc/squid3 \ + --mandir=/usr/share/man \ + --with-cppunit-basedir=/usr \ + --enable-inline \ + --enable-async-io=8 \ + --enable-storeio="ufs,aufs,coss,diskd,null" \ + --enable-removal-policies="lru,heap" \ + --enable-poll \ + --enable-delay-pools \ + --enable-cache-digests \ + --enable-snmp \ + --enable-htcp \ + --enable-select \ + --enable-carp \ + --with-large-files \ + --enable-underscores \ + --enable-icap-client \ + --enable-auth="basic,digest,ntlm" \ + --enable-basic-auth-helpers="LDAP,MSNT,NCSA,PAM,SASL,SMB,YP,getpwnam,multi-domain-NTLM" \ + --enable-ntlm-auth-helpers="SMB" \ + --enable-digest-auth-helpers="ldap,password" \ + --enable-external-acl-helpers="ip_user,ldap_group,session,unix_group,wbinfo_group" \ + --with-filedescriptors=65536 \ + --with-default-user=proxy \ + --enable-epoll \ + --enable-linux-netfilter \ +"