Bug fix: rotate plugin
[geeqie.git] / scripts / test-all.sh
1 #!/bin/sh
2 #**********************************************************************
3 # Copyright (C) 2024 - The Geeqie Team
4 #
5 # Author: Colin Clark
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License along
18 # with this program; if not, write to the Free Software Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #**********************************************************************
21
22 ## @file
23 ## @brief Run all tests
24 ##
25 ## Run test with all options disabled,
26 ## and then with -Ddevel=enabled and other
27 ## options as auto
28
29 if [ ! -d "src" ] || [ ! -f "geeqie.1" ]
30 then
31         printf '%s\n' "This is not a Geeqie project folder"
32         exit 1
33 fi
34
35 XDG_CONFIG_HOME=$(mktemp -d "${TMPDIR:-/tmp}/geeqie.XXXXXXXXXX")
36 XDG_CACHE_HOME=$(mktemp -d "${TMPDIR:-/tmp}/geeqie.XXXXXXXXXX")
37 XDG_DATA_HOME=$(mktemp -d "${TMPDIR:-/tmp}/geeqie.XXXXXXXXXX")
38 export XDG_CONFIG_HOME
39 export XDG_CACHE_HOME
40 export XDG_DATA_HOME
41
42 rm --recursive --force build
43
44 # Check with all options disabled
45 meson setup \
46 -Darchive=disabled \
47 -Dcms=disabled \
48 -Ddevel=disabled \
49 -Ddoxygen=disabled \
50 -Ddjvu=disabled \
51 -Devince=disabled \
52 -Dexecinfo=disabled \
53 -Dexiv2=disabled \
54 -Dgit=disabled \
55 -Dgps-map=disabled \
56 -Dgtk4=disabled \
57 -Dheif=disabled \
58 -Dj2k=disabled \
59 -Djpeg=disabled \
60 -Djpegxl=disabled \
61 -Dlibraw=disabled \
62 -Dlua=disabled \
63 -Dpandoc=disabled \
64 -Dpdf=disabled \
65 -Dspell=disabled \
66 -Dtiff=disabled \
67 -Dvideothumbnailer=disabled \
68 -Dwebp=disabled \
69 -Dyelp-build=disabled \
70 build
71
72 meson test -C build
73
74 tmpdir=$(mktemp -d "${TMPDIR:-/tmp}/geeqie.XXXXXXXXXX")
75 cp ./build/meson-logs/testlog.txt "$tmpdir/testlog-options-disabled.txt"
76
77 rm --recursive --force build
78
79 meson setup -Ddevel=enabled build
80
81 meson test -C build
82
83 cp ./build/meson-logs/testlog.txt "$tmpdir/testlog-options-enabled.txt"
84
85 rm -r "$XDG_CONFIG_HOME"
86 rm -r "$XDG_CACHE_HOME"
87 rm -r "$XDG_DATA_HOME"