build: better waf test script
[kai/samba.git] / buildtools / testwaf.sh
1 #!/bin/bash
2
3 d=$(dirname $0)
4
5 cd $d/..
6 PREFIX=$HOME/testprefix
7
8 if [ $# -gt 0 ]; then
9     tests="$*"
10 else
11     tests="lib/replace lib/talloc lib/tevent lib/tdb source4/lib/ldb"
12 fi
13
14 echo "testing in dirs $tests"
15
16 for d in $tests; do
17     echo "`date`: testing $d"
18     pushd $d || exit 1
19     rm -rf bin
20     type waf
21     waf configure -C --enable-developer --prefix=$PREFIX || exit 1
22     time waf build || exit 1
23     time waf build || exit 1
24     waf install || exit 1
25     case $d in
26         "source4/lib/ldb")
27             ldd bin/ldbadd || exit 1
28             ;;
29         "lib/replace")
30             ldd bin/replace_testsuite || exit 1
31             ;;
32         "lib/talloc")
33             ldd bin/talloc_testsuite || exit 1
34             ;;
35         "lib/tdb")
36             ldd bin/tdbtool || exit 1
37             ;;
38     esac
39     popd
40 done