s4-waf: avoid having to run waf configure before waf dist
[nivanova/samba-autobuild/.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 dist || exit 1
22     waf configure -C --enable-developer --prefix=$PREFIX || exit 1
23     time waf build || exit 1
24     time waf build || exit 1
25     waf install || exit 1
26     case $d in
27         "source4/lib/ldb")
28             ldd bin/ldbadd || exit 1
29             ;;
30         "lib/replace")
31             ldd bin/replace_testsuite || exit 1
32             ;;
33         "lib/talloc")
34             ldd bin/talloc_testsuite || exit 1
35             ;;
36         "lib/tdb")
37             ldd bin/tdbtool || exit 1
38             ;;
39     esac
40     popd
41 done