[gjs: 2/3] CI: Treat warnings as errors



commit e82fa7079f10c2e9f0e209d296f67e2cb34abd06
Author: Philip Chimento <philip chimento gmail com>
Date:   Sat Nov 23 16:39:52 2019 -0800

    CI: Treat warnings as errors
    
    Our codebase compiles cleanly with no more warnings, so we can now treat
    any newly appearing warnings as errors.
    
    Closes: #286

 .gitlab-ci.yml  |  2 --
 test/test-ci.sh | 34 +++-------------------------------
 2 files changed, 3 insertions(+), 33 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6efc8325..dd3a24bc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -71,7 +71,6 @@ stages:
     paths:
       - _build/compile_commands.json
       - _build/meson-logs/*log.txt
-      - compilation.log
       - scripts.log
   script:
     - test/test-ci.sh SETUP
@@ -88,7 +87,6 @@ build_recommended:
   image: registry.gitlab.gnome.org/gnome/gjs:job-443296_fedora.mozjs60-debug  # pinned on purpose
   variables:
     TASK_ID: "fedora-x86_64-gcc-debug-default-check"
-    WARNINGS: "count"
   except:
     - schedules
 
diff --git a/test/test-ci.sh b/test/test-ci.sh
index 92a2af4c..864393e2 100755
--- a/test/test-ci.sh
+++ b/test/test-ci.sh
@@ -70,28 +70,6 @@ do_Create_Artifacts_Folder () {
     mkdir -p "$save_dir"/analysis; touch "$save_dir"/analysis/doing-"$1"
 }
 
-do_Check_Warnings () {
-    local total=0
-    cat compilation.log | grep "warning:" | awk '{total+=1}END{print "Total number of warnings: "total}'
-
-    # Discard warnings related to upstream dependencies.
-    cat compilation.log | grep "warning:" | \
-            awk "! /installed-tests\/gimarshallingtests/" | \
-            awk "! /installed-tests\/regress.c/" > \
-            warnings.log
-
-    total=$(awk '{total+=1}END{print total}' warnings.log)
-
-    if test "$total" -gt 0; then
-        echo '-----------------------------------------'
-        echo "### $total new warning(s) found by compiler ###"
-        echo '-----------------------------------------'
-        cat warnings.log || true
-        echo '-----------------------------------------'
-        exit 1
-    fi
-}
-
 do_Check_Script_Errors () {
     local total=0
     total=$(cat scripts.log | grep 'not ok ' | awk '{total+=1}END{print total}')
@@ -144,7 +122,7 @@ elif test "$1" = "GJS"; then
     echo "Autogen options: $ci_autogenargs"
     eval ./autogen.sh "$ci_autogenargs"
 
-    make -sj 2>&1 | tee compilation.log
+    make -sj 2>&1
 
     if test "$TEST" = "distcheck"; then
         xvfb-run -a make -s distcheck
@@ -156,16 +134,10 @@ elif test "$1" = "BUILD"; then
     do_Set_Env
 
     DEFAULT_CONFIG_OPTS="-Dcairo=enabled -Dreadline=enabled -Dprofiler=enabled \
-        -Ddtrace=false -Dsystemtap=false -Dverbose_logs=false"
-    meson _build $DEFAULT_CONFIG_OPTS $CONFIG_OPTS | tee compilation.log
+        -Ddtrace=false -Dsystemtap=false -Dverbose_logs=false --werror"
+    meson _build $DEFAULT_CONFIG_OPTS $CONFIG_OPTS
     ninja -C _build
 
-    if test "$WARNINGS" = "count"; then
-        do_Print_Labels 'Warnings Report '
-        do_Check_Warnings
-        do_Print_Labels
-    fi
-
     if test "$TEST" != "skip"; then
         xvfb-run -a meson test -C _build $TEST_OPTS \
             --verbose --no-stdsplit --print-errorlogs


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