Impelemt CI

This commit is contained in:
Takao Fujiwara 2024-09-06 12:12:22 +09:00
parent 73fb42d5cd
commit 4f78007f42
6 changed files with 55 additions and 0 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

5
plans/test.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

View File

@ -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

17
tests/validation/main.js Normal file
View File

@ -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();

7
tests/validation/test.js Normal file
View File

@ -0,0 +1,7 @@
import GObject from 'gi://GObject';
import NoOverviewExtension from './extension.js';
let extension = new NoOverviewExtension();
extension.enable();
extension.disable();

17
tests/validation/test.sh Executable file
View File

@ -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