Revise testing
[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 ".git" ] || [ ! -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 rm --recursive --force build
36
37 # Check with all options disabled
38 meson setup \
39 -Darchive=disabled \
40 -Dcms=disabled \
41 -Ddevel=disabled \
42 -Ddoxygen=disabled \
43 -Ddjvu=disabled \
44 -Devince=disabled \
45 -Dexecinfo=disabled \
46 -Dexiv2=disabled \
47 -Dgit=disabled \
48 -Dgps-map=disabled \
49 -Dgtk4=disabled \
50 -Dheif=disabled \
51 -Dj2k=disabled \
52 -Djpeg=disabled \
53 -Djpegxl=disabled \
54 -Dlibraw=disabled \
55 -Dlua=disabled \
56 -Dpandoc=disabled \
57 -Dpdf=disabled \
58 -Dspell=disabled \
59 -Dtiff=disabled \
60 -Dvideothumbnailer=disabled \
61 -Dwebp=disabled \
62 -Dyelp-build=disabled \
63 build
64
65 meson test -C build
66
67 tmpdir=$(mktemp -d "${TMPDIR:-/tmp}/geeqie.XXXXXXXXXX")
68 cp ./build/meson-logs/testlog.txt "$tmpdir/testlog-options-disabled.txt"
69
70 rm --recursive --force build
71
72 meson setup -Ddevel=enabled build
73
74 meson test -C build
75
76 cp ./build/meson-logs/testlog.txt "$tmpdir/testlog-options-enabled.txt"