summaryrefslogtreecommitdiff
path: root/bin/ai/regression/completeness.sh
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2019-04-07 11:45:52 +0200
committerglx22 <glx22@users.noreply.github.com>2020-06-05 19:36:05 +0200
commit203a77c1dc722df677302e84c6d5c0d4cb06d8ee (patch)
treef14d2016746b24640b0dd8d7dd9d0b342ece9cde /bin/ai/regression/completeness.sh
parent84b71f796220b382c2bf943a406234ffb18098b8 (diff)
downloadopenttd-203a77c1dc722df677302e84c6d5c0d4cb06d8ee.tar.xz
Codechange: move regression outside of bin and make it work via CMake script
The tst_stationlist savegame had to be changed to start the correct AI. In the old setup, all regression AIs had the same name, which made it impossible to run both regressions in parallel. With the new setup this is possible. Although all files are available to run the regression, it won't really work till CMake is introduced (which will happen in a few commits from here)
Diffstat (limited to 'bin/ai/regression/completeness.sh')
-rwxr-xr-xbin/ai/regression/completeness.sh67
1 files changed, 0 insertions, 67 deletions
diff --git a/bin/ai/regression/completeness.sh b/bin/ai/regression/completeness.sh
deleted file mode 100755
index 46cee4ed3..000000000
--- a/bin/ai/regression/completeness.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-if ! [ -f ai/regression/completeness.sh ]; then
- echo "Make sure you are in the root of OpenTTD before starting this script."
- exit 1
-fi
-
-cat ai/regression/tst_*/main.nut | tr ';' '\n' | awk '
-/^function/ {
- for (local in locals) {
- delete locals[local]
- }
- if (match($0, "function Regression::Start") || match($0, "function Regression::Stop")) next
- locals["this"] = "AIControllerSquirrel"
-}
-
-/local/ {
- gsub(".*local", "local")
- if (match($4, "^AI")) {
- sub("\\(.*", "", $4)
- locals[$2] = $4
- }
-}
-
-/Valuate/ {
- gsub(".*Valuate\\(", "")
- gsub("\\).*", "")
- gsub(",.*", "")
- gsub("\\.", "::")
- print $0
-}
-
-/\./ {
- for (local in locals) {
- if (match($0, local ".")) {
- fname = substr($0, index($0, local "."))
- sub("\\(.*", "", fname)
- sub("\\.", "::", fname)
- sub(local, locals[local], fname)
- print fname
- if (match(locals[local], "List")) {
- sub(locals[local], "AIAbstractList", fname)
- print fname
- }
- }
- }
- # We want to remove everything before the FIRST occurrence of AI.
- # If we do not remove any other occurrences of AI from the string
- # we will remove everything before the LAST occurrence of AI, so
- # do some little magic to make it work the way we want.
- sub("AI", "AXXXXY")
- gsub("AI", "AXXXXX")
- sub(".*AXXXXY", "AI")
- if (match($0, "^AI") && match($0, ".")) {
- sub("\\(.*", "", $0)
- sub("\\.", "::", $0)
- print $0
- }
-}
-' | sed 's/ //g' | sort | uniq > tmp.in_regression
-
-grep 'DefSQ.*Method' ../src/script/api/ai/*.hpp.sq | grep -v 'AIError::' | grep -v 'AIAbstractList::Valuate' | grep -v '::GetClassName' | sed 's/^[^,]*, &//g;s/,[^,]*//g' | sort > tmp.in_api
-
-diff -u tmp.in_regression tmp.in_api | grep -v '^+++' | grep '^+' | sed 's/^+//'
-
-rm -f tmp.in_regression tmp.in_api
-