8 if [ -z "$LOGDIR" ]; then
10 LOGDIR=$LOGBASEDIR/$DATE
15 if [ -z "$DBFILE" ]; then
18 DB="-S $DBFILE --commit $(git rev-parse HEAD)"
19 if [ -n "$BUILD" ]; then
22 if [ "$PREFILL_DB" = "y" ] ; then
23 DB="$DB --prefill-tests"
29 echo "$0 [-v | --valgrind | valgrind] [-t | --trace | trace]"
30 echo "\t[-n <num> | --channels <num>] [-B | --build]"
31 echo "\t[-c | --codecov ] [run-tests.py parameters]"
42 while [ "$1" != "" ]; do
44 -v | --valgrind | valgrind)
46 echo "$0: using valgrind"
51 echo "$0: using Trace"
58 echo "$0: using channels=$NUM_CH"
62 echo "$0: build before running tests"
67 echo "$0: using code coverage"
75 RUN_TEST_ARGS="$RUN_TEST_ARGS$1 "
81 if [ ! -z "$RUN_TEST_ARGS" ]; then
82 echo "$0: passing the following args to run-tests.py: $RUN_TEST_ARGS"
86 if [ ! -z "$BUILD" ]; then
90 if [ ! -z "$VALGRIND" ]; then
91 SUFFIX=$SUFFIX-valgrind
94 if [ ! -z "$TRACE" ]; then
99 if [ ! -z "$CODECOV" ]; then
100 SUFFIX=$SUFFIX-codecov
103 if [ ! -z "$BUILD" ]; then
104 echo "Building with args=$BUILD_ARGS"
105 if ! ./build.sh $BUILD_ARGS; then
106 echo "Failed building components"
111 if ! ./start.sh $VALGRIND $TRACE channels=$NUM_CH; then
112 if ! [ -z "$LOGBASEDIR" ] ; then
113 echo "Could not start test environment" > $LOGDIR/run
118 sudo ./run-tests.py -D --logdir "$LOGDIR" $TRACE_ARGS -q $DB $RUN_TEST_ARGS || errors=1
122 if [ ! -z "$VALGRIND" ] ; then
123 failures=`grep "ERROR SUMMARY" $LOGDIR/valgrind-* | grep -v " 0 errors" | wc -l`
124 if [ $failures -gt 0 ]; then
125 echo "Mark as failed due to valgrind errors"
130 if [ ! -z "$CODECOV" ] ; then
131 lcov -q --capture --directory ../../wpa_supplicant --output-file $LOGDIR/wpas_lcov.info
132 genhtml -q $LOGDIR/wpas_lcov.info --output-directory $LOGDIR/wpas_lcov
133 lcov -q --capture --directory ../../hostapd --output-file $LOGDIR/hostapd_lcov.info
134 genhtml -q $LOGDIR/hostapd_lcov.info --output-directory $LOGDIR/hostapd_lcov
137 if [ $errors -gt 0 ]; then
138 tar czf /tmp/hwsim-tests-$DATE-FAILED$SUFFIX.tar.gz $LOGDIR/