[vala/staging] testrunner: Filter external -0X flags to preserve current default -O0



commit 81a866d8fc462412ffab263ae3cfef8f0a3387fa
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Sep 27 23:45:27 2020 +0200

    testrunner: Filter external -0X flags to preserve current default -O0

 tests/testrunner.sh         | 4 +++-
 valadoc/tests/testrunner.sh | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/tests/testrunner.sh b/tests/testrunner.sh
index 7f38a4306..ac5ffe1ad 100755
--- a/tests/testrunner.sh
+++ b/tests/testrunner.sh
@@ -50,7 +50,9 @@ done
 # Incorporate the user's CFLAGS. Matters if the user decided to insert
 # -m32 in CFLAGS, for example.
 for cflag in ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
-    VALAFLAGS="${VALAFLAGS} -X ${cflag}"
+       if [[ ! $cflag =~ ^\-O[0-9]$ ]]; then
+               VALAFLAGS="${VALAFLAGS} -X ${cflag}"
+       fi
 done
 
 function testheader() {
diff --git a/valadoc/tests/testrunner.sh b/valadoc/tests/testrunner.sh
index de45e4519..c06dda358 100755
--- a/valadoc/tests/testrunner.sh
+++ b/valadoc/tests/testrunner.sh
@@ -58,7 +58,9 @@ done
 # Incorporate the user's CFLAGS. Matters if the user decided to insert
 # -m32 in CFLAGS, for example.
 for cflag in ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
-    VALAFLAGS="${VALAFLAGS} -X ${cflag}"
+       if [[ ! $cflag =~ ^\-O[0-9]$ ]]; then
+               VALAFLAGS="${VALAFLAGS} -X ${cflag}"
+       fi
 done
 
 testdir=_test


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