From: Colin Clark Date: Sat, 10 Jun 2023 13:58:20 +0000 (+0100) Subject: Run shellcheck in meson tests X-Git-Tag: v2.1~18 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=6949cfe7b19a281e67f796df8e0ffd7569041284 Run shellcheck in meson tests --- diff --git a/.github/workflows/check-build-actions.yml b/.github/workflows/check-build-actions.yml index 1d060037..b0a0732d 100644 --- a/.github/workflows/check-build-actions.yml +++ b/.github/workflows/check-build-actions.yml @@ -7,6 +7,7 @@ jobs: steps: - run: sudo apt-get update - run: sudo apt-get install build-essential libgtk-3-dev + - run: sudo apt-get install shellcheck - uses: actions/checkout@v3 - uses: actions/setup-python@v4 - run: sudo apt-get install xvfb @@ -30,6 +31,7 @@ jobs: steps: - run: sudo apt-get update - run: sudo apt-get install build-essential libgtk-3-dev + - run: sudo apt-get install shellcheck - run: sudo apt-get install evince - run: sudo apt-get install libarchive-dev - run: sudo apt-get install libchamplain-0.12-dev libchamplain-gtk-0.12-dev diff --git a/meson.build b/meson.build index adbf8b1a..f594ae71 100644 --- a/meson.build +++ b/meson.build @@ -635,8 +635,49 @@ configure_file(input: 'geeqie.spec.in', output: 'geeqie.spec', configuration: co xvfb = find_program('xvfb-run', required : false) if xvfb.found() test('Basic test', xvfb, args: ['--auto-servernum', geeqie_exe, '--version'], timeout: 100) - summary({'xvfb' : ['Test runs:', true]}, section : 'Debugging', bool_yn : true) + summary({'xvfb' : ['Test runs:', true]}, section : 'Testing', bool_yn : true) else - summary({'xvfb' : ['Test runs:', false]}, section : 'Debugging', bool_yn : true) - + summary({'xvfb' : ['Test runs:', false]}, section : 'Testing', bool_yn : true) +endif + +# Shellcheck +shellcheck_exe = find_program('shellcheck', required : false) +script_sources = files('./doc/create-doxygen-lua-api.sh', +'./doc/create-shortcuts-xml.sh', +'./gen_changelog.sh', +'./geeqie-install-debian.sh', +'./plugins/camera-import/geeqie-camera-import', +'./plugins/camera-import/geeqie-camera-import-hook-script', +'./plugins/export-jpeg/geeqie-export-jpeg', +'./plugins/image-crop/geeqie-image-crop', +'./plugins/random-image/geeqie-random-image', +'./plugins/rotate/geeqie-rotate', +'./plugins/symlink/geeqie-symlink', +'./plugins/tethered-photography/geeqie-tethered-photography', +'./plugins/tethered-photography/geeqie-tethered-photography-hook-script', +'./po/gen_translations_stats.sh', +'./po/regen_potfiles.sh', +'./scripts/authors.sh', +'./scripts/check-compiles.sh', +'./scripts/doxygen-help.sh', +'./scripts/doxygen.sh', +'./scripts/generate-ClayRGB1998-icc-h.sh', +'./scripts/generate-appimage.sh', +'./scripts/generate-linuxdeploy-for-arm.sh', +'./scripts/generate-man-page.sh', +'./scripts/keyword_merge.sh', +'./scripts/new-release.sh', +'./scripts/template-desktop.sh', +'./scripts/translators.sh', +'./scripts/untranslated-text.sh', +'./scripts/web-help.sh', +'./version.sh',) + +if shellcheck_exe.found() + foreach script : script_sources + test('Shellcheck', shellcheck_exe, args: ['--norc', '--shell=sh', '--enable=add-default-case,avoid-nullary-conditions,check-unassigned-uppercase,deprecate-which,quote-safe-variables', script], timeout: 100) + endforeach + summary({'shellcheck' : ['Test runs:', true]}, section : 'Testing', bool_yn : true) +else + summary({'shellcheck' : ['Test runs:', false]}, section : 'Testing', bool_yn : true) endif