diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/test.fmf b/plans/test.fmf new file mode 100644 index 0000000..c1627f9 --- /dev/null +++ b/plans/test.fmf @@ -0,0 +1,5 @@ +summary: Basic smoke test +discover: + how: fmf +execute: + how: tmt diff --git a/tests/validation/main.fmf b/tests/validation/main.fmf new file mode 100644 index 0000000..d396a72 --- /dev/null +++ b/tests/validation/main.fmf @@ -0,0 +1,8 @@ +summary: Lint check for GNOME-Shell extension files +test: ./test.sh +framework: beakerlib +require: + - gjs + - glib2 + - gnome-shell-extension-no-overview + - json-glib-devel diff --git a/tests/validation/main.js b/tests/validation/main.js new file mode 100644 index 0000000..c5163d9 --- /dev/null +++ b/tests/validation/main.js @@ -0,0 +1,17 @@ +import GObject from 'gi://GObject'; + +export const LayoutManager = GObject.registerClass( +class LayoutManager extends GObject.Object { + constructor() { + super(); + this._startingUp = 1; + } + + connectObject(object) { + } + + disconnectObject(object) { + } +}); + +export let layoutManager = new LayoutManager(); diff --git a/tests/validation/test.js b/tests/validation/test.js new file mode 100644 index 0000000..ae1b278 --- /dev/null +++ b/tests/validation/test.js @@ -0,0 +1,7 @@ +import GObject from 'gi://GObject'; + +import NoOverviewExtension from './extension.js'; + +let extension = new NoOverviewExtension(); +extension.enable(); +extension.disable(); diff --git a/tests/validation/test.sh b/tests/validation/test.sh new file mode 100755 index 0000000..b7e5709 --- /dev/null +++ b/tests/validation/test.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k + +# gjs or js115 in mozjs115-devel provides very simple validations. + +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup + rlRun -t "sed -e 's|resource:.*/main.js|./main.js|' /usr/share/gnome-shell/extensions/no-overview@fthx/extension.js > extension.js" + rlPhaseEnd + + rlPhaseStartTest + rlRun -t "json-glib-validate /usr/share/gnome-shell/extensions/no-overview@fthx/metadata.json" + rlRun -t "gjs -m test.js" + rlPhaseEnd +rlJournalEnd