Boost logo

Boost-Build :

From: Zhon Johansen (zhon.johansen_at_[hidden])
Date: 2007-01-25 20:00:53


Hi Scott,

Here is my naive implementation to building and running cxxtests:
# Jamroot
import testing ;
path-constant ROOT_DIR : . ;
CXX_TEST_GEN_PL = $(ROOT_DIR)/cxxtest/cxxtestgen.pl ;

actions make-test-runner {
    perl -w $(CXX_TEST_GEN_PL) --error-printer --template
cxxtest/testmain.tpl -o $(<) $(2)
}

rule make-runner ( name * : tested-sources * : tests * : requirements * ) {
    if ! $(tests) {
        tests = [ sequence.insertion-sort [ glob *Test.h ] ] ;
    }
    make runner.cpp : $(tests) : $(__name__).make-test-runner ;
    unit-test runner : runner.cpp $(tested-sources) : $(requirements) ;
}

# Jamfile in my test directory
TESTED_SOURCES =
        # put for source files or projects here, I recommend projects to
avoid compiling file multiple times
    ;

make-runner :
    $(TESTED_SOURCES)
    ;

This creates a test runner for each directory.

HTH,

Zhon


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk