2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-01 20:32:17 +00:00
Files
build/test/timedata.py
Dave Abrahams 72a5e80e64 jam_src/
builtins.{c,h}
        Support for the REBUILDS rule
        remove unused variable

    rules.h
    make.c
        Support for the REBUILDS rule

    make1.c
        Support for the REBUILDS rule

        Support for recording timing information

        Restructured a case statement because it was masking a bug I
        introduced.

    execcmd.h
    execnt.c
    execunix.c
        Support for recording timing information
        Also removed NT-specific stuff from execunix

    expand.c
        Removed tabs from critical comment
        Added tab-width variable setting comment for emacs.

v2/test
    rebuilds.py, timedata.py, test_all.py
        Tests for REBUILDS and timing.


[SVN r27334]
2005-02-12 02:30:18 +00:00

55 lines
1.0 KiB
Python

#!/usr/bin/python
# This tests the typechecking facilities.
import BoostBuild
t = BoostBuild.Tester(pass_toolset=0)
t.write('file.jam', '''
rule time
{
DEPENDS $(<) : $(>) ;
__TIMING_RULE__ on $(>) = record_time $(<) ;
DEPENDS all : $(<) ;
}
actions time
{
echo $(>) user: $(__USER_TIME__) system: $(__SYSTEM_TIME__)
echo timed from $(>) >> $(<)
}
rule record_time ( target source : user : system )
{
ECHO record_time called: $(target) / $(source) / $(user) / $(system) ;
__USER_TIME__ on $(target) = $(user) ;
__SYSTEM_TIME__ on $(target) = $(system) ;
}
rule make
{
DEPENDS $(<) : $(>) ;
}
actions make
{
echo made from $(>) >> $(<)
}
time foo : bar ;
make bar : baz ;
''')
import re
t.write('baz', 'nothing\n')
t.run_build_system(
'-ffile.jam',
stdout=r'bar +user: [0-9\.]+ +system: +[0-9\.]+ *$',
match = lambda actual,expected: re.search(expected,actual,re.DOTALL)
)
t.expect_addition('foo')
t.expect_addition('bar')
t.expect_nothing_more()
t.cleanup()