Skip to content

Commit

Permalink
add cjs-test and enable full autopkgtest
Browse files Browse the repository at this point in the history
This add package of installed tests, useful to do more tests also out of
build

Full autopkgtest help to spot regression also when depends are updated,
for example used in debian CI:
https://ci.debian.net/packages/c/cjs/unstable/amd64/

Both installed tests and autopkgtest can be used also manually by users
and developers
  • Loading branch information
Fantu committed Feb 2, 2024
1 parent 994fa7f commit f0ab0c9
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 9 deletions.
3 changes: 3 additions & 0 deletions debian/cjs-tests.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
usr/share/glib-2.0/schemas/org.cinnamon.CjsTest.gschema.xml
usr/share/installed-tests
usr/libexec/installed-tests/cjs
3 changes: 3 additions & 0 deletions debian/cjs-tests.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test data is not documentation, even if it's in a text file
package-contains-documentation-outside-usr-share-doc [usr/libexec/installed-tests/*]
library-not-linked-against-libc [usr/libexec/installed-tests/cjs/*.so]
14 changes: 14 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ Description: Mozilla-based javascript bindings for the Cinnamon platform (cli to
uses.
.
This package contains the interactive console application.

Package: cjs-tests
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
cjs,
at-spi2-core
Description: Mozilla-based javascript bindings for the Cinnamon platform (tests)
Makes it possible for applications to use all of Cinnamon's platform
libraries using the JavaScript language. It's mainly based on the
Mozilla JavaScript engine and the GObject introspection framework.
.
This package is the frozen version of gjs that the cinnamon desktop currently
uses.
.
This package contains test programs, designed to be run as part of a
regression testsuite.
Expand Down
14 changes: 13 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,24 @@ override_dh_auto_configure:
dh_auto_configure -- \
-Dauto_features=enabled \
-Dprofiler=disabled \
-Dinstalled_tests=false \
-Dinstalled_tests=true \
$(NULL)

execute_after_dh_auto_install:
rm -f debian/tmp/usr/libexec/installed-tests/cjs/js/modules/*/.eslintrc.yml

override_dh_girepository:
dh_girepository -l $(BUILDDIR) /usr/lib/$(DEB_HOST_MULTIARCH)/cjs/girepository-1.0

# debhelper >= 13.4 makes all of /usr/libexec executable, which is not
# quite right for installed-tests
override_dh_fixperms:
dh_fixperms -Xusr/libexec/installed-tests
ifneq ($(filter %-tests,$(built_binaries)),)
chmod --changes u=rw,og=r debian/*-tests/usr/libexec/installed-tests/cjs/*.so
chmod --recursive --changes a+rX,u+w,og-w debian/*-tests/usr/libexec/installed-tests
endif

override_dh_auto_test:
GI_TYPELIB_PATH=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE) \
obj-$(DEB_HOST_GNU_TYPE)/cjs-console -c 'print("Smoke-test OK")'
Expand Down
12 changes: 9 additions & 3 deletions debian/tests/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Tests: acc
Depends: @, dh-acc, exuberant-ctags
Restrictions: allow-stderr, superficial

Tests: build
Depends: build-essential, libcjs-dev
Depends: libcjs-dev, build-essential
Restrictions: superficial

Tests: installed-tests
Depends: dbus-daemon, dbus-x11, cjs-tests, gnome-desktop-testing, xauth, xvfb

#Tests: installed-tests
#Depends: dbus-daemon, dbus-x11, cjs-tests, gnome-desktop-testing, xauth, xvfb
2 changes: 1 addition & 1 deletion debian/tests/installed-tests
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export XDG_RUNTIME_DIR=$AUTOPKGTEST_TMP
export LC_ALL=C.UTF-8

# dbus outputs activation messages to stderr which fails the test
dbus-run-session -- xvfb-run -a gnome-desktop-testing-runner gjs 2> >(grep -vE '^(Activating|Successfully activated)')>&2
dbus-run-session -- xvfb-run -a gnome-desktop-testing-runner cjs 2> >(grep -vE '^(Activating|Successfully activated)')>&2
4 changes: 0 additions & 4 deletions debian/tests/testsuite

This file was deleted.

0 comments on commit f0ab0c9

Please sign in to comment.