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 | # |
---|
18 | boost_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 | # |
---|
28 | cvs_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 | # |
---|
35 | test_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 | # |
---|
42 | toolset=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 | # |
---|
48 | comment_path="$boost_root/../regression_comment.html" |
---|
49 | # |
---|
50 | # "test_dir" is the relative path to the directory to run the tests in, |
---|
51 | # defaults to "status" and runs all the tests, but could be a sub-directory |
---|
52 | # for example "libs/regex/test" to run the regex tests alone. |
---|
53 | # |
---|
54 | test_dir="status" |
---|
55 | |
---|
56 | |
---|
57 | ### DEFAULTS ARE OK FOR THESE. |
---|
58 | |
---|
59 | # |
---|
60 | # "exe_suffix" the suffix used by exectable files: |
---|
61 | # In case your platform requires use of a special suffix for executables specify |
---|
62 | # it here, including the "." if needed. This should not be needed even in Windows |
---|
63 | # like platforms as they will execute without the suffix anyway. |
---|
64 | # |
---|
65 | exe_suffix= |
---|
66 | |
---|
67 | # |
---|
68 | # "bjam" points to your built bjam executable: |
---|
69 | # The location of the binary for running bjam. The default should work |
---|
70 | # under most circumstances. |
---|
71 | # |
---|
72 | bjam="$boost_root/tools/jam/src/bin/bjam$exe_suffix" |
---|
73 | |
---|
74 | # |
---|
75 | # "process_jam_log", and "compiler_status" paths to built helper programs: |
---|
76 | # The location of the executables of the regression help programs. These |
---|
77 | # are built locally so the default should work in most situations. |
---|
78 | # |
---|
79 | process_jam_log="$boost_root/dist/bin/process_jam_log$exe_suffix" |
---|
80 | compiler_status="$boost_root/dist/bin/compiler_status$exe_suffix" |
---|
81 | |
---|
82 | # |
---|
83 | # "boost_build_path" can point to additional locations to find toolset files. |
---|
84 | # |
---|
85 | boost_build_path="$HOME/.boost-build" |
---|
86 | |
---|
87 | |
---|
88 | ### NO MORE CONFIGURABLE PARTS. |
---|
89 | |
---|
90 | # |
---|
91 | # Some setup. |
---|
92 | # |
---|
93 | boost_dir=`basename "$boost_root"` |
---|
94 | if test -n "${BOOST_BUILD_PATH}" ; then |
---|
95 | BOOST_BUILD_PATH="$boost_build_path:$BOOST_BUILD_PATH" |
---|
96 | else |
---|
97 | BOOST_BUILD_PATH="$boost_build_path" |
---|
98 | fi |
---|
99 | export BOOST_BUILD_PATH |
---|
100 | |
---|
101 | # |
---|
102 | # STEP 0: |
---|
103 | # |
---|
104 | # Get the source code: |
---|
105 | # |
---|
106 | if test ! -d "$boost_root" ; then |
---|
107 | mkdir -p "$boost_root" |
---|
108 | if test $? -ne 0 ; then |
---|
109 | echo "creation of $boost_root directory failed." |
---|
110 | exit 256 |
---|
111 | fi |
---|
112 | fi |
---|
113 | if test $cvs_update = yes ; then |
---|
114 | echo fetching Boost: |
---|
115 | echo "/1 :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/boost A" >> "$HOME/.cvspass" |
---|
116 | cat "$HOME/.cvspass" | sort | uniq > "$HOME/.cvspass" |
---|
117 | cd `dirname "$boost_root"` |
---|
118 | if test -f boost/CVS/Root ; then |
---|
119 | cvs -z3 -d `cat "$boost_dir/CVS/Root"` co -d "$boost_dir" boost |
---|
120 | else |
---|
121 | cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/boost co -d "$boost_dir" boost |
---|
122 | fi |
---|
123 | fi |
---|
124 | |
---|
125 | # |
---|
126 | # STEP 1: |
---|
127 | # rebuild bjam if required: |
---|
128 | # |
---|
129 | echo building bjam: |
---|
130 | cd "$boost_root/tools/jam/src" && \ |
---|
131 | LOCATE_TARGET=bin sh ./build.sh |
---|
132 | if test $? != 0 ; then |
---|
133 | echo "bjam build failed." |
---|
134 | exit 256 |
---|
135 | fi |
---|
136 | |
---|
137 | # |
---|
138 | # STEP 2: |
---|
139 | # rebuild the regression test helper programs if required: |
---|
140 | # |
---|
141 | echo building regression test helper programs: |
---|
142 | cd "$boost_root/tools/regression/build" && \ |
---|
143 | "$bjam" $toolset release |
---|
144 | if test $? != 0 ; then |
---|
145 | echo "helper program build failed." |
---|
146 | exit 256 |
---|
147 | fi |
---|
148 | |
---|
149 | # |
---|
150 | # STEP 5: |
---|
151 | # repeat steps 3 and 4 for each additional toolset: |
---|
152 | # |
---|
153 | for tool in $test_tools ; do |
---|
154 | |
---|
155 | # |
---|
156 | # STEP 3: |
---|
157 | # run the regression tests: |
---|
158 | # |
---|
159 | echo running the $tool regression tests: |
---|
160 | cd "$boost_root/$test_dir" |
---|
161 | "$bjam" $tool --dump-tests 2>&1 | tee regress.log |
---|
162 | |
---|
163 | # |
---|
164 | # STEP 4: |
---|
165 | # post process the results: |
---|
166 | # |
---|
167 | echo processing the regression test results for $tool: |
---|
168 | cat regress.log | "$process_jam_log" --v2 |
---|
169 | if test $? != 0 ; then |
---|
170 | echo "Failed regression log post processing." |
---|
171 | exit 256 |
---|
172 | fi |
---|
173 | |
---|
174 | done |
---|
175 | |
---|
176 | # |
---|
177 | # STEP 6: |
---|
178 | # create the html table: |
---|
179 | # |
---|
180 | uname=`uname` |
---|
181 | echo generating html tables: |
---|
182 | "$compiler_status" --v2 --comment "$comment_path" "$boost_root" cs-$uname.html cs-$uname-links.html |
---|
183 | if test $? != 0 ; then |
---|
184 | echo "Failed HTML result table generation." |
---|
185 | exit 256 |
---|
186 | fi |
---|
187 | |
---|
188 | echo "done!" |
---|
189 | |
---|
190 | |
---|
191 | |
---|