[retro-gtk] Add a script for running tests locally



commit 8f0f2c767d56a897c98debe3fc7642a34b01295a
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Thu Feb 20 01:40:28 2020 +0500

    Add a script for running tests locally
    
    Currently running tests involves lots of manual steps, which are only
    documented as a CI job. Make it a little more convenient.

 run-tests.sh | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
---
diff --git a/run-tests.sh b/run-tests.sh
new file mode 100755
index 0000000..3e1e7c4
--- /dev/null
+++ b/run-tests.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+MANIFEST_PATH="flatpak/org.gnome.Retro.UnitTests.json"
+FLATPAK_MODULE="retro-gtk"
+FLATPAK_BUILD_DIR="unit-tests/unit-tests"
+MESON_ARGS="--libdir=lib -Dinstall-tests=true"
+
+rm -rf ${FLATPAK_BUILD_DIR}
+flatpak-builder --stop-at=${FLATPAK_MODULE} ${FLATPAK_BUILD_DIR} ${MANIFEST_PATH}
+flatpak build ${FLATPAK_BUILD_DIR} meson --prefix=/app ${MESON_ARGS} unit-tests/build
+flatpak build ${FLATPAK_BUILD_DIR} ninja -C unit-tests/build install
+flatpak-builder --finish-only --repo=unit-tests/repo ${FLATPAK_BUILD_DIR} ${MANIFEST_PATH}
+
+if [[ -z "${DISPLAY}" ]]; then
+    xvfb-run -a -s "-screen 0 1024x768x24" flatpak-builder --run ${FLATPAK_BUILD_DIR} ${MANIFEST_PATH} 
retro-unit-tests
+else
+    flatpak-builder --run ${FLATPAK_BUILD_DIR} ${MANIFEST_PATH} retro-unit-tests
+fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]