summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/ci-images.sh7
-rw-r--r--test/extra/Dockerfile.arm64v8.fedora.2911
-rw-r--r--test/extra/Dockerfile.fedora.static-analysis4
-rw-r--r--test/extra/Dockerfile.ppc64le.fedora.2911
-rwxr-xr-xtest/extra/do_basic.sh79
-rwxr-xr-xtest/extra/do_docker.sh20
-rwxr-xr-xtest/extra/do_environment.sh90
-rwxr-xr-xtest/extra/do_mozilla.sh39
-rw-r--r--test/gjs-test-coverage.cpp3
-rw-r--r--test/org.gnome.GjsDevel.json52
-rwxr-xr-xtest/test-ci.sh175
11 files changed, 85 insertions, 406 deletions
diff --git a/test/ci-images.sh b/test/ci-images.sh
index 6c685e8a..a60dc8c2 100755
--- a/test/ci-images.sh
+++ b/test/ci-images.sh
@@ -8,7 +8,6 @@ function do_Set_Env(){
mkdir -p /on-host/.cache
export XDG_CACHE_HOME=/on-host/.cache
- export JHBUILD_RUN_AS_ROOT=1
export SHELL=/bin/bash
PATH=$PATH:~/.local/bin
@@ -26,15 +25,15 @@ if [[ -n "${BUILD_OPTS}" ]]; then
extra_opts="($BUILD_OPTS)"
fi
-if [[ -n "${STATIC}" ]]; then
- extra_opts="$extra_opts ($STATIC)"
+if [[ -n "${MOZJS_BRANCH}" ]]; then
+ extra_opts="$extra_opts ($MOZJS_BRANCH)"
fi
source test/extra/do_environment.sh
# Show some environment info
do_Print_Labels 'ENVIRONMENT'
-echo "Running on: $BASE $OS"
+echo "Running on: $OS"
echo "Doing: $1 $extra_opts"
source test/extra/do_basic.sh
diff --git a/test/extra/Dockerfile.arm64v8.fedora.29 b/test/extra/Dockerfile.arm64v8.fedora.29
deleted file mode 100644
index 92a6b03e..00000000
--- a/test/extra/Dockerfile.arm64v8.fedora.29
+++ /dev/null
@@ -1,11 +0,0 @@
-FROM arm64v8/fedora:rawhide
-MAINTAINER Claudio André (c) 2018 V1.0
-
-LABEL architecture="aarch64"
-LABEL version="1.0"
-LABEL description="Multiarch docker image to run CI for GNOME GJS."
-
-ADD x86_64_qemu-aarch64-static.tar.gz /usr/bin
-
-CMD ["/bin/bash"]
-
diff --git a/test/extra/Dockerfile.fedora.static-analysis b/test/extra/Dockerfile.fedora.static-analysis
index 70f62115..05b3d60a 100644
--- a/test/extra/Dockerfile.fedora.static-analysis
+++ b/test/extra/Dockerfile.fedora.static-analysis
@@ -6,11 +6,9 @@ LABEL version="1.0"
LABEL description="Docker image to run CI for GNOME GJS (JavaScript bindings for GNOME)."
RUN dnf -y --nogpgcheck upgrade && \
- dnf -y install \
- git cppcheck tokei nodejs python-devel && \
+ dnf -y install git python-devel && \
mkdir -p /cwd && \
pip install cpplint && \
- npm install -g eslint && \
dnf -y clean all && \
rm -rf /var/cache/dnf
diff --git a/test/extra/Dockerfile.ppc64le.fedora.29 b/test/extra/Dockerfile.ppc64le.fedora.29
deleted file mode 100644
index 400d81c3..00000000
--- a/test/extra/Dockerfile.ppc64le.fedora.29
+++ /dev/null
@@ -1,11 +0,0 @@
-FROM ppc64le/fedora:rawhide
-MAINTAINER Claudio André (c) 2018 V1.0
-
-LABEL architecture="ppc64le"
-LABEL version="1.0"
-LABEL description="Multiarch docker image to run CI for GNOME GJS."
-
-ADD x86_64_qemu-ppc64le-static.tar.gz /usr/bin
-
-CMD ["/bin/bash"]
-
diff --git a/test/extra/do_basic.sh b/test/extra/do_basic.sh
index aa7a6bf2..65b74160 100755
--- a/test/extra/do_basic.sh
+++ b/test/extra/do_basic.sh
@@ -4,65 +4,22 @@ function do_Install_Dependencies(){
echo
echo '-- Installing Base Dependencies --'
- if [[ $BASE == "debian" ]]; then
- apt-get update
-
- # Base dependencies
- apt-get -y install build-essential git clang patch bison flex \
- meson ninja-build python-dev python3-dev \
- autotools-dev autoconf gettext pkgconf autopoint yelp-tools \
- docbook docbook-xsl libtext-csv-perl \
- zlib1g-dev libdbus-glib-1-dev \
- libtool libicu-dev libnspr4-dev \
- policykit-1 python3-setuptools \
- libgtk-3-dev gir1.2-gtk-3.0 xvfb gnome-desktop-testing dbus-x11 dbus \
- libedit-dev libgl1-mesa-dev lcov libreadline-dev
-
- elif [[ $BASE == "fedora" ]]; then
- if [[ $STATIC == *"qemu"* ]]; then
- dnf -y --nogpgcheck upgrade --best --allowerasing
- else
- dnf -y upgrade --best --allowerasing
- fi
-
- # Base dependencies
- dnf -y install @c-development @development-tools clang redhat-rpm-config gnome-common python-devel \
- pygobject2 dbus-python perl-Text-CSV perl-XML-Parser gettext-devel gtk-doc \
- meson ninja-build zlib-devel libffi-devel \
- libtool libicu-devel nspr-devel systemtap-sdt-devel \
- gtk3 gtk3-devel gobject-introspection Xvfb gnome-desktop-testing dbus-x11 \
- cairo intltool libxslt bison nspr python3-devel dbus-glib libicu \
- libxslt libtool flex \
- cairo-devel zlib-devel libffi-devel pcre-devel libxml2-devel libxslt-devel \
- libedit-devel libasan libubsan libtsan compiler-rt \
- sysprof-devel lcov mesa-libGL-devel readline-devel \
- webkit2gtk3
-
- if [[ $DEV == "devel" ]]; then
- dnf -y install time
- fi
- else
- echo
- echo '-- Error: invalid BASE code --'
- exit 1
- fi
-}
-
-function do_Install_Extras(){
- echo
- echo '-- Installing Extra Dependencies --'
-
- if [[ $BASE == "debian" ]]; then
- # Distros development versions of needed libraries
- apt-get -y install libgirepository1.0-dev libwebkit2gtk-4.0-dev notify-osd
-
- elif [[ $BASE == "fedora" ]]; then
- # Distros development versions of needed libraries
- dnf -y install gobject-introspection-devel
-
- if [[ $STATIC != *"qemu"* ]]; then
- # Distros debug info of needed libraries
- dnf -y debuginfo-install glib2-devel gobject-introspection-devel gtk3-devel expat fontconfig cairo glibc
- fi
- fi
+ dnf -y upgrade --best --allowerasing
+
+ # Base dependencies
+ dnf -y install @c-development @development-tools clang redhat-rpm-config gnome-common python-devel \
+ pygobject2 dbus-python perl-Text-CSV perl-XML-Parser gettext-devel gtk-doc \
+ autoconf-archive meson ninja-build zlib-devel libffi-devel \
+ libtool libicu-devel nspr-devel systemtap-sdt-devel \
+ gtk3 gtk3-devel gobject-introspection-devel Xvfb gnome-desktop-testing dbus-x11 \
+ cairo intltool libxslt bison nspr python3-devel dbus-glib libicu \
+ libxslt libtool flex \
+ cairo-devel zlib-devel libffi-devel pcre-devel libxml2-devel libxslt-devel \
+ libedit-devel libasan libubsan libtsan compiler-rt \
+ sysprof-devel lcov mesa-libGL-devel readline-devel \
+ webkit2gtk3 time
+
+ # Distros debug info of needed libraries
+ dnf -y debuginfo-install glib2-devel gobject-introspection-devel \
+ gtk3-devel expat fontconfig cairo glibc
}
diff --git a/test/extra/do_docker.sh b/test/extra/do_docker.sh
index 3930e3c9..b92c9899 100755
--- a/test/extra/do_docker.sh
+++ b/test/extra/do_docker.sh
@@ -6,14 +6,8 @@ function do_Shrink_Image(){
PATH=$PATH:~/.local/bin
rm -rf ~/jhbuild/install/lib/libjs_static.ajs
- if [[ $BASE == "ubuntu" ]]; then
- apt-get -y clean
- rm -rf /var/lib/apt/lists/*
-
- elif [[ $BASE == "fedora" ]]; then
- dnf -y clean all
- rm -rf /var/cache/dnf
- fi
+ dnf -y clean all
+ rm -rf /var/cache/dnf
echo '-- Done --'
}
@@ -21,18 +15,8 @@ function do_Shrink_Image(){
if [[ $1 == "BUILD_MOZ" ]]; then
do_Install_Dependencies
do_Set_Env
-
- if [[ $DEV == "devel" ]]; then
- do_Install_Extras
- fi
do_Show_Info
- do_Get_JHBuild
- do_Build_JHBuild
do_Build_Mozilla
-
- # Build JHBuild to create a docker image ready to go
- jhbuild build m4-common
-
do_Shrink_Image
fi
# Clear the environment
diff --git a/test/extra/do_environment.sh b/test/extra/do_environment.sh
index 957b6ff3..514d48ce 100755
--- a/test/extra/do_environment.sh
+++ b/test/extra/do_environment.sh
@@ -1,86 +1,20 @@
-#!/bin/bash -e
+#!/bin/sh -e
-function do_Get_JHBuild(){
- do_Print_Labels 'Download JHBuild'
+do_Configure_MainBuild () {
+ do_Print_Labels 'Set Main Build Configuration'
- if [[ -d /jhbuild ]]; then
- # For a clean build, update and rebuild jhbuild. And avoid git pull.
- rm -rf /jhbuild
- fi
- git clone --depth 1 https://github.com/GNOME/jhbuild.git /jhbuild
-
- # A patch is no longer required
- cd /jhbuild
-
- echo '-- Done --'
- cd -
-}
-
-function do_Configure_JHBuild(){
- do_Print_Labels 'Set JHBuild Configuration'
-
- mkdir -p ~/.config
-
- cat <<EOFILE > ~/.config/jhbuildrc
-skip = ['gettext', 'yelp-xsl', 'yelp-tools', 'gtk-doc']
-use_local_modulesets = True
-EOFILE
-
- echo '-- Done --'
-}
-
-function do_Configure_MainBuild(){
- do_Print_Labels 'Set Main JHBuild Configuration'
-
- mkdir -p ~/.config
autogenargs="--enable-compile-warnings=yes"
- if [[ -n "${BUILD_OPTS}" ]]; then
+ if test -n "$BUILD_OPTS"; then
autogenargs="$autogenargs $BUILD_OPTS"
fi
export ci_autogenargs="$autogenargs"
- cat <<EOFILE > ~/.config/jhbuildrc
-module_autogenargs['gjs'] = "$autogenargs"
-module_makeargs['gjs'] = '-s -j 1'
-skip = ['gettext', 'yelp-xsl', 'yelp-tools', 'gtk-doc']
-use_local_modulesets = True
-disable_Werror = False
-EOFILE
-
echo '-- Done --'
}
-function do_Build_Package_Dependencies(){
- do_Print_Labels "Building Dependencies for $1"
- jhbuild list "$1"
-
- # Build package dependencies
- jhbuild build $(jhbuild list "$1" | sed '$d')
-}
-
-function do_Build_JHBuild(){
- do_Print_Labels 'Building JHBuild'
-
- # Build JHBuild
- cd /jhbuild
- git log --pretty=format:"%h %cd %s" -1
- echo
- ./autogen.sh PYTHON=$(which python2)
- make -sj2
- make install
- PATH=$PATH:~/.local/bin
-
- if [[ $1 == "RESET" ]]; then
- git reset --hard HEAD
- fi
- echo '-- Done --'
- cd -
-}
-
-function do_Print_Labels(){
-
- if [[ -n "${1}" ]]; then
+do_Print_Labels () {
+ if test -n "$1"; then
label_len=${#1}
span=$(((54 - $label_len) / 2))
@@ -94,15 +28,13 @@ function do_Print_Labels(){
fi
}
-function do_Done(){
-
+do_Done () {
# Done. De-initializes whatever is needed
do_Print_Labels 'FINISHED'
}
-function do_Show_Info(){
-
- local compiler=gcc
+do_Show_Info () {
+ local compiler="${CC:-gcc}"
echo '-----------------------------------------'
echo 'Build system information'
@@ -113,10 +45,6 @@ function do_Show_Info(){
echo '-----------------------------------------'
cat /etc/*-release
echo '-----------------------------------------'
-
- if [[ ! -z $CC ]]; then
- compiler=$CC
- fi
echo 'Compiler version'
$compiler --version
echo '-----------------------------------------'
diff --git a/test/extra/do_mozilla.sh b/test/extra/do_mozilla.sh
index ef7342f0..f3b768d4 100755
--- a/test/extra/do_mozilla.sh
+++ b/test/extra/do_mozilla.sh
@@ -1,46 +1,11 @@
#!/bin/bash -e
-function do_Configure_MozBuild(){
- echo
- echo '-- Set JHBuild Configuration --'
-
- mkdir -p ~/.config
- autogenargs=""
-
- if [[ -n "${BUILD_OPTS}" ]]; then
- autogenargs="$autogenargs $BUILD_OPTS"
- fi
-
- cat <<EOFILE >> ~/.config/jhbuildrc
-module_autogenargs['mozjs60'] = "$autogenargs"
-module_makeargs['mozjs60'] = '-s'
-EOFILE
-
- echo '-- Done --'
-}
-
-function do_Build_Mozilla_jhbuild(){
- echo
- echo '-- Building Mozilla SpiderMonkey --'
-
- # Configure the Mozilla build
- do_Configure_MozBuild
-
- # Build Mozilla Stuff
- jhbuild build mozjs60
-}
-
function do_Build_Mozilla(){
echo
echo '-- Building Mozilla SpiderMonkey --'
- if [[ $STATIC == "moz52" ]]; then
- git clone --depth 1 https://github.com/ptomato/mozjs.git -b mozjs52 /on-host/spider
- cd /on-host/spider
- else
- git clone --depth 1 https://github.com/ptomato/mozjs.git -b mozjs60 /on-host/spider
- cd /on-host/spider
- fi
+ git clone --depth 1 https://github.com/ptomato/mozjs.git -b "${MOZJS_BRANCH:-mozjs60}" /on-host/spider
+ cd /on-host/spider
mkdir -p _build
cd _build
diff --git a/test/gjs-test-coverage.cpp b/test/gjs-test-coverage.cpp
index d477d5ec..78ed0dd3 100644
--- a/test/gjs-test-coverage.cpp
+++ b/test/gjs-test-coverage.cpp
@@ -792,7 +792,8 @@ hit_count_is_more_than_for_function(const char *line,
max_buf_size = strcspn(line, "\n");
detected_function = g_new(char, max_buf_size + 1);
- nmatches = sscanf(line, "%u,%s", &hit_count, detected_function);
+ GjsAutoChar format_string = g_strdup_printf("%%5u,%%%zus", max_buf_size);
+ nmatches = sscanf(line, format_string, &hit_count, detected_function);
g_assert_cmpint(nmatches, ==, 2);
g_assert_cmpstr(data->function, ==, detected_function);
diff --git a/test/org.gnome.GjsDevel.json b/test/org.gnome.GjsDevel.json
deleted file mode 100644
index 659e6aee..00000000
--- a/test/org.gnome.GjsDevel.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "id": "org.gnome.GjsDevel",
- "branch": "master",
- "runtime": "org.gnome.Platform",
- "runtime-version": "master",
- "sdk": "org.gnome.Sdk",
- "command": "gjs-console",
- "tags": ["unstable", "development"],
- "finish-args": [
- "--filesystem=host",
- "--share=ipc",
- "--share=network",
- "--device=dri",
- "--socket=x11",
- "--socket=wayland",
- "--socket=pulseaudio"
- ],
- "modules": [
- {
- "name": "sysprof",
- "builddir": true,
- "buildsystem": "meson",
- "config-opts": [
- "-Denable_gtk=false",
- "-Dhelp=false",
- "-Dlibsysprof=false",
- "-Dwith_sysprofd=none"
- ],
- "sources": [
- {
- "type": "git",
- "branch": "master",
- "url": "https://gitlab.gnome.org/GNOME/sysprof.git"
- }
- ]
- },
- {
- "name": "gjs",
- "builddir": true,
- "config-opts": [
- "--enable-profiler"
- ],
- "sources": [
- {
- "type": "git",
- "branch": "HEAD",
- "path": "."
- }
- ]
- }
- ]
-}
diff --git a/test/test-ci.sh b/test/test-ci.sh
index bbc2921e..166a4919 100755
--- a/test/test-ci.sh
+++ b/test/test-ci.sh
@@ -1,7 +1,6 @@
-#!/bin/bash -e
-
-function do_Set_Env(){
+#!/bin/sh -e
+do_Set_Env () {
#Save cache on $pwd (required by artifacts)
mkdir -p "$(pwd)"/.cache
XDG_CACHE_HOME="$(pwd)"/.cache
@@ -18,21 +17,21 @@ function do_Set_Env(){
export SHELL=/bin/bash
PATH=$PATH:~/.local/bin
- if [[ -z "${DISPLAY}" ]]; then
- export DISPLAY=":0"
- fi
+ export DISPLAY="${DISPLAY:-:0}"
}
-function do_Get_Upstream_Master(){
-
- if [[ "$CI_PROJECT_PATH_SLUG" == "gnome-gjs" && \
- ("$CI_BUILD_REF_SLUG" == "master" || "$CI_BUILD_REF_SLUG" == "gnome-"* || -n "${CI_COMMIT_TAG}") ]]; then
- echo '-----------------------------------------'
- echo 'Running against upstream'
- echo "=> $1 Nothing to do"
-
- do_Done
- exit 0
+do_Get_Upstream_Master () {
+ if test "$CI_PROJECT_PATH_SLUG" = "gnome-gjs"; then
+ if test "$CI_BUILD_REF_SLUG" = "master" -o \
+ "$CI_BUILD_REF_SLUG" = "gnome-"* -o \
+ -n "$CI_COMMIT_TAG"; then
+ echo '-----------------------------------------'
+ echo 'Running against upstream'
+ echo "=> $1 Nothing to do"
+
+ do_Done
+ exit 0
+ fi
fi
echo '-----------------------------------------'
@@ -43,13 +42,15 @@ function do_Get_Upstream_Master(){
echo '-----------------------------------------'
}
-function do_Compare_With_Upstream_Master(){
-
+do_Compare_With_Upstream_Master () {
echo '-----------------------------------------'
echo 'Compare the working code with upstream master'
- NEW_WARNINGS=$(comm -13 <(sort < /cwd/master-report.txt) <(sort < /cwd/current-report.txt) | wc -l)
- REMOVED_WARNINGS=$(comm -23 <(sort < /cwd/master-report.txt) <(sort < /cwd/current-report.txt) | wc -l)
+ sort < /cwd/master-report.txt > /cwd/master-report-sorted.txt
+ sort < /cwd/current-report.txt > /cwd/current-report-sorted.txt
+
+ NEW_WARNINGS=$(comm -13 /cwd/master-report-sorted.txt /cwd/current-report-sorted.txt | wc -l)
+ REMOVED_WARNINGS=$(comm -23 /cwd/master-report-sorted.txt /cwd/current-report-sorted.txt | wc -l)
if test "$NEW_WARNINGS" -ne 0; then
echo '-----------------------------------------'
echo "### $NEW_WARNINGS new warning(s) found by $1 ###"
@@ -63,19 +64,17 @@ function do_Compare_With_Upstream_Master(){
fi
}
-function do_Create_Artifacts_Folder(){
-
+do_Create_Artifacts_Folder () {
# Create the artifacts folders
save_dir="$(pwd)"
- if [[ $1 == "GJS_COVERAGE" ]]; then
+ if test "$1" = "GJS_COVERAGE"; then
mkdir -p "$save_dir"/coverage; touch "$save_dir"/coverage/doing-"$1"
fi
mkdir -p "$save_dir"/analysis; touch "$save_dir"/analysis/doing-"$1"
}
-function do_Get_Commit_Message(){
-
+do_Get_Commit_Message () {
# Allow CI to skip jobs. Its goal is to simplify housekeeping.
# Disable tasks using the commit message. Possibilities are (and/or):
# [skip eslint] [skip cpplint] [skip cppcheck]
@@ -84,8 +83,7 @@ function do_Get_Commit_Message(){
log_message=$(git log -n 1)
}
-function do_Check_Warnings(){
-
+do_Check_Warnings () {
local total=0
cat compilation.log | grep "warning:" | awk '{total+=1}END{print "Total number of warnings: "total}'
@@ -97,7 +95,7 @@ function do_Check_Warnings(){
total=$(awk '{total+=1}END{print total}' warnings.log)
- if [[ $total > 0 ]]; then
+ if test "$total" -gt 0; then
echo '-----------------------------------------'
echo "### $total new warning(s) found by compiler ###"
echo '-----------------------------------------'
@@ -107,12 +105,11 @@ function do_Check_Warnings(){
fi
}
-function do_Check_Script_Errors(){
-
+do_Check_Script_Errors () {
local total=0
total=$(cat scripts.log | grep 'not ok ' | awk '{total+=1}END{print total}')
- if [[ $total > 0 ]]; then
+ if test "$total" -gt 0; then
echo '-----------------------------------------'
echo "### Found $total errors on scripts.log ###"
echo '-----------------------------------------'
@@ -121,11 +118,11 @@ function do_Check_Script_Errors(){
}
# ----------- Run the Tests -----------
-if [[ -n "${TEST}" ]]; then
+if test -n "$TEST"; then
extra_opts="($TEST)"
fi
-source test/extra/do_environment.sh
+. test/extra/do_environment.sh
# Show some environment info
do_Print_Labels 'ENVIRONMENT'
@@ -137,19 +134,10 @@ echo "Doing: $1 $extra_opts"
do_Create_Artifacts_Folder "$1"
do_Get_Commit_Message
-if [[ $1 == "GJS" ]]; then
+if test "$1" = "GJS"; then
do_Set_Env
do_Show_Info
- if [[ "$DEV" == "jhbuild" ]]; then
- do_Get_JHBuild
- do_Build_JHBuild
- do_Configure_JHBuild
- do_Build_Package_Dependencies gjs
-
- else
- mkdir -p ~/jhbuild/checkout/gjs
- fi
do_Configure_MainBuild
# Build and test the latest commit (merged or from a merge/pull request) of
@@ -159,53 +147,42 @@ if [[ $1 == "GJS" ]]; then
do_Print_Labels 'Do the GJS build'
- if [[ "$DEV" == "jhbuild" ]]; then
- cp -r ./ ~/jhbuild/checkout/gjs
- cd ~/jhbuild/checkout/gjs
+ export AM_DISTCHECK_CONFIGURE_FLAGS="--enable-compile-warnings=yes"
- jhbuild make --check
- else
- export AM_DISTCHECK_CONFIGURE_FLAGS="--enable-compile-warnings=yes"
-
- # Regular (autotools only) build
- echo "Autogen options: $ci_autogenargs"
- eval ./autogen.sh "$ci_autogenargs"
+ # Regular (autotools only) build
+ echo "Autogen options: $ci_autogenargs"
+ eval ./autogen.sh "$ci_autogenargs"
- make -sj 2>&1 | tee compilation.log
+ make -sj 2>&1 | tee compilation.log
- if [[ $TEST == "distcheck" ]]; then
- xvfb-run -a make -s distcheck
- elif [[ $TEST == "check" ]]; then
- xvfb-run -a make -s check
- fi
- make -sj install
+ if test "$TEST" = "distcheck"; then
+ xvfb-run -a make -s distcheck
+ elif test "$TEST" = "check"; then
+ xvfb-run -a make -s check
fi
+ make -sj install
- if [[ $WARNINGS == "count" ]]; then
+ if test "$WARNINGS" = "count"; then
do_Print_Labels 'Warnings Report '
do_Check_Warnings
do_Print_Labels
fi
-elif [[ $1 == "GJS_EXTRA" ]]; then
+elif test "$1" = "GJS_EXTRA"; then
# It doesn't (re)build, just run the 'Installed Tests'
do_Print_Labels 'Run GJS installed tests'
do_Set_Env
- if [[ "$DEV" == "jhbuild" ]]; then
- xvfb-run -a jhbuild run dbus-run-session -- gnome-desktop-testing-runner gjs
- else
- xvfb-run -a dbus-run-session -- gnome-desktop-testing-runner gjs
- fi
+ xvfb-run -a dbus-run-session -- gnome-desktop-testing-runner gjs
-elif [[ $1 == "VALGRIND" ]]; then
+elif test "$1" = "VALGRIND"; then
# It doesn't (re)build, just run the 'Valgrind Tests'
do_Print_Labels 'Valgrind Report'
do_Set_Env
make check-valgrind
-elif [[ $1 == "SH_CHECKS" ]]; then
+elif test "$1" = "SH_CHECKS"; then
# It doesn't (re)build, just run the 'Tests'
do_Print_Labels 'Shell Scripts Check'
do_Set_Env
@@ -218,7 +195,7 @@ elif [[ $1 == "SH_CHECKS" ]]; then
installed-tests/scripts/testExamples.sh > scripts.log
do_Check_Script_Errors
-elif [[ $1 == "GJS_COVERAGE" ]]; then
+elif test "$1" = "GJS_COVERAGE"; then
# It doesn't (re)build, just run the 'Coverage Tests'
do_Print_Labels 'Code Coverage Report'
do_Set_Env
@@ -231,24 +208,7 @@ elif [[ $1 == "GJS_COVERAGE" ]]; then
sed -e 's/<[^>]*>//g' "$save_dir"/coverage/index.html | tr -d ' \t' | grep -A3 -P '^Lines:$' | tr '\n' ' '; echo
echo '-----------------------------------------'
-elif [[ $1 == "CPPCHECK" && "$log_message" != *'[skip cppcheck]'* ]]; then
- do_Print_Labels 'Static code analyzer report '
-
- cppcheck --inline-suppr --enable=warning,performance,portability,information,missingInclude --force -q . 2>&1 | \
- tee "$save_dir"/analysis/current-report.txt | sed -E 's/:[0-9]+]/:LINE]/g' > /cwd/current-report.txt
- cat "$save_dir"/analysis/current-report.txt
- echo
-
- # Get the code committed at upstream master
- do_Get_Upstream_Master "cppCheck"
- cppcheck --inline-suppr --enable=warning,performance,portability,information,missingInclude --force -q . 2>&1 | \
- tee "$save_dir"/analysis/master-report.txt | sed -E 's/:[0-9]+]/:LINE]/g' > /cwd/master-report.txt
- echo
-
- # Compare the report with master and fail if new warnings are found
- do_Compare_With_Upstream_Master "cppCheck"
-
-elif [[ $1 == "CPPLINT" && "$log_message" != *'[skip cpplint]'* ]]; then
+elif test "$1" = "CPPLINT"; then
do_Print_Labels 'C/C++ Linter report '
cpplint --quiet $(find . -name \*.cpp -or -name \*.c -or -name \*.h | sort) 2>&1 >/dev/null | \
@@ -268,45 +228,6 @@ elif [[ $1 == "CPPLINT" && "$log_message" != *'[skip cpplint]'* ]]; then
# Compare the report with master and fail if new warnings are found
do_Compare_With_Upstream_Master "cppLint"
-
-elif [[ $1 == "ESLINT" && "$log_message" != *'[skip eslint]'* ]]; then
- do_Print_Labels 'Javascript Linter report'
-
- tmp_path=$(dirname "$CI_PROJECT_DIR")
-
- eslint examples installed-tests modules --format unix 2>&1 | \
- tee "$save_dir"/analysis/current-report.txt | \
- sed -E -e 's/:[0-9]+:[0-9]+:/:LINE:COL:/' -e 's/[0-9]+ problems//' -e 's/\/root\/tmp-upstream//' -e "s,$tmp_path,," \
- > /cwd/current-report.txt
- cat "$save_dir"/analysis/current-report.txt
- echo
-
- # Get the code committed at upstream master
- do_Get_Upstream_Master "esLint"
- cp "$save_dir"/.eslint* .
- eslint examples installed-tests modules --format unix 2>&1 | \
- tee "$save_dir"/analysis/master-report.txt | \
- sed -E -e 's/:[0-9]+:[0-9]+:/:LINE:COL:/' -e 's/[0-9]+ problems//' -e 's/\/root\/tmp-upstream//' -e "s,$tmp_path,," \
- > /cwd/master-report.txt
- echo
-
- # Compare the report with master and fail if new warnings are found
- do_Compare_With_Upstream_Master "esLint"
-
-elif [[ $1 == "TOKEI" ]]; then
- do_Print_Labels 'Project statistics'
-
- tokei . | tee "$save_dir"/analysis/report.txt
-
-elif [[ $1 == "FLATPAK" ]]; then
- do_Print_Labels 'Flatpak packaging'
-
- # Move the manifest file to the root folder
- cp "test/$MANIFEST" .
-
- flatpak-builder --version
- flatpak-builder --bundle-sources --repo=devel build "$MANIFEST"
- flatpak build-bundle devel ${BUNDLE} --runtime-repo=${RUNTIME_REPO} org.gnome.GjsDevel
fi
# Releases stuff and finishes