aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-01-09 15:34:47 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2015-01-09 15:38:45 +0530
commit0d525fc060e9ff3b053d48ae970df2fc01d12325 (patch)
tree88a8aef5d28900bf8e389f0854a1a82c15a2b8d1
parent0ffa7e0aade150bb9911b13f7fccda172da24498 (diff)
protect against multiple inclusion of scripts
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
-rwxr-xr-xcpu.sh7
-rwxr-xr-xcpufreq.sh7
-rwxr-xr-xgovernor.sh7
-rwxr-xr-xrunme.sh7
-rwxr-xr-xspecial-tests.sh7
5 files changed, 35 insertions, 0 deletions
diff --git a/cpu.sh b/cpu.sh
index b5b0620..ad8ed48 100755
--- a/cpu.sh
+++ b/cpu.sh
@@ -2,6 +2,13 @@
#
# CPU helpers
+# protect against multiple inclusion
+if [ $FILE_CPU ]; then
+ return 0
+else
+ FILE_CPU=DONE
+fi
+
source cpufreq.sh
offline_cpu()
diff --git a/cpufreq.sh b/cpufreq.sh
index 2bb3f4e..e89e317 100755
--- a/cpufreq.sh
+++ b/cpufreq.sh
@@ -1,5 +1,12 @@
#!/bin/bash
+# protect against multiple inclusion
+if [ $FILE_CPUFREQ ]; then
+ return 0
+else
+ FILE_CPUFREQ=DONE
+fi
+
source cpu.sh
# GLOBALS
diff --git a/governor.sh b/governor.sh
index 1c56426..a82a6d5 100755
--- a/governor.sh
+++ b/governor.sh
@@ -2,6 +2,13 @@
#
# Test governors
+# protect against multiple inclusion
+if [ $FILE_GOVERNOR ]; then
+ return 0
+else
+ FILE_GOVERNOR=DONE
+fi
+
source cpu.sh
source cpufreq.sh
diff --git a/runme.sh b/runme.sh
index b4889a6..accad17 100755
--- a/runme.sh
+++ b/runme.sh
@@ -3,6 +3,13 @@
# parameters:
# - $1: Name of the output file with all the logs, dump.txt by default.
+# protect against multiple inclusion
+if [ $FILE_RUNME ]; then
+ return 0
+else
+ FILE_RUNME=DONE
+fi
+
source cpu.sh
source governor.sh
source special-tests.sh
diff --git a/special-tests.sh b/special-tests.sh
index b29f644..292e3d8 100755
--- a/special-tests.sh
+++ b/special-tests.sh
@@ -4,6 +4,13 @@
# Testcase 1: Reported here: http://marc.info/?l=linux-pm&m=140618592709858&w=2
+# protect against multiple inclusion
+if [ $FILE_SPECIAL ]; then
+ return 0
+else
+ FILE_SPECIAL=DONE
+fi
+
source cpu.sh
source cpufreq.sh
source governor.sh