summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/test
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-03-24 01:08:30 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-03-24 01:15:35 +0100
commit41de0b3ea907059252f592a2a1eca1feaa977f3c (patch)
tree711a2e40a6e0e10c0742679fff3dc1e9d0a7933f /crawl-ref/source/test
parentc5d23a8a1bf1365cdce98757a820d6dd3a557ecd (diff)
downloadcrawl-ref-41de0b3ea907059252f592a2a1eca1feaa977f3c.tar.gz
crawl-ref-41de0b3ea907059252f592a2a1eca1feaa977f3c.zip
Two canned tests in the Abyss.
One includes holding '5' with monster spawns disabled; useful for benchmarking Abyss morphs with no shifts other than timed ones. The second one is the Abyss bot, limited to 1000 turns. It's about twice as slow as the former, testing monster spawns as well, combat, scrolling shifts. Unlike the bot, it doesn't use Xom, as that costs yet another ~20% speed (we probably should optimize tension, too!).
Diffstat (limited to 'crawl-ref/source/test')
-rw-r--r--crawl-ref/source/test/stress/abyssr.rc76
-rw-r--r--crawl-ref/source/test/stress/abyssw.rc41
-rwxr-xr-xcrawl-ref/source/test/stress/run8
-rwxr-xr-xcrawl-ref/source/test/stress/timeall2
4 files changed, 125 insertions, 2 deletions
diff --git a/crawl-ref/source/test/stress/abyssr.rc b/crawl-ref/source/test/stress/abyssr.rc
new file mode 100644
index 0000000000..a8ebc84f5d
--- /dev/null
+++ b/crawl-ref/source/test/stress/abyssr.rc
@@ -0,0 +1,76 @@
+# A timed through the Abyss.
+#
+# Usage: ./crawl --no-save --rc test/stress/abyss.rc
+#
+# Wizmode is needed.
+
+name = Abyss_walker
+species = mu
+background = be
+# CK is slowed down by constant tension checks.
+weapon = mace
+restart_after_game = false
+show_gold_turns = true
+show_more = false
+autofight_stop = 0
+
+Lua{
+bot_start = true
+last_turn = -1
+local cmds = {string.char(9), 'u', 'k', 'l', 'n', '.'}
+function ready()
+ local esc = string.char(27)
+ local eol = string.char(13)
+ if you.turns() == 0 and bot_start then
+ bot_start = false
+ crawl.enable_more(false)
+ crawl.sendkeys("&Y" .. esc)
+ crawl.sendkeys("&" .. string.char(20) ..
+ "debug.disable('confirmations')" .. eol ..
+ "debug.disable('death')" .. eol ..
+ --# don't let them stop us gearing up
+ "debug.disable('mon_act')" .. eol .. esc)
+ crawl.sendkeys("&Y" .. esc)
+ crawl.sendkeys("&" .. string.char(12) .. "27" .. eol .. "N")
+ crawl.sendkeys("&A27" .. eol)
+ crawl.sendkeys("&@27 12 12" .. eol)
+ crawl.sendkeys("&o)demon whip" .. eol .. "chaos" .. eol)
+ crawl.sendkeys("g&o[boots" .. eol .. "running" .. eol)
+ crawl.sendkeys("g&o[gold dragon armour" .. eol .. "flying" .. eol)
+ crawl.sendkeys("g&o[large shield" .. eol .. "reflection" .. eol)
+ crawl.sendkeys("g&o[helmet" .. eol .. "see invis" .. eol)
+ crawl.sendkeys("g&o[gloves" .. eol .. "strength" .. eol)
+ crawl.sendkeys("g&o[cloak" .. eol .. "preservation" .. eol)
+ --# somehow ga doesn't work... why?
+ crawl.sendkeys("gwcWdWeWfWgWhWi")
+ crawl.sendkeys("&tca9" .. eol .. "b9" .. eol .. esc)
+ crawl.sendkeys("&tda2" .. eol .. esc)
+ crawl.sendkeys("&tea12" .. eol .. esc)
+ crawl.sendkeys("&tfa3" .. eol .. esc)
+ crawl.sendkeys("&tga2" .. eol .. esc)
+ crawl.sendkeys("&tha2" .. eol .. esc)
+ crawl.sendkeys("&tia2" .. eol .. esc)
+ crawl.sendkeys("ah") -- flight
+ --# re-enable monsters
+ crawl.sendkeys("&" .. string.char(20) ..
+ "debug.disable('mon_act', false)" .. eol .. esc)
+ --# exit the Abyss then go back, so it's not the special starting Abyss
+ crawl.sendkeys("&B")
+ end
+ if you.turns() ~= last_turn then
+ command = 1
+ last_turn = you.turns()
+
+ if you.turns() >= 1000 then
+ crawl.sendkeys("*qyes" .. eol .. esc .. esc)
+ end
+ else
+ command = command + 1
+ end
+ --# don't spam
+ if (command == 1) and you.feel_safe() then
+ command = 2
+ end
+ crawl.sendkeys(cmds[command])
+end
+}
diff --git a/crawl-ref/source/test/stress/abyssw.rc b/crawl-ref/source/test/stress/abyssw.rc
new file mode 100644
index 0000000000..88e26051ce
--- /dev/null
+++ b/crawl-ref/source/test/stress/abyssw.rc
@@ -0,0 +1,41 @@
+# Waiting only in the Abyss, no monsters.
+#
+# Usage: ./crawl --no-save --rc test/stress/abyssw.rc
+#
+# Wizmode is needed.
+
+name = Abyss_walker
+species = mu
+background = fi
+weapon = mace
+restart_after_game = false
+show_gold_turns = true
+show_more = false
+autofight_stop = 0
+
+Lua{
+bot_start = true
+last_turn = -1
+local cmds = {string.char(9), 'u', 'k', 'l', 'n', '.'}
+function ready()
+ local esc = string.char(27)
+ local eol = string.char(13)
+ if you.turns() == 0 and bot_start then
+ bot_start = false
+ crawl.enable_more(false)
+ crawl.sendkeys("&Y" .. esc)
+ crawl.sendkeys("&" .. string.char(20) ..
+ "debug.disable('confirmations')" .. eol ..
+ "debug.disable('death')" .. eol ..
+ "debug.disable('spawns')" .. eol .. esc)
+ crawl.sendkeys("&Y" .. esc)
+ crawl.sendkeys("&" .. string.char(12) .. "27" .. eol .. "N")
+ crawl.sendkeys("&B")
+ end
+ if you.turns() < 2000 then
+ crawl.sendkeys('5')
+ else
+ crawl.sendkeys("*qyes" .. eol .. esc .. esc)
+ end
+end
+}
diff --git a/crawl-ref/source/test/stress/run b/crawl-ref/source/test/stress/run
index f2612ab906..44ee7e3373 100755
--- a/crawl-ref/source/test/stress/run
+++ b/crawl-ref/source/test/stress/run
@@ -27,6 +27,12 @@ run_one()
7|kraken)
$CRAWL -arena 'kraken v spectral kraken arena:small_deep_pool delay:0 t:20'
;;
+ 8|abyss_rest)
+ $CRAWL -rc test/stress/abyssw.rc
+ ;;
+ 9|abyss_walk)
+ $CRAWL -rc test/stress/abyssr.rc
+ ;;
test) # Not in "all".
$CRAWL -test
;;
@@ -38,7 +44,7 @@ run_one()
if [ "$*" = "all" ]
then
- for x in 1 2 3 4 5 6 7; do run_one "$x";done
+ for x in 1 2 3 4 5 6 7 8 9; do run_one "$x";done
exit $?
fi
diff --git a/crawl-ref/source/test/stress/timeall b/crawl-ref/source/test/stress/timeall
index 54be36edd1..27293ce0d2 100755
--- a/crawl-ref/source/test/stress/timeall
+++ b/crawl-ref/source/test/stress/timeall
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
-my @TESTS = 1..5;
+my @TESTS = qw(1 2 3 4 5 8);
my $NTRIES = 5;
!system("./crawl --builddb") or die "Rebuilding the db failed -- bailing.\n";