summaryrefslogtreecommitdiff
path: root/tools/ci/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ci/scripts')
-rwxr-xr-xtools/ci/scripts/init.sh14
-rwxr-xr-xtools/ci/scripts/runtest.sh9
-rwxr-xr-xtools/ci/scripts/updaterepos.sh5
3 files changed, 9 insertions, 19 deletions
diff --git a/tools/ci/scripts/init.sh b/tools/ci/scripts/init.sh
index 656a4d765..9512e9b66 100755
--- a/tools/ci/scripts/init.sh
+++ b/tools/ci/scripts/init.sh
@@ -41,10 +41,8 @@ function update_repos {
echo "Running from shell. Skipping update repos"
return
fi
- export DATA=$(cat /etc/resolv.conf|grep "nameserver 1.10.100.101")
- echo "${DATA}"
- if [ "$DATA" != "" ];
- then
+
+ if grep "nameserver 1.10.100.101" /etc/resolv.conf; then
echo "Detected local runner"
sed -i 's!http://httpredir.debian.org/debian!http://1.10.100.103/debian!' /etc/apt/sources.list
sed -i 's!http://deb.debian.org/debian!http://1.10.100.103/debian!' /etc/apt/sources.list
@@ -206,9 +204,7 @@ function run_gcov {
}
function run_check_warnings {
- DATA=$(cat $ERRFILE)
- if [ "$DATA" != "" ];
- then
+ if [[ -s "$ERRFILE" ]]; then
cat $ERRFILE
exit 1
fi
@@ -218,9 +214,7 @@ function run_h {
rm $ERRFILE
echo "$CC -c -x c++ $* $includes */*/*/*/*.h */*/*/*.h */*/*.h */*.h *.h"
$CC -c -x c++ $* $includes */*/*/*/*.h */*/*/*.h */*/*.h */*.h *.h 2>$ERRFILE
- DATA=$(cat $ERRFILE)
- if [ "$DATA" != "" ];
- then
+ if [[ -s "$ERRFILE" ]]; then
cat $ERRFILE
exit 1
fi
diff --git a/tools/ci/scripts/runtest.sh b/tools/ci/scripts/runtest.sh
index 7707a34aa..4b0320fed 100755
--- a/tools/ci/scripts/runtest.sh
+++ b/tools/ci/scripts/runtest.sh
@@ -74,18 +74,15 @@ function kill_app {
}
function final_log {
- export DATA=$(cat logs/run.log)
- if [[ -z "${DATA}" ]]; then
+ if [[ ! -s logs/run.log ]]; then
echo "Error: no output"
exit 1
fi
cat logs/run.log
- export DATA=$(grep "[.]cpp" logs/run.log)
- if [[ -n "${DATA}" ]]; then
- echo "Error: possible leak detected"
- echo "${DATA}"
+ if grep "[.]cpp" logs/run.log; then
+ echo "Error: possible leak detected, see above"
exit 1
fi
}
diff --git a/tools/ci/scripts/updaterepos.sh b/tools/ci/scripts/updaterepos.sh
index 167898a83..8ac6d6c44 100755
--- a/tools/ci/scripts/updaterepos.sh
+++ b/tools/ci/scripts/updaterepos.sh
@@ -4,9 +4,8 @@ if [[ "$RUNFROMSHELL" != "" ]]; then
echo "Running from shell. Skipping update repos"
exit 0
fi
-export DATA=$(cat /etc/resolv.conf|grep "nameserver 1.10.100.101")
-echo "${DATA}"
-if [ "$DATA" != "" ]; then
+
+if grep "nameserver 1.10.100.101" /etc/resolv.conf; then
echo "Detected local runner"
sed -i 's!http://httpredir.debian.org/debian!http://1.10.100.103/debian!' /etc/apt/sources.list || true
sed -i 's!http://deb.debian.org/debian!http://1.10.100.103/debian!' /etc/apt/sources.list || true