|
Boost Testing : |
From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2006-02-23 06:45:06
Martin Wille wrote:
> Tobias Schwinger wrote:
>
> It would be cool if the build system would be able to automatically
> remove results for tests that don't exist anymore.
OK, here you go:
# Copyright (C) 2006 T. Schwinger - Boost Software License
# boost_root must be set here
echo removing outdated tests:
bin_dir=$boost_root"/bin/boost" # remove /boost for v2
for lib_test_dir in `find $boost_root/libs -type d -name test` ; do
lib_dir=`dirname $lib_test_dir`
lib=`basename $lib_dir`
echo - checking library $lib
jamfile=$lib_test_dir/Jamfile
jamfile_ts=$jamfile"_timestamp"
if test -r $jamfile ; then
if test -r $jamfile_ts ; then
if test "`find $jamfile -type f -newer $jamfile_ts`" = "$jamfile" ; then
echo +- Jamfile has changed, removing test target files
rm -rf $bin_dir/libs/$lib/test
touch -r $jamfile $jamfile_ts
fi
else
touch -r $jamfile $jamfile_ts
fi
fi
done
Test and integrate at will -- putting 'echo' before the 'rm -rf' sets dry run mode.
Even the integration of this snippet should work incrementally so the second run is the first that can detect changes.
No overhead is involved (except for the few seconds the script takes to run).
> However, I doubt this would be easy to implement, if possible at all.
(-; this one works quite well for motivating people, I figure ;-)
Regards,
Tobias