From 287ffe2ccf6dfe5ccaea199b6a491989eef4d375 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Tue, 2 Mar 2021 02:55:18 +0100 Subject: [PATCH] CI: factor out rulesets_upgrade.sh Make testing ruleset upgrade from the previous version a separate script. See osdn #41684 --- configure.ac | 2 ++ scripts/ci-build.sh | 3 +-- tests/.gitignore | 1 + tests/Makefile.am | 1 + tests/rulesets_upgrade.sh.in | 11 +++++++++++ 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 tests/rulesets_upgrade.sh.in diff --git a/configure.ac b/configure.ac index 406eb04a98..4816faefe5 100644 --- a/configure.ac +++ b/configure.ac @@ -1811,6 +1811,8 @@ AC_CONFIG_FILES([tests/rulesets_not_broken.sh], [chmod +x tests/rulesets_not_broken.sh]) AC_CONFIG_FILES([tests/rulesets_save.sh], [chmod +x tests/rulesets_save.sh]) +AC_CONFIG_FILES([tests/rulesets_upgrade.sh], + [chmod +x tests/rulesets_upgrade.sh]) AC_CONFIG_FILES([tests/rs_test_res/ruleset_loads.sh], [chmod +x tests/rs_test_res/ruleset_loads.sh]) AC_CONFIG_FILES([tests/rulesets_autohelp.sh], diff --git a/scripts/ci-build.sh b/scripts/ci-build.sh index 5868bbef95..2061ae1686 100755 --- a/scripts/ci-build.sh +++ b/scripts/ci-build.sh @@ -125,8 +125,7 @@ echo "Ruleset upgrade" echo "Preparing test data" ../tests/rs_test_res/upgrade_ruleset_sync.bash echo "Checking ruleset upgrade" -FREECIV_DATA_PATH="../tests/rs_test_res/upgrade_rulesets:$FREECIV_DATA_PATH" \ - ./tests/rulesets_save.sh `cat ../tests/rs_test_res/upgrade_ruleset_list.txt` +./tests/rulesets_upgrade.sh # Check ruleset autohelp generation echo "Checking ruleset auto help generation" diff --git a/tests/.gitignore b/tests/.gitignore index d2eb7acd1f..a8ddf2421c 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -4,4 +4,5 @@ /check-output /rulesets_not_broken.sh /rulesets_save.sh +/rulesets_upgrade.sh /rulesets_autohelp.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index 7a40ea184d..2d0affa246 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -23,6 +23,7 @@ EXTRA_DIST = check_macros.sh \ header_guard.sh \ rulesets_not_broken.sh.in \ rulesets_save.sh.in \ + rulesets_upgrade.sh.in \ rs_test_res/ruleset_is.lua \ rs_test_res/ruleset_list.txt \ rs_test_res/ruleset_loads.sh.in \ diff --git a/tests/rulesets_upgrade.sh.in b/tests/rulesets_upgrade.sh.in new file mode 100644 index 0000000000..8a6809872c --- /dev/null +++ b/tests/rulesets_upgrade.sh.in @@ -0,0 +1,11 @@ +#!/bin/bash + +# rulesets_upgrade.sh +# Exits with 0 when each ruleset specified in upgrade_ruleset_list.txt can +# be saved using ruleup. +# Exits with 1 if not. +# If KEEP_RESULT_IN_DIR is set to a folder the saved result will be kept +# there for later inspection even if nothing fails. + +FREECIV_DATA_PATH="@abs_top_srcdir@/tests/rs_test_res/upgrade_rulesets:$FREECIV_DATA_PATH" \ + ./tests/rulesets_save.sh `cat @abs_top_srcdir@/tests/rs_test_res/upgrade_ruleset_list.txt` -- 2.20.1