Commit Graph

22 Commits

Author SHA1 Message Date
Simon McVittie
e9c217adc1 test-basic: Don't fail if head -2 exits before flatpak does
The output might be written to the pipe by `flatpak --help` and/or read
from the pipe by `head -2` in more than one batch. If `head -2` reads
the first two lines before `flatpak --help` has written everything, it
will exit, causing the pipe to have no process at the read end. This
results in `flatpak --help` being killed by `SIGPIPE` next time it tries
to write to the pipe, because it has not opted out of this behaviour
(as shell tools usually shouldn't).

We're running under `set -o pipefail`, so this causes a nonzero exit
status that makes the test fail. Worse, this failure is intermittent,
because `head -2` *usually* doesn't exit until `flatpak --help` has
already written out everything it is going to write - it depends on
the precise behaviour of read(), write() and kernel scheduling.

We know that `flatpak --help` output is not *that* long, so it's OK
for `flatpak --help` not to be terminated early: we can send it all
into an intermediate file, and then run `head` on the file.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-04-12 11:07:10 +02:00
Philip Withnall
9411fe2bca flatpak: Add --print-updated-env option to print environment
This is the environment needed to use flatpaks; a following commit will
hook this up to the systemd environment generator.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-22 14:21:54 +01:00
Alexander Larsson
b1fdf6c4ef tests: Add and use "ok" helper
This allows us to print some separators for the logs also.

tests: Convert more tests to ok helper
2020-03-20 15:37:10 +01:00
Matthew Leeds
10f6166a40 tests: Add mask command to test-basic and test-completion 2019-11-20 13:17:27 +01:00
Matthias Clasen
b6e19db7be Update tests
Our test are now good enough to detect that install
is no longer a one-dir command. Yay. Update them.
2019-01-11 19:19:54 -05:00
Matthias Clasen
d3b1b86f04 Add tests for ONE_DIR commands
Check that we consistenly reject specifying multiple
installations for commands that only accept one.

Closes: #2534
Approved by: alexlarsson
2019-01-11 12:40:36 +00:00
Matthias Clasen
754d68c74a Rename list commands
Rename permission-list and document-list to
permissions and documents, for consistency with
how we handle remotes. The old command names
are kept as hidden aliases.

Closes: #2131

Closes: #2366
Approved by: mwleeds
2018-12-03 19:46:09 +00:00
Matthias Clasen
263a2e5663 Add some more basic tests
Some tests for commandline error handling.

Closes: #2244
Approved by: alexlarsson
2018-10-15 06:51:58 +00:00
Matthias Clasen
9f7ddaf678 Add a test for --columns=help
Check that this produces the expected output.

Closes: #2244
Approved by: alexlarsson
2018-10-15 06:51:58 +00:00
Matthias Clasen
1709f3bc1b Add a test for --gl-drivers
It is something we can easily test, so why not.
2018-10-10 12:21:15 +02:00
Matthias Clasen
a0744f1f80 Exercise all commands in test-basic.sh
We can test that every command has help output.

Closes: #2187
Approved by: alexlarsson
2018-10-05 13:34:49 +00: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
Alexander Larsson
8740a9ded3 Add flatpak --supported-arches 2016-06-23 11:12:28 +02:00
Alexander Larsson
f4c2eeb057 Fix version test
The --version output changes slightly (was capitalized)
2016-05-31 15:16:24 +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
Alexander Larsson
8abbc0186e Rename everything but the on-disk location to flatpak 2016-05-09 11:11:55 +02:00
Alexander Larsson
6a613d1fab Rename all non-autogenerated symbols to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson
b3d854f507 tests: Fix installed tests 2016-05-02 16:26:47 +02:00
Alexander Larsson
df4deecccc tests: Test --default-arch 2016-05-02 12:39:30 +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
337f81048c test-basic: Verify the right version 2016-04-28 13:12:43 +02:00
Alexander Larsson
327f432219 tests: Add a basic test that just runs an app 2016-04-27 21:23:42 +02:00