Commit f69a2f43 authored by Claudio André's avatar Claudio André

CI: run an extra check on installed shell script tests

parent 2379e742
......@@ -85,6 +85,12 @@ stages:
fi
'
# Run the script tests again (to assure they are working)
- 'if [[ -n "${SCRIPTCHECK}" ]]; then
$(pwd)/test/test-ci.sh SH_CHECKS;
fi
'
# Done
- *CI_footer
......@@ -154,6 +160,7 @@ with_logging:
CC: clang
BUILD_OPTS: CPPFLAGS='-DGJS_VERBOSE_ENABLE_PROPS=1 -DGJS_VERBOSE_ENABLE_MARSHAL=1 -DGJS_VERBOSE_ENABLE_LIFECYCLE=1 -DGJS_VERBOSE_ENABLE_GI_USAGE=1 -DGJS_VERBOSE_ENABLE_CLOSURE=1 -DGJS_VERBOSE_ENABLE_GSIGNAL=1'
TEST: "check"
SCRIPTCHECK: "yes"
except:
- schedules
......@@ -165,6 +172,7 @@ no_graphics:
TASK_ID: "fedora-x86_64-gcc-default-without_gtk-check"
TEST: "check"
BUILD_OPTS: "--without-cairo --without-gtk"
SCRIPTCHECK: "yes"
except:
- schedules
......
#!/bin/sh
if test "$GJS_USE_UNINSTALLED_FILES" = "1"; then
gjs="$LOG_COMPILER $LOG_FLAGS $TOP_BUILDDIR/gjs-console"
else
gjs="$LOG_COMPILER $LOG_FLAGS gjs-console"
fi
# Avoid interference in the profiler tests from stray environment variable
unset GJS_ENABLE_PROFILER
total=0
report () {
exit_code=$?
total=$((total + 1))
if test $exit_code -eq 0; then
echo "ok $total - $1"
else
echo "not ok $total - $1 [EXIT CODE: $exit_code]"
fi
}
report_timeout () {
exit_code=$?
total=$((total + 1))
if test $exit_code -eq 0 -o $exit_code -eq 124; then
echo "ok $total - $1"
else
echo "not ok $total - $1 [EXIT CODE: $exit_code]"
fi
}
report_xfail () {
exit_code=$?
total=$((total + 1))
if test $exit_code -ne 0; then
echo "ok $total - $1"
else
echo "not ok $total - $1"
fi
}
skip () {
total=$((total + 1))
echo "ok $total - $1 # SKIP $2"
}
#!/bin/sh
if test "$GJS_USE_UNINSTALLED_FILES" = "1"; then
gjs="$LOG_COMPILER $LOG_FLAGS $TOP_BUILDDIR/gjs-console"
else
gjs="$LOG_COMPILER $LOG_FLAGS gjs-console"
fi
# Avoid interference in the profiler tests from stray environment variable
unset GJS_ENABLE_PROFILER
total=0
report () {
exit_code=$?
total=$((total + 1))
if test $exit_code -eq 0; then
echo "ok $total - $1"
else
echo "not ok $total - $1"
fi
}
report_xfail () {
exit_code=$?
total=$((total + 1))
if test $exit_code -ne 0; then
echo "ok $total - $1"
else
echo "not ok $total - $1"
fi
}
skip () {
total=$((total + 1))
echo "ok $total - $1 # SKIP $2"
}
DIR="$( cd "$( dirname "${0}" )" && pwd )"
source "${DIR}"/common.sh
# Run the examples
$gjs examples/gio-cat.js Makefile
report "run the gio-cat.js example"
if [[ -n "${ENABLE_GTK}" ]]; then
timeout 5s $gjs examples/calc.js
report_timeout "run the calc.js example"
timeout 5s $gjs examples/gtk.js
report_timeout "run the gtk.js example"
timeout 5s $gjs examples/gtk-application.js
report_timeout "run the gtk-application.js example"
timeout 5s $gjs examples/gettext.js
report_timeout "run the gettext.js example"
else
skip "run the calc.js example" "running without GTK"
skip "run the gtk.js example" "running without GTK"
skip "run the gtk-application.js example" "running without GTK"
skip "run the gettext.js example" "running without GTK"
fi
echo "1..$total"
......@@ -2,8 +2,6 @@
function do_Set_Env(){
do_Print_Labels 'Set Environment '
#Save cache on $pwd (required by artifacts)
mkdir -p "$(pwd)"/.cache
XDG_CACHE_HOME="$(pwd)"/.cache
......@@ -23,8 +21,6 @@ function do_Set_Env(){
if [[ -z "${DISPLAY}" ]]; then
export DISPLAY=":0"
fi
do_Print_Labels
}
function do_Get_Upstream_Master(){
......@@ -60,7 +56,7 @@ function do_Compare_With_Upstream_Master(){
echo '-----------------------------------------'
diff -u0 /cwd/master-report.txt /cwd/current-report.txt || true
echo '-----------------------------------------'
exit 3
exit 1
else
echo "$REMOVED_WARNINGS warning(s) were fixed."
echo "=> $1 Ok"
......@@ -107,7 +103,20 @@ function do_Check_Warnings(){
echo '-----------------------------------------'
cat warnings.log || true
echo '-----------------------------------------'
exit 4
exit 1
fi
}
function do_Check_Script_Errors(){
local total=0
total=$(cat scripts.log | grep 'not ok ' | awk '{total+=1}END{print total}')
if [[ $total > 0 ]]; then
echo '-----------------------------------------'
echo "### Found $total errors on scripts.log ###"
echo '-----------------------------------------'
exit 1
fi
}
......@@ -196,6 +205,20 @@ elif [[ $1 == "VALGRIND" ]]; then
make check-valgrind
elif [[ $1 == "SH_CHECKS" ]]; then
# It doesn't (re)build, just run the 'Tests'
do_Print_Labels 'Shell Scripts Check'
do_Set_Env
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export LANGUAGE=C.UTF-8
installed-tests/scripts/testCommandLine.sh > scripts.log
installed-tests/scripts/testExamples.sh >> scripts.log
installed-tests/scripts/testWarnings.sh >> scripts.log
do_Check_Script_Errors
elif [[ $1 == "GJS_COVERAGE" ]]; then
# It doesn't (re)build, just run the 'Coverage Tests'
do_Print_Labels 'Code Coverage Report'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment