Project

General

Profile

Feature #1355 ยป 0047-Meson-Generate-rulesets_not_broken.sh.patch

Marko Lindqvist, 05/10/2025 03:09 AM

View differences:

meson.build
build_by_default: get_option('gitrev'))
rsloads = custom_target('rsloads', output: 'ruleset_loads.sh',
command: [sh_exe, files('tests/rs_test_res//generate_ruleset_loads.sh'),
'@OUTPUT@'])
command: [sh_exe,
files('tests/rs_test_res/generate_ruleset_loads.sh'),
'@OUTPUT@'])
rs_not_broken = custom_target('rs_not_broken', output: 'rulesets_not_broken.sh',
command: [sh_exe,
files('tests/generate_rs_not_broken.sh'),
'@OUTPUT@'],
depends: rsloads)
if host_system == 'windows'
tinycthr_files = files('dependencies/tinycthread/fc_tinycthread.c')
tests/Makefile.am
EXTRA_DIST = check_macros.sh \
copyright.sh \
fcintl.sh \
generate_rs_not_broken.sh \
header_guard.sh \
rulesets_not_broken.sh.in \
rulesets_save.sh.in \
tests/generate_rs_not_broken.sh
#!/usr/bin/env bash
#/***********************************************************************
# Freeciv - Copyright (C) 2017-2025
# 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, 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.
#
#***********************************************************************/
SRCDIR="$(cd $(dirname $0) ; pwd)"
(
echo "# Generated by generate_rs_not_broken.sh."
echo
echo "# rulesets_not_broken.sh [ruleset]..."
echo "# Exits with 0 when each specified ruleset or,"
echo "# if no rulesets are specified, each ruleset that "
echo "# is developed with Freeciv, are able to load."
echo "# Exits with 1 if any ruleset fails to load."
echo
echo "if test \"\$1\" = \"\" ; then"
echo " # Try to load all rulesets that are developed with Freeciv"
echo " rulesets=\"\$(cat ${SRCDIR}/rs_test_res/ruleset_list_dist.txt)\""
echo " optional=\"\$(cat ${SRCDIR}/rs_test_res/ruleset_list_opt.txt)\""
echo " for opt in \$optional ; do"
echo " if test -d \"${SRCDIR}/../data/\$opt\" ; then"
echo " rulesets=\"\$rulesets \$opt\""
echo " fi"
echo " done"
echo "else"
echo " # Try to load the specified ruleset(s)"
echo " rulesets=\$@"
echo "fi"
echo
echo "for ruleset in \$rulesets; do"
echo " echo \"Loading \$ruleset\""
echo " ./ruleset_loads.sh \$ruleset || exit 1"
echo "done"
echo
echo "echo \"No broken rulesets detected.\""
echo
echo "exit 0"
) > $1
chmod +x "$1"
    (1-1/1)