|
Boost Interest : |
From: troy d. straszheim (troy_at_[hidden])
Date: 2008-06-02 18:04:26
I've just make a big commit to the CMake/releases branch,
think we've made a very solid step here. Turns out no
patches to cmake were required.
--- Tests ---
CTest is gone, the tests have been converted to real make targets,
using standard cmake mechanisms like add_custom_target,
add_custom_command, etc. These changes made it possible to refactor
and clean up much of the code in there.
In a workspace that has been configured with BOOST_TESTING=ON, the
ctest targets NightlyStart, ExperimentalSubmit, etc. are gone. In
their place are new targets:
Signals-test (build/run all tests for library Signals)
Signals-ordering_test (build the ordering_test test binary in project Signals)
Signals-ordering_test-run (build it and run it)
One possible problem is this:
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${testname}-${BOOST_TEST_TAG}.o
COMMAND
${THIS_TEST_PREFIX_ARGS}
${CMAKE_CXX_COMPILER}
${BOOST_TEST_COMPILE_FLAGS}
${BOOST_TEST_INCLUDES}
-c ${BOOST_TEST_SOURCES}
-o ${testname}-compile-test.o
COMMENT "Running ${testname} in project ${PROJECT_NAME}"
)
inside macro boost_test_compile(). This needs to be checked that the
compile command generated actually makes sense on windows.
boost_test_link is still broken.
The *_fail tests require one to use a wrapper script to flip the exit
status of test subprocesses. They need checking on windows, see
below.
--- BOOST_BUILD_SLAVE ---
I added a cmake option BOOST_BUILD_SLAVE which turns on generation of
xml from all build steps, and turns on per-library calls to a script
which (eventually) will HTTP POST build results; currently the POST
script just cats the xml logs to stdout and clears them. These POST
calls happen after the build and after the test of each library. To
me the post rate looks about right, of course it varies depending on
the size of the library.
The magic is in BoostBuildSlave.cmake, wherein you will see things
like:
set(CMAKE_CXX_COMPILE_OBJECT
"${BOOST_TEST_DRIVER} <CMAKE_CURRENT_BINARY_DIR> cxx_compile_object <OBJECT> ${CMAKE_CXX_COMPILE_OBJECT}")
Where BOOST_TEST_DRIVER is one of the python driver scripts in
tools/build/CMake. These are configured by cmake at makefile
generation time.
Here cmake will expand the variables inside ${THESE} immediately, and
the ones inside <THESE> when it actually builds the various targets.
So this just prepends a few things to the command used to build object
from .cpp files. It would expand to:
/path/to/xmlize.py /path/to/binary/dir cxx_compile_object foo.o gcc -DWHATEVER -I/whatever -c foo.cpp -o foo.o
The /path/to/xmlize.py script eats the first three arguments and
executes the rest in a subshell. The /path/to/binary/dir tells it
where to put its log, cxx_compile_object is used as the tag name
enclosing the generated xml, and foo.o is put inside a <target> tag.
The stdout/stderr/returnstatus, etc are captured and added to the xml.
So if you turn on BOOST_BUILD_SLAVE and BUILD_TESTING in an up-to-date cmake
buildspace, then 'make CRC-test', you should see something like
what is below.
The lines prefixed with *** are debugging output from
the python xmlizer scripts, and the lines prefixed with >>>, and the
XML immediately following, are from the HTTP POST script (which is
just a 'cat' script at the moment). The rest of it is make output.
% make CRC-test
Scanning dependencies of target CRC-crc_test
Building CXX object libs/crc/CRC-test/CMakeFiles/CRC-crc_test.dir/__/crc_test.cpp.o
***
*** Executing op:cxx_compile_object
*** ['/usr/bin/c++', '-DBOOST_ALL_NO_LIB=1', '-I/home/troy/Projects/boost/branches/CMake/release', '-O3', '-DNDEBUG', '-o', 'CMakeFiles/CRC-crc_test.dir/__/crc_test.cpp.o', '-c', '/home/troy/Projects/boost/branches/CMake/release/libs/crc/crc_test.cpp']
*** log=/home/troy/Projects/boost/branches/CMake/release-build/libs/crc/CRC-test/Log.xml
***
*** OK
Linking CXX executable ../../../bin/tests/CRC/crc_test
***
*** Executing op:link_executable
*** ['/usr/bin/c++', '-fPIC', 'CMakeFiles/CRC-crc_test.dir/__/crc_test.cpp.o', '-o', '../../../bin/tests/CRC/crc_test', '-rdynamic']
*** log=/home/troy/Projects/boost/branches/CMake/release-build/libs/crc/CRC-test/Log.xml
***
*** OK
Built target CRC-crc_test
Scanning dependencies of target CRC-crc_test-run
Running crc_test in project CRC
***
*** Executing op:run
*** ['/home/troy/Projects/boost/branches/CMake/release-build/bin/./tests/CRC/crc_test']
*** log=/home/troy/Projects/boost/branches/CMake/release-build/libs/crc/CRC-test/Log.xml
***
*** OK
Built target CRC-crc_test-run
Scanning dependencies of target CRC-test
CRC: posting build results for test from /home/troy/Projects/boost/branches/CMake/release-build/libs/crc/CRC-test
>>>
>>> Project CRC
>>> POST build log for test
>>> from log dir/home/troy/Projects/boost/branches/CMake/release-build/libs/crc/CRC-test
>>>
<cxx_compile_object><target>CMakeFiles/CRC-crc_test.dir/__/crc_test.cpp.o</target><commandline>/usr/bin/c++ -DBOOST_ALL_NO_LIB=1 -I/home/troy/Projects/boost/branches/CMake/release -O3 -DNDEBUG -o CMakeFiles/CRC-crc_test.dir/__/crc_test.cpp.o -c /home/troy/Projects/boost/branches/CMake/release/libs/crc/crc_test.cpp</commandline><returncode>0</returncode><stdout /><stderr /></cxx_compile_object>
<link_executable><target>../../../bin/tests/CRC/crc_test</target><commandline>/usr/bin/c++ -fPIC CMakeFiles/CRC-crc_test.dir/__/crc_test.cpp.o -o ../../../bin/tests/CRC/crc_test -rdynamic</commandline><returncode>0</returncode><stdout /><stderr /></link_executable>
<run><target>crc_test</target><commandline>/home/troy/Projects/boost/branches/CMake/release-build/bin/./tests/CRC/crc_test</commandline><returncode>0</returncode><stdout>Doing test suite for CRC-CCITT.
Doing computation tests.
Doing interrupt tests.
Doing error tests.
Doing test suite for CRC-16.
Doing computation tests.
Doing interrupt tests.
Doing error tests.
Doing test suite for CRC-32.
Doing computation tests.
Doing interrupt tests.
Doing error tests.
Doing timing tests.
Boost-Basic CRC-32: 31343 runs, 3.15 s, 9950.16 run/s
Boost-Optimal CRC-32: 65536 runs, 0.18 s, 364089 run/s
Reference CRC-32: 65536 runs, 0.22 s, 297891 run/s
The optimal Boost version is -22.2222% slower than the reference version.
The basic Boost version is 96.6598% slower than the reference version.
The basic Boost version is 97.2671% slower than the optimal Boost version.
Doing CRC-augmented message tests.
Doing short-CRC (3-bit augmented) message tests.
Doing short-CRC (7-bit augmented) message tests.
Doing one-bit polynominal CRC test.
Doing functional object interface test.
**** no errors detected
</stdout><stderr /></run>
Built target CRC-test
TODO
- On windows, make sure this is all going to work. Get those python
scripts working and happy over there.
- Think more carefully about the structure of the XML. It isn't quite
complete at the moment, some information e.g. about parents of
current tasks is left out (it is available to the POST script, just
not part of the XML).
- Put together targets for reporting the number of steps in an upcoming
build, svn url/rev of the codebase, etc.
- Consider the business of triggering these builds. Probably another
little python script using the svn bindings.
- Revamp 'traash' to ingest/display these build results.
-t