]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Use new scripts for vm-run.sh codecov
authorJouni Malinen <j@w1.fi>
Sun, 21 Dec 2014 14:41:59 +0000 (16:41 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 21 Dec 2014 14:41:59 +0000 (16:41 +0200)
Now there is only one set of commands to maintain. The separate reports
for individual components have not been of much use in the past, so they
are dropped for now.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/vm/combine-codecov.sh
tests/hwsim/vm/process-codecov.sh
tests/hwsim/vm/vm-run.sh

index 9c7be84ea0f11c8eb5b276a4dc6ab51d16a5a7a5..014d615bee7b548129421d720fcb16bee4e9fef2 100755 (executable)
@@ -1,6 +1,11 @@
 #!/bin/bash
 
 LOGDIR=$1
+if [ -n "$2" ]; then
+    ODIR=$2
+else
+    ODIR=.
+fi
 TMPDIR=/tmp/logs
 
 mv $LOGDIR/alt-* $TMPDIR
@@ -13,7 +18,7 @@ done
 
 lcov $args -o $LOGDIR/combined.info > $LOGDIR/combined-lcov.log 2>&1
 cd $LOGDIR
-genhtml -t "wpa_supplicant/hostapd combined for hwsim test run $(date +%s)" combined.info --output-directory . > lcov.log 2>&1
+genhtml -t "wpa_supplicant/hostapd combined for hwsim test run $(date +%s)" combined.info --output-directory $ODIR > lcov.log 2>&1
 
 rm -r /tmp/logs/alt-wpa_supplicant
 rm -r /tmp/logs/alt-hostapd
index 7108a200ad5c9364c6d4d5a441011b7b457389db..d932aa2d011e5fd3d012531f2b468646df4306f3 100755 (executable)
@@ -2,6 +2,7 @@
 
 LOGDIR=$1
 POSTFIX=$2
+RESTORE=$3
 
 DIR=$PWD
 TMPDIR=/tmp/logs
@@ -25,7 +26,11 @@ lcov -c -d .. 2> lcov.log | sed s%SF:/tmp/logs/alt-[^/]*/%SF:/tmp/logs/alt-wpa_s
 wait
 
 cd $DIR
-rm -r $TMPDIR/alt-wpa_supplicant
-rm -r $TMPDIR/alt-hostapd
-rm -r $TMPDIR/alt-hostapd-as
-rm -r $TMPDIR/alt-hlr_auc_gw
+if [ "$RESTORE" == "restore" ]; then
+    mv $TMPDIR/alt-* $LOGDIR
+else
+    rm -r $TMPDIR/alt-wpa_supplicant
+    rm -r $TMPDIR/alt-hostapd
+    rm -r $TMPDIR/alt-hostapd-as
+    rm -r $TMPDIR/alt-hlr_auc_gw
+fi
index 163586dad39c67a8287f0a5fcbbe68afc58bbbb2..e6d99d35445280ff3e92e9af03a430b40616f721 100755 (executable)
@@ -102,61 +102,15 @@ kvm \
        -append "mac80211_hwsim.support_p2p_device=0 mac80211_hwsim.channels=$CHANNELS mac80211_hwsim.radios=6 init=$CMD testdir=$TESTDIR timewarp=$TIMEWARP console=$KVMOUT root=/dev/root rootflags=trans=virtio,version=9p2000.u ro rootfstype=9p EPATH=$EPATH ARGS=$RUN_TEST_ARGS"
 
 if [ $CODECOV = "yes" ]; then
-    DIR=$PWD
-    mv $LOGDIR/alt-wpa_supplicant /tmp/logs
-    mv $LOGDIR/alt-hostapd /tmp/logs
-    mv $LOGDIR/alt-hostapd-as /tmp/logs
-    mv $LOGDIR/alt-hlr_auc_gw /tmp/logs
-
-    echo "Generating code coverage report for wpa_supplicant"
-    cd /tmp/logs/alt-wpa_supplicant/wpa_supplicant
-    lcov -c -d .. > lcov.info 2> lcov.log
-    genhtml -t "wpa_supplicant hwsim test run $DATE" lcov.info --output-directory $LOGDIR/lcov-wpa_supplicant >> lcov.log 2>&1
-    mv lcov.info lcov.log $LOGDIR/lcov-wpa_supplicant
-
-    echo "Generating code coverage report for hostapd"
-    cd /tmp/logs/alt-hostapd/hostapd
-    lcov -c -d .. > lcov.info 2> lcov.log
-    genhtml -t "hostapd hwsim test run $DATE" lcov.info --output-directory $LOGDIR/lcov-hostapd >> lcov.log 2>&1
-    mv lcov.info lcov.log $LOGDIR/lcov-hostapd
-
-    echo "Generating code coverage report for hostapd (AS)"
-    cd /tmp/logs/alt-hostapd-as/hostapd
-    lcov -c -d .. > lcov.info 2> lcov.log
-    genhtml -t "hostapd (AS) hwsim test run $DATE" lcov.info --output-directory $LOGDIR/lcov-hostapd-as >> lcov.log 2>&1
-    mv lcov.info lcov.log $LOGDIR/lcov-hostapd-as
-
-    echo "Generating code coverage report for hlr_auc_gw"
-    cd /tmp/logs/alt-hlr_auc_gw/hostapd
-    lcov -c -d .. > lcov.info 2> lcov.log
-    genhtml -t "hlr_auc_gw hwsim test run $DATE" lcov.info --output-directory $LOGDIR/lcov-hlr_auc_gw >> lcov.log 2>&1
-    mv lcov.info lcov.log $LOGDIR/lcov-hlr_auc_gw
-
-    echo "Generating combined code coverage report"
-    mkdir $LOGDIR/lcov-combined
-    for i in wpa_supplicant hostapd hostapd-as hlr_auc_gw; do
-       sed s%SF:/tmp/logs/alt-[^/]*/%SF:/tmp/logs/alt-wpa_supplicant/% < $LOGDIR/lcov-$i/lcov.info > $LOGDIR/lcov-combined/$i.info
-    done
-    cd $LOGDIR/lcov-combined
-    lcov -a wpa_supplicant.info -a hostapd.info -a hostapd-as.info -a hlr_auc_gw.info -o combined.info > lcov.log 2>&1
-    genhtml -t "wpa_supplicant/hostapd combined for hwsim test run $DATE" combined.info --output-directory . >> lcov.log 2>&1
-
-    cd $DIR
-    rm -r /tmp/logs/alt-wpa_supplicant
-    rm -r /tmp/logs/alt-hostapd
-    rm -r /tmp/logs/alt-hostapd-as
-    rm -r /tmp/logs/alt-hlr_auc_gw
-    rmdir /tmp/logs
+    echo "Preparing code coverage reports"
+    ./process-codecov.sh $LOGDIR "" restore
+    ./combine-codecov.sh $LOGDIR lcov
 fi
 
 echo
 echo "Test run completed"
 echo "Logfiles are at $LOGDIR"
 if [ $CODECOV = "yes" ]; then
-    echo "Code coverage reports:"
-    echo "wpa_supplicant: file://$LOGDIR/lcov-wpa_supplicant/index.html"
-    echo "hostapd: file://$LOGDIR/lcov-hostapd/index.html"
-    echo "hostapd (AS): file://$LOGDIR/lcov-hostapd-as/index.html"
-    echo "hlr_auc_gw: file://$LOGDIR/lcov-hlr_auc_gw/index.html"
-    echo "combined: file://$LOGDIR/lcov-combined/index.html"
+    echo "Code coverage report:"
+    echo "file://$LOGDIR/lcov/index.html"
 fi