From patchwork Fri Jun 15 16:31:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 10466907 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D829960384 for ; Fri, 15 Jun 2018 16:31:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA3D52850F for ; Fri, 15 Jun 2018 16:31:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF17A28DA3; Fri, 15 Jun 2018 16:31:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D8D12850F for ; Fri, 15 Jun 2018 16:31:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966032AbeFOQbu (ORCPT ); Fri, 15 Jun 2018 12:31:50 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:53405 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965969AbeFOQbo (ORCPT ); Fri, 15 Jun 2018 12:31:44 -0400 Received: by mail-wm0-f65.google.com with SMTP id x6-v6so4445523wmc.3 for ; Fri, 15 Jun 2018 09:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=8+NFpaWlGMgMy77FUSVNUv+KauFJQgCy4c/6TOZD3Ck=; b=GPiohyFOZ9G+ICKLcZz/P3ZvIM5m4mNWSkaEohFDdEsVC3Ih1oBHnWl4bin/EsbLpy z5vKYzBb0rbMdjg0KDM8SUpLCFUMzQqFjsDy8qtfgXBwTto5gospcoTB6U9NF4WeSG/t FE2hgT/hzmsvJ/8vH9yGDJMzNNxBRjnz/jKlEciNE+90BYJkVEKOQVteu510qY5F2gUc i8X4VM6cGyZE0Y/y7dHmd0miTFw437ZsSuFBQxLK7wF9sgWeBERidyHUB2hfaWKd4bIA 7NF8lf/4ncBnDLrPF/setGIu/d48gURIzLRfdOTGMGmCO6Ip0U3SQrWN/S1lA7hdImsO TESA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8+NFpaWlGMgMy77FUSVNUv+KauFJQgCy4c/6TOZD3Ck=; b=YLR21SM1dasZfV35si8g6AkOxnyU3PdJFynmNz8H9gdrECQy2zlt27Lc65/wJh4jrg zdphxZbU0yQKoCDsitwmG+h/KRnKJAAg2fqcG2vXmttjAItFme2y7k+5bZJeC5qLbQvf JcCRWtAQ1PoD6KpMQinSXVcSRJ+5vxGXRGL2jcz1y1D/8t/OSKeHOGWKUbccQ/Om6X1w 60jxF6mFrFgXk4zgh7BdgSw+9SelGk3I2QJAeJ/SukKpz8a/RrPGppI1T8vnPubB0jNK HDE/bJsAnjqOGSLwEbi6DRhhQMKTGS73f2+EaYRJh32Yy1kDMwgAeCrJE1GQlaUx496Q piKg== X-Gm-Message-State: APt69E1HAEZpABG4IhI/w8eloXOLicFGXthVGYl31PvEPuQq7kqLZIRm 0r562OxnmvHZ6e326jLi20QovDy2 X-Google-Smtp-Source: ADUXVKJpx4j1qqRZi5ZuqJls9CwX0WiDmx9sM0ANyTOVaaFCC0WNhZM02twX381tooKxot/FPbnmuA== X-Received: by 2002:a50:d1c1:: with SMTP id i1-v6mr2469610edg.122.1529080303439; Fri, 15 Jun 2018 09:31:43 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:40a0:d000:8193:11bd:828e:bb98]) by smtp.gmail.com with ESMTPSA id m12-v6sm5485956edd.86.2018.06.15.09.31.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 09:31:43 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH] testsuite: handle busybox's timeout Date: Fri, 15 Jun 2018 18:31:39 +0200 Message-Id: <20180615163139.44159-1-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The busybox version of timeout(1) requires that the duration is given via a '-t' option. However, the GNU coreutils' version has no such option and simply take the duration as its first argument. Fix the test-suite script to detect which version is used and pass the duration accordingly. Signed-off-by: Luc Van Oostenryck --- validation/test-suite | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/validation/test-suite b/validation/test-suite index e1ab1e657..e5939cdde 100755 --- a/validation/test-suite +++ b/validation/test-suite @@ -9,6 +9,7 @@ default_cmd="sparse \$file" default_args="$SPARSE_TEST_ARGS" tests_list="" prog_name=`basename $0` +timeout_args="" if [ ! -x "$default_path/sparse-llvm" ]; then disabled_cmds="sparsec sparsei sparse-llvm sparse-llvm-dis" @@ -341,7 +342,14 @@ do_test() # do we want a timeout? pre_cmd="" if [ $check_timeout -ne 0 ]; then - pre_cmd="timeout -k 1s $check_timeout" + if [ -z "$timeout_args" ]; then + if timeout --version 2>&1 | grep -q BusyBox; then + timeout_args="-t" + else + timeout_args="-k 1s" + fi + fi + pre_cmd="timeout $timeout_args $check_timeout" fi shift