Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/regression/run_tests.sh @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 4.8 KB
Line 
1#!/bin/sh
2#
3# shell script for running the boost regression test suite and generating
4# a html table of results.
5
6# Set the following variables to configure the operation. Variables you
7# should set, i.e. usually required are listed first. Optional variables
8# have reasonable defaults for most situations.
9
10
11### THESE SHOULD BE CHANGED!
12
13#
14# "boost_root" points to the root of you boost installation:
15# This can be either a non-exitent directory or an already complete Boost
16# source tree.
17#
18boost_root="$HOME/CVSROOTs/Boost/boost_regression"
19
20#
21# Wether to fetch the most current Boost code from CVS (yes/no):
22# There are two contexts to use this script in: on an active Boost CVS
23# tree, and on a fresh Boost CVS tree. If "yes" is specified here an attempt
24# to fetch the latest CVS Boost files is made. For an active Boost CVS
25# the CVS connection information is used. If an empty tree is detected
26# the code is fetched with the anonymous read only information.
27#
28cvs_update=no
29
30#
31# "test_tools" are the Boost.Build toolsets to use for building and running the
32# regression tests. Specify a space separated list, of the Boost.Build toolsets.
33# Each will be built and tested in sequence.
34#
35test_tools=gcc
36
37#
38# "toolset" is the Boost.Build toolset to use for building the helper programs.
39# This is usually different than the toolsets one is testing. And this is
40# normally a toolset that corresponds to the compiler built into your platform.
41#
42toolset=gcc
43
44#
45# "comment_path" is the path to an html-file describing the test environment.
46# The content of this file will be embedded in the status pages being produced.
47#
48comment_path="$boost_root/../regression_comment.html"
49
50
51### DEFAULTS ARE OK FOR THESE.
52
53#
54# "exe_suffix" the suffix used by exectable files:
55# In case your platform requires use of a special suffix for executables specify
56# it here, including the "." if needed. This should not be needed even in Windows
57# like platforms as they will execute without the suffix anyway.
58#
59exe_suffix=
60
61#
62# "bjam" points to your built bjam executable:
63# The location of the binary for running bjam. The default should work
64# under most circumstances.
65#
66bjam="$boost_root/tools/build/jam_src/bin/bjam$exe_suffix"
67
68#
69# "process_jam_log", and "compiler_status" paths to built helper programs:
70# The location of the executables of the regression help programs. These
71# are built locally so the default should work in most situations.
72#
73process_jam_log="$boost_root/tools/regression/build/run/process_jam_log$exe_suffix"
74compiler_status="$boost_root/tools/regression/build/run/compiler_status$exe_suffix"
75
76#
77# "boost_build_path" can point to additional locations to find toolset files.
78#
79boost_build_path="$HOME/.boost-build"
80
81
82### NO MORE CONFIGURABLE PARTS.
83
84#
85# Some setup.
86#
87boost_dir=`basename "$boost_root"`
88if test -n "${BOOST_BUILD_PATH}" ; then
89    export BOOST_BUILD_PATH="$boost_build_path:$BOOST_BUILD_PATH"
90else
91    export BOOST_BUILD_PATH="$boost_build_path"
92fi
93
94#
95# STEP 0:
96#
97# Get the source code:
98#
99if test ! -d "$boost_root" ; then
100    mkdir -p "$boost_root"
101    if test $? -ne 0 ; then
102        echo "creation of $boost_root directory failed."
103        exit 256
104    fi
105fi
106if test $cvs_update = yes ; then
107    echo fetching Boost:
108    echo "/1 :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/boost A" >> "$HOME/.cvspass"
109    cat "$HOME/.cvspass" | sort | uniq > "$HOME/.cvspass"
110    cd `dirname "$boost_root"`
111    if test -f boost/CVS/Root ; then
112        cvs -z3 -d `cat "$boost_dir/CVS/Root"` co -d "$boost_dir" boost
113    else
114        cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/boost co -d "$boost_dir" boost
115    fi
116fi
117
118#
119# STEP 1:
120# rebuild bjam if required:
121#
122echo building bjam:
123cd "$boost_root/tools/build/jam_src" && \
124LOCATE_TARGET=bin sh ./build.sh
125if test $? != 0 ; then
126    echo "bjam build failed."
127    exit 256
128fi
129
130#
131# STEP 2:
132# rebuild the regression test helper programs if required:
133#
134echo building regression test helper programs:
135cd "$boost_root/tools/regression/build" && \
136"$bjam" -sTOOLS=$toolset -sBUILD=release run
137if test $? != 0 ; then
138    echo "helper program build failed."
139    exit 256
140fi
141
142#
143# STEP 5:
144# repeat steps 3 and 4 for each additional toolset:
145#
146for tool in $test_tools ; do
147
148#
149# STEP 3:
150# run the regression tests:
151#
152echo running the $tool regression tests:
153cd "$boost_root/status"
154"$bjam" -sTOOLS=$tool --dump-tests test 2>&1 | tee regress.log
155
156#
157# STEP 4:
158# post process the results:
159#
160echo processing the regression test results for $tool:
161cat regress.log | "$process_jam_log"
162if test $? != 0 ; then
163    echo "Failed regression log post processing."
164    exit 256
165fi
166
167done
168
169#
170# STEP 6:
171# create the html table:
172#
173uname=`uname`
174echo generating html tables:
175"$compiler_status" --comment "$comment_path" "$boost_root" cs-$uname.html cs-$uname-links.html
176if test $? != 0 ; then
177    echo "Failed HTML result table generation."
178    exit 256
179fi
180
181echo "done!"
182
Note: See TracBrowser for help on using the repository browser.