Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752184AbdINKvV (ORCPT ); Thu, 14 Sep 2017 06:51:21 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:55140 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751500AbdINKvR (ORCPT ); Thu, 14 Sep 2017 06:51:17 -0400 X-Google-Smtp-Source: ADKCNb4VH8zF/AtQxRG2vbwSByKkr8lOa0Bm9Dd+Wj20+zASYHwN4r3gGw/YB4uAXH6KFcU+xRIYBA== From: naresh.kamboju@linaro.org To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org, prarit@redhat.com Cc: linux-kernel@vger.kernel.org, sumit.semwal@linaro.org, milosz.wasilewski@linaro.org Subject: [PATCH] selftests: intel_pstate: compile programs if executable not found Date: Thu, 14 Sep 2017 16:21:09 +0530 Message-Id: <1505386269-15774-1-git-send-email-naresh.kamboju@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1305 Lines: 43 From: Naresh Kamboju Test exit due to aperf.c: No such file or directory ./run.sh gcc: error: aperf.c: No such file or directory Problem compiling aperf.c. The Makefile installs executable programs "aperf" and "msr" so skip compile on target. Signed-off-by: Naresh Kamboju --- tools/testing/selftests/intel_pstate/run.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh index 7868c106b8b1..2149b9b5876a 100755 --- a/tools/testing/selftests/intel_pstate/run.sh +++ b/tools/testing/selftests/intel_pstate/run.sh @@ -31,11 +31,16 @@ EVALUATE_ONLY=0 max_cpus=$(($(nproc)-1)) -# compile programs -gcc aperf.c -Wall -D_GNU_SOURCE -o aperf -lm -[ $? -ne 0 ] && echo "Problem compiling aperf.c." && exit 1 -gcc -o msr msr.c -lm -[ $? -ne 0 ] && echo "Problem compiling msr.c." && exit 1 +# Compile programs if executable not found +if [ ! -x aperf ]; then + gcc aperf.c -Wall -D_GNU_SOURCE -o aperf -lm + [ $? -ne 0 ] && echo "Problem compiling aperf.c." && exit 1 +fi + +if [ ! -x msr ]; then + gcc -o msr msr.c -lm + [ $? -ne 0 ] && echo "Problem compiling msr.c." && exit 1 +fi function run_test () { -- 2.13.0