From patchwork Sun Oct 26 07:06:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilan Peer X-Patchwork-Id: 403153 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) by ozlabs.org (Postfix) with ESMTP id DF9E6140082 for ; Mon, 27 Oct 2014 00:06:23 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 2F50917C872; Sun, 26 Oct 2014 09:05:44 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vOKcanWTcVUf; Sun, 26 Oct 2014 09:05:43 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 8426017C867; Sun, 26 Oct 2014 09:04:53 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 3D18417C84B for ; Sun, 26 Oct 2014 09:04:52 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qSxNawWWQr8C for ; Sun, 26 Oct 2014 09:04:47 -0400 (EDT) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id EBFD217C84C for ; Sun, 26 Oct 2014 09:04:31 -0400 (EDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 26 Oct 2014 06:02:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,790,1406617200"; d="scan'208";a="596443189" Received: from unknown (HELO ipeer-e6430-3.jer.intel.com) ([10.12.217.164]) by orsmga001.jf.intel.com with ESMTP; 26 Oct 2014 06:04:30 -0700 From: Ilan Peer To: hostap@lists.shmoo.com Subject: [PATCH 5/8] tests: Add option to build before running all tests Date: Sun, 26 Oct 2014 03:06:32 -0400 Message-Id: <1414307195-14700-6-git-send-email-ilan.peer@intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1414307195-14700-1-git-send-email-ilan.peer@intel.com> References: <1414307195-14700-1-git-send-email-ilan.peer@intel.com> X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Add an option to run-all.sh to build before starting to run all the tests. In addition add an option to extract the code coverage data at the end of the run. Signed-off-by: Ilan Peer --- tests/hwsim/run-all.sh | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/run-all.sh b/tests/hwsim/run-all.sh index e99d796..51772d9 100755 --- a/tests/hwsim/run-all.sh +++ b/tests/hwsim/run-all.sh @@ -27,6 +27,9 @@ fi unset VALGRIND unset TRACE unset TRACE_ARGS +unset BUILD +unset BUILD_ARGS +unset CODECOV while [ "$1" != "" ]; do case $1 in -v | --valgrind ) shift @@ -42,13 +45,26 @@ while [ "$1" != "" ]; do shift echo "$0: using channels=$NUM_CH" ;; + -b | --build ) shift + echo "$0: build before running tests" + BUILD=build + ;; + -c | --codecov ) shift + echo "$0: using code coverage" + CODECOV=lcov + BUILD_ARGS=-c + ;; * ) exit 1 esac done unset SUFFIX +if [ ! -z "$BUILD" ]; then + SUFFIX=-build +fi + if [ ! -z "$VALGRIND" ]; then - SUFFIX=-valgrind + SUFFIX=$SUFFIX-valgrind fi if [ ! -z "$TRACE" ]; then @@ -56,6 +72,18 @@ if [ ! -z "$TRACE" ]; then TRACE_ARGS="-T" fi +if [ ! -z "$CODECOV" ]; then + SUFFIX=$SUFFIX-codecov +fi + +if [ ! -z "$BUILD" ]; then + echo "Building with args=$BUILD_ARGS" + if ! ./build.sh $BUILD_ARGS; then + echo "Failed building components" + exit 1 + fi +fi + if ! ./start.sh $VALGRIND $TRACE $NUM_CH; then if ! [ -z "$LOGBASEDIR" ] ; then echo "Could not start test environment" > $LOGDIR/run @@ -74,6 +102,14 @@ if [ ! -z "$VALGRIND" ] ; then errors=1 fi fi + +if [ ! -z "$CODECOV" ] ; then + lcov -q --capture --directory ../../wpa_supplicant --output-file $LOGDIR/wpas_lcov.info + genhtml -q $LOGDIR/wpas_lcov.info --output-directory $LOGDIR/wpas_lcov + lcov -q --capture --directory ../../hostapd --output-file $LOGDIR/hostapd_lcov.info + genhtml -q $LOGDIR/hostapd_lcov.info --output-directory $LOGDIR/hostapd_lcov +fi + if [ $errors -gt 0 ]; then tar czf /tmp/hwsim-tests-$DATE-FAILED$SUFFIX.tar.gz $LOGDIR/ exit 1