File: testExamples.sh

package info (click to toggle)
gjs 1.87.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 7,128 kB
  • sloc: cpp: 38,390; javascript: 31,939; ansic: 15,994; sh: 1,743; python: 791; xml: 137; makefile: 40
file content (35 lines) | stat: -rwxr-xr-x 1,241 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
# SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
# SPDX-FileCopyrightText: 2018 Claudio André <claudioandre.br@gmail.com>

DIR="$( cd "$( dirname "${0}" )" && pwd )"
# shellcheck disable=SC1091
. "${DIR}"/common.sh

# Run the examples
# shellcheck disable=SC2154 # It's defined in common.sh
$gjs -m examples/gio-cat.js meson.build
report "run the gio-cat.js example"

if [ -n "${ENABLE_GTK}" ]; then
    export graphical_gjs="xvfb-run -a dbus-run-session -- $gjs"

    eval timeout 5s "$graphical_gjs" -m examples/calc.js
    report_timeout "run the calc.js example"

    eval timeout 5s "$graphical_gjs" -m examples/gtk3.js
    report_timeout "run the gtk3.js example"

    eval timeout 5s "$graphical_gjs" -m examples/gtk-application.js
    report_timeout "run the gtk-application.js example"

    eval timeout 5s "$graphical_gjs" -m examples/gettext.js
    report_timeout "run the gettext.js example"
else
    skip "run the calc.js example" "running without GTK"
    skip "run the gtk3.js example" "running without GTK"
    skip "run the gtk-application.js example" "running without GTK"
    skip "run the gettext.js example" "running without GTK"
fi
# shellcheck disable=SC2154 # It's defined in common.sh
echo "1..$total"