|
Boost : |
From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2006-02-03 10:51:19
For my work I usually write an unit test and want to execute
this test immediatelly to see whether and how it passes.
If an application has many, many tests running them
all would slow me down and disrupt the flow.
To deal with this I once wrote small test library which
checks timestamps of source files containing tests
and runs only tests from recently modified files.
(In my case I run tests from files changed during last
10 mins when the application starts.)
This way I am able to write a test and run it
within mere second(s).
Perhaps similar functionality could be considered
into Boost.Test (I didn't find it here).
The implementation is portable,
it uses only __FILE__, stat() and time().
It may be possible to check also source file
dependencies for changes (up to some point)
but I do not do it and it is not obstacle for me.
Syntax I use looks like
TEST
{
...
assert(...); // assert breaks into debugger
}
..
run_recently_modified_tests()
/Pavel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk