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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
#!/bin/sh
#**********************************************************************
# Copyright (C) 2024 - The Geeqie Team
#
# Author: Colin Clark
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#**********************************************************************
## @file
## @brief Run all tests
##
## Run test with all options disabled,
## and then with -Ddevel=enabled and other
## options as auto
if [ ! -d "src" ] || [ ! -f "geeqie.1" ]
then
printf '%s\n' "This is not a Geeqie project folder"
exit 1
fi
XDG_CONFIG_HOME=$(mktemp -d "${TMPDIR:-/tmp}/geeqie.XXXXXXXXXX")
XDG_CACHE_HOME=$(mktemp -d "${TMPDIR:-/tmp}/geeqie.XXXXXXXXXX")
XDG_DATA_HOME=$(mktemp -d "${TMPDIR:-/tmp}/geeqie.XXXXXXXXXX")
export XDG_CONFIG_HOME
export XDG_CACHE_HOME
export XDG_DATA_HOME
rm --recursive --force build
tmpdir=$(mktemp -d "${TMPDIR:-/tmp}/geeqie.XXXXXXXXXX")
# Check with all options disabled
meson setup \
-Darchive=disabled \
-Dcms=disabled \
-Ddoxygen=disabled \
-Ddjvu=disabled \
-Devince=disabled \
-Dexecinfo=disabled \
-Dexiv2=disabled \
-Dextended_stacktrace=disabled \
-Dgit=disabled \
-Dgps-map=disabled \
-Dgtk4=disabled \
-Dheif=disabled \
-Dhelp_pdf=disabled \
-Dj2k=disabled \
-Djpeg=disabled \
-Djpegxl=disabled \
-Dlibraw=disabled \
-Dlua=disabled \
-Dpandoc=disabled \
-Dpdf=disabled \
-Dspell=disabled \
-Dtiff=disabled \
-Dunit_tests=disabled \
-Dvideothumbnailer=disabled \
-Dwebp=disabled \
-Dyelp-build=disabled \
build
if meson test -C build
then
options_disabled="PASS"
else
options_disabled="FAIL"
fi
cp ./build/meson-logs/meson-log.txt "$tmpdir/testlog-options-disabled.txt"
cat ./build/meson-logs/testlog.txt >> "$tmpdir/testlog-options-disabled.txt"
rm --recursive --force build
meson setup -Dunit_tests=enabled build
if meson test -C build
then
options_enabled="PASS"
else
options_enabled="FAIL"
fi
cp ./build/meson-logs/meson-log.txt "$tmpdir/testlog-options-enabled.txt"
cat ./build/meson-logs/testlog.txt >> "$tmpdir/testlog-options-enabled.txt"
rm -r "$XDG_CONFIG_HOME"
rm -r "$XDG_CACHE_HOME"
rm -r "$XDG_DATA_HOME"
printf "\n"
if [ "$options_disabled" = "PASS" ]
then
printf "%s \033[1;32m PASS \033[0m\n" "$tmpdir/testlog-options-disabled.txt"
else
printf "%s \033[1;31m FAIL \033[0m\n" "$tmpdir/testlog-options-disabled.txt"
fi
if [ "$options_enabled" = "PASS" ]
then
printf "%s \033[1;32m PASS \033[0m\n" "$tmpdir/testlog-options-enabled.txt"
else
printf "%s \033[1;31m FAIL \033[0m\n" "$tmpdir/testlog-options-enabled.txt"
fi
|