summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2021-10-17 20:49:22 +0200
committerJan Tojnar <jtojnar@gmail.com>2021-10-17 20:49:22 +0200
commit96dbe28cfa96e80b23fa1d8072eb36edad41279c (patch)
tree0ecbbf063866a6843b60ee322fcd2cfe4c2a17cf
parentb0981912520de706f1e20993f3486ce83cd5787a (diff)
downloadflatpak-96dbe28cfa96e80b23fa1d8072eb36edad41279c.tar.gz
tests: Allow FLATPAK_BINARY=flatpak for exports
https://github.com/flatpak/flatpak/commit/a99b748931e6444dadb0d0c8c1565da23f755800 introduced an environment variable for changing the flatpak path for exports. On NixOS, we do not have a stable path we could use so we used to patch Flatpak to use `flatpak` program from `PATH`. With the recent change, we drop our downstream patch in favour of setting the environment variable to `flatpak` but the tests do not expect that. This is the test part of our former downstream patch so that tests can pass with exports using `flatpak` instead of an absolute path. It still expects the binary path to end with `flatpak` so arbitrary `$FLATPAK_BINARY` will not work but we do not pass the environment variable to tests so we cannot do much better.
-rwxr-xr-xtests/test-bundle.sh2
-rw-r--r--tests/test-run.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/test-bundle.sh b/tests/test-bundle.sh
index 487b0735..53568fdb 100755
--- a/tests/test-bundle.sh
+++ b/tests/test-bundle.sh
@@ -67,7 +67,7 @@ assert_has_dir $FL_DIR/app/org.test.Hello/$ARCH/master/active/files
assert_has_dir $FL_DIR/app/org.test.Hello/$ARCH/master/active/export
assert_has_file $FL_DIR/exports/share/applications/org.test.Hello.desktop
# Ensure Exec key is rewritten
-assert_file_has_content $FL_DIR/exports/share/applications/org.test.Hello.desktop "^Exec=.*/flatpak run --branch=master --arch=$ARCH --command=hello\.sh org\.test\.Hello$"
+assert_file_has_content $FL_DIR/exports/share/applications/org.test.Hello.desktop "^Exec=.*flatpak run --branch=master --arch=$ARCH --command=hello\.sh org\.test\.Hello$"
assert_has_file $FL_DIR/exports/share/icons/hicolor/64x64/apps/org.test.Hello.png
assert_has_file $FL_DIR/exports/share/icons/HighContrast/64x64/apps/org.test.Hello.png
diff --git a/tests/test-run.sh b/tests/test-run.sh
index b28cf7b6..4f785f9d 100644
--- a/tests/test-run.sh
+++ b/tests/test-run.sh
@@ -45,7 +45,7 @@ assert_has_dir $FL_DIR/app/org.test.Hello/$ARCH/stable/active/files
assert_has_dir $FL_DIR/app/org.test.Hello/$ARCH/stable/active/export
assert_has_file $FL_DIR/exports/share/applications/org.test.Hello.desktop
# Ensure Exec key is rewritten
-assert_file_has_content $FL_DIR/exports/share/applications/org.test.Hello.desktop "^Exec=.*/flatpak run --branch=stable --arch=$ARCH --command=hello\.sh org\.test\.Hello$"
+assert_file_has_content $FL_DIR/exports/share/applications/org.test.Hello.desktop "^Exec=.*flatpak run --branch=stable --arch=$ARCH --command=hello\.sh org\.test\.Hello$"
assert_has_file $FL_DIR/exports/share/gnome-shell/search-providers/org.test.Hello.search-provider.ini
assert_file_has_content $FL_DIR/exports/share/gnome-shell/search-providers/org.test.Hello.search-provider.ini "^DefaultDisabled=true$"
assert_has_file $FL_DIR/exports/share/icons/hicolor/64x64/apps/org.test.Hello.png