[PATCH] selftests: intel_pstate: compile programs if executable not found

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Naresh Kamboju <naresh.kamboju@xxxxxxxxxx>

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 <naresh.kamboju@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux