Commit Graph

190 Commits (master)

Author SHA1 Message Date
Alexander Larsson 9f047ff58e Merge pull request #154 from smcv/test-locale
test-basic: do not fail in non-English locales
2016-06-27 12:55:39 +02:00
Simon McVittie a41ecc5254 test-basic: do not fail in non-English locales
One of the variations tested on Debian's reproducible build
infrastructure is that the second build is done in a French locale.
This test fails there, because it doesn't see "Usage:" in the help.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-26 16:56:42 +01:00
Simon McVittie ee99e8afff Add BWRAP and --with-system-bubblewrap configure arguments
This lets distributors share a system copy of bubblewrap (>= 0.1.0)
between Flatpak and any other projects that benefit from it, if they are
careful to keep new versions in sync. The default is still to use the
bundled submodule, ensuring compatibility and simplifying dependencies.

Enable $PATH search everywhere that runs bwrap, so that $BWRAP doesn't
necessarily need to be a fully-qualified path.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-26 11:09:03 +01:00
Simon McVittie 6f9915eade Run tests with a private XDG_RUNTIME_DIR
Otherwise, service activation will start a new xdg-document-portal
(because we're using a private DBUS_SESSION_BUS_ADDRESS), but because
XDG_RUNTIME_DIR is shared with the real system, it won't be able to
mount its filesystem.

We need to unmount the document portal before removing the private
XDG_RUNTIME_DIR.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-25 00:45:10 +01:00
Simon McVittie c59fba9be3 tests: don't treat helper scripts as though they were tests
We shouldn't install .test metadata for these, and run them as TAP
test scripts. In glib-tap.mk jargon that makes them "extra scripts".

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-25 00:45:09 +01:00
Alexander Larsson 8740a9ded3 Add flatpak --supported-arches 2016-06-23 11:12:28 +02:00
Simon McVittie ec81d5c61b test-run: avoid testing cases of filesystem binding that won't work
This test effectively assumed that ${test_builddir} is in /home, /opt,
a non-FHS top level directory, or some other directory that isn't
in dont_mount_in_root[] in flatpak-run.c. In a distro build where
${libexecdir} is below /usr, when running the installed-tests
so ${test_builddir} is ${libexecdir}, this assumption doesn't hold.

We can't just copy the file we're dealing with into a subdirectory
of /tmp or /var/tmp either, because those directories aren't
part of --filesystem=host. Meanwhile, we also don't want to pollute
$HOME with test detritus.

For the best possible coverage given all those constraints, we try
three directories: ${test_builddir}; ${TEST_DATA_DIR}, which is
in /var/tmp; and ~/.flatpak-tests, but only if it already exists.

When testing --[no]filesystem=host overrides, we don't even try
${TEST_DATA_DIR}, because we know it's in /var/tmp which can only
be shared explicitly, but we do try the others.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-16 00:10:42 -04:00
Simon McVittie ee77be10b5 tests: clean up what is distributed
Listing variables whose values are conditional in EXTRA_DIST is
problematic: if Flatpak was configured without installed-tests,
we would not distribute those files. This is a problem during
distcheck, where installed-tests are disabled.

For files not placed in a special subdirectory, glib-tap.mk handles
this for us. For the keyring and the databases, we have to do it
ourselves, by arranging for them to be in a dist_ variable that is
special to Automake - when determining what to distribute, Automake
includes anything that is selected for distribution under any
combination of conditionals.

While I'm here, include test keyring's README in tarballs: its advice
is equally applicable in a tarball release.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-12 10:35:13 +01:00
Alexander Larsson 528b150162 Update valgrind test support 2016-06-10 12:59:11 +02:00
Alexander Larsson c800c59c54 test-builder: Test an empty module 2016-06-09 12:43:31 +02:00
Alexander Larsson c81e43fa09 tests/test-builder: Test recursive modules 2016-06-09 12:10:52 +02:00
Alexander Larsson e3e9c6559e tests: Test changing the subpaths on update 2016-06-07 22:12:51 +02:00
Alexander Larsson 20a737dc90 tests: Pull things via http instead of local pulls
This causes us to use the same codepaths as in real use.
Also, there seems to be an issue with partial pulls for local remotes.
2016-06-07 22:12:51 +02:00
Alexander Larsson 1bf2998352 Add tests for subpaths 2016-06-03 18:03:43 +02:00
Alexander Larsson 1667f988de Add test-bundle-system
This tests installing a bundle via the system-helper.
2016-06-03 16:04:10 +02:00
Alexander Larsson 95dfd2f459 Add test for bundles 2016-06-03 14:30:25 +02:00
Alexander Larsson f4c2eeb057 Fix version test
The --version output changes slightly (was capitalized)
2016-05-31 15:16:24 +02:00
Alexander Larsson 759bfaa0f4 tests: Only skip tests if no xattrs in /var/tmp
We explicitly put the checkouts in /var/tmp to avoid the common
case of /tmp being tmpfs and not supporting xattrs.
2016-05-31 09:18:08 +02:00
David King fc6282e865 bwrap: Move to under libexecdir
According to the FHS, applications which place internal libraries in
/usr/libexec should not also use /usr/lib for this purpose:

http://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html

As several flatpak helpers are already installed in libexecdir, move
the bwrap helper to /usr/libexec/flatpak-bwrap.
2016-05-30 18:40:12 +02:00
Simon McVittie a461eb50fa Skip tests that make a repository if /var/tmp lacks user xattrs
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-23 23:00:37 +01:00
Alexander Larsson c6486d01a2 tests: Fix distcheck
Don't clean out the test files on a regular clean.
2016-05-18 10:45:16 +02:00
Alexander Larsson 4af71aae7b Fix distcheck: clean up some more generated files 2016-05-18 10:30:47 +02:00
Alexander Larsson 1216e0ea68 tests: Fix distcheck breaking on gpg dir not writable
We make a copy of the gpg homedir so that gpg can write (e.g. a lock file)
to the directory.
2016-05-18 10:26:11 +02:00
Alexander Larsson d961290d40 tests: EXTRA_DIST the test keyrings 2016-05-18 10:16:59 +02:00
Simon McVittie aa91b28a74 test-configure: use correct quoting
CFLAGS, FOO, BAR may contain spaces.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 18:05:41 +02:00
Simon McVittie d4738cca16 tests: skip running flatpak at build time if bwrap doesn't work
Distribution autobuilders are often more locked-down than the
environment in which the distribution binaries actually run.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 18:05:12 +02:00
Simon McVittie d6b1c9ff3c tests: package_version.txt is in the $builddir
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 18:01:46 +02:00
Simon McVittie 70e70d2f6a test-doc-portal: rely on service activation to start D-Bus service
This is a more realistic integration test anyway.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 17:59:23 +02:00
Simon McVittie 4828632456 test-doc-portal: rely on G_TEST_BUILDDIR to find services
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 17:59:04 +02:00
Simon McVittie 513f795c65 testdb: rely on G_TEST_SRCDIR to find databases
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 17:57:24 +02:00
Simon McVittie a7a49065a7 Don't install non-executable test files executable
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 17:55:42 +02:00
Alexander Larsson aa11387031 tests: Add test-run-system.sh 2016-05-17 17:49:55 +02:00
Alexander Larsson 294639ba2a test-run: Split null update to its own test 2016-05-17 13:05:43 +02:00
Alexander Larsson f36a57b3b1 tests: Use gpg signatures during test 2016-05-17 13:04:44 +02:00
Alexander Larsson 6b4e5dd903 tests: Put --user in an env var
This means we can optionally skip it
2016-05-17 10:50:02 +02:00
Alexander Larsson c432c417c2 tests: Add test for update 2016-05-17 10:32:29 +02:00
Alexander Larsson 90c909a932 Fix clang warnings 2016-05-13 16:26:47 +02:00
Alexander Larsson f68b21754a tests: Fix make-test-bundles.sh
This had bitrotted
2016-05-10 11:18:32 +02:00
Alexander Larsson 9957cc3a14 tests: Name bundles .flatpak 2016-05-10 11:10:51 +02:00
Alexander Larsson 28b549156a Split out permission store from session helper
This is now available as org.freedesktop.impl.portal.PermissionStore
2016-05-09 14:07:22 +02:00
Alexander Larsson 605b3f4e09 tests: Add an en_US locale to the test runtime 2016-05-09 13:10:13 +02:00
Alexander Larsson 5e9b247d26 Migrate ~/.local/share/xdg-app to ~/.local/share/flatpak 2016-05-09 12:21:28 +02:00
Alexander Larsson 8abbc0186e Rename everything but the on-disk location to flatpak 2016-05-09 11:11:55 +02:00
Alexander Larsson ba37b22d78 Rename library to libflatpak 2016-05-09 09:46:26 +02:00
Alexander Larsson c24528d369 Rename source files to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson 6a613d1fab Rename all non-autogenerated symbols to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson 23dbfd5301 fix build test due to recent change
We're now looking for sources in the same dir as the json, so fix
the test
2016-05-06 16:36:59 +02:00
Alexander Larsson 1ffdf27d92 uncruftify: Initial run, all non-problematic changes 2016-05-06 16:03:27 +02:00
Alexander Larsson 663cfcf3a8 Fix make check if uninstalled
This uses various environment variables set during make check
to find the trigger, bwrap and xdg-app-dbusproxy from the build/source dir
rather than the installed location.
2016-05-03 10:27:36 +02:00
Alexander Larsson 1df3e4845b Fix various distcheck issues 2016-05-03 09:36:33 +02:00
Alexander Larsson bffaa12301 Remove old gtester references 2016-05-03 09:25:05 +02:00
Alexander Larsson 4d21107f1c Rename configure.test to test-configure
Otherwise it is ignored with the other *.test generated files
2016-05-02 17:18:00 +02:00
Alexander Larsson b3d854f507 tests: Fix installed tests 2016-05-02 16:26:47 +02:00
Alexander Larsson d680da8d59 Added xdg-app-builder test 2016-05-02 15:49:18 +02:00
Alexander Larsson dcfb950c31 make-test-runtime.sh: Make this a bit more generic
We pass the id and contents on the commandline
2016-05-02 14:15:32 +02:00
Alexander Larsson df4deecccc tests: Test --default-arch 2016-05-02 12:39:30 +02:00
Alexander Larsson a68e3bba50 tests: Add tests for list/info commands 2016-05-02 12:38:12 +02:00
Alexander Larsson e5fad0714e tests: Add namespace and overrides tests 2016-05-02 11:41:32 +02:00
Alexander Larsson 123f32015d tests/test-run.sh: Add tests for proper installation 2016-05-02 10:47:59 +02:00
Alexander Larsson 2f465215e2 Add some missing files from the tests 2016-05-02 10:46:51 +02:00
Alexander Larsson e7cc0c3db9 tests: Move run tests to separate file
Also adds a --help test to test-basic.
2016-05-02 09:52:58 +02:00
Alexander Larsson ee7be7f82d Build bwrap 2016-04-29 15:38:23 +02:00
Alexander Larsson acd84a454a Fix install with installed tests disabled 2016-04-28 17:00:41 +02:00
Alexander Larsson 337f81048c test-basic: Verify the right version 2016-04-28 13:12:43 +02:00
Alexander Larsson b330368761 Make installed tests work better
This involves e.g. having our own session bus with only our services in.
2016-04-28 13:04:14 +02:00
Alexander Larsson 327f432219 tests: Add a basic test that just runs an app 2016-04-27 21:23:42 +02:00
Alexander Larsson 3d3ebf814d Support installed tests 2016-04-27 16:37:15 +02:00
Alexander Larsson 7ddfc91b90 Flesh out document portal tests 2016-03-14 11:33:13 +01:00
Alexander Larsson eba6a1e552 Add appdata to test apps 2016-02-25 19:03:09 +01:00
Alexander Larsson aefb4b6b82 Add make-test-bundles.sh 2016-02-25 15:27:37 +01:00
Alexander Larsson 0e595519c1 Add test scripts that create trivial a runtime and app 2016-02-25 15:14:57 +01:00
Alexander Larsson 69052c7d9a lib: Add XdgAppBundleRef 2016-02-24 14:44:16 +01:00
Simon McVittie 71a30f54f3 Update tests' dependencies for commit 2f38ec65 2016-01-29 09:51:20 +01:00
Alexander Larsson a0a1bc4d0b Merge pull request #108 from smcv/no-fuse
Fix `make check` when FUSE is unavailable
2016-01-29 08:54:58 +01:00
Simon McVittie ea4d601837 Consistently call g_assert_no_error before other assertions
If a call fails, an assertion message that contains the error domain,
code and message is a lot more useful than reporting that an
assertion like "reply != NULL" failed.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-01-29 00:21:49 +01:00
Simon McVittie aaae0d0b6d test-doc-portal: skip all tests if no FUSE
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-01-29 00:02:25 +01:00
Simon McVittie 74c652a176 test-doc-portal: split out global setup/teardown into functions
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-01-29 00:02:00 +01:00
Alexander Larsson 106a5b06ec Rename lib/ to common/ in preparation for public xdg-app library 2015-11-26 22:05:38 +01:00
David King 905549ba48 tests: Use check_PROGRAMS as the primary
The tests should only be built if required by make check.

https://bugs.freedesktop.org/show_bug.cgi?id=92036
2015-09-18 14:16:34 +02:00
Alexander Larsson 645c433960 Fix distcheck issues 2015-09-17 20:24:04 +02:00
Alexander Larsson eec8798f5e document portal: Add support for transient documents
These are useful for passing temporary files.
2015-09-17 20:09:50 +02:00
Alexander Larsson 07a12a145a test-doc-portal: Add recursive file export test 2015-09-08 15:34:51 +02:00
Alexander Larsson ab97ea7da6 test-doc-portal: Work around GTestDbus env unsetting 2015-09-08 15:34:21 +02:00
Alexander Larsson d0773282a5 test-doc-portal: Fix unique boolean arg 2015-09-08 15:31:01 +02:00
Alexander Larsson 18cc81d8a7 test-doc-portal: Launch the portal manually
This allows us to get debug output
2015-09-08 09:49:33 +02:00
Alexander Larsson d79935bd4a Add minimal document portal tests 2015-09-07 17:17:44 +02:00
Alexander Larsson d50284c7a6 Add check-valgrind target 2015-09-07 11:13:21 +02:00
Alexander Larsson 6775dc1002 Use g_auto(GStrv) instead of glnx_strfreev 2015-08-31 09:51:48 +02:00
Alexander Larsson 52525f46fd Remove ununsed variables reported by clang 2015-08-27 16:13:15 +02:00
Alexander Larsson de004081ef Initial tests of the db 2015-08-25 13:16:34 +02:00