File: test.sh

package info (click to toggle)
warzone2100 4.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 660,320 kB
  • sloc: cpp: 676,209; ansic: 391,201; javascript: 78,238; python: 16,632; php: 4,294; sh: 4,094; makefile: 2,629; lisp: 1,492; cs: 489; xml: 404; perl: 224; ruby: 156; java: 89
file content (53 lines) | stat: -rwxr-xr-x 1,339 bytes parent folder | download | duplicates (4)
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
#!/bin/bash

rm -rf tmp
mkdir -p tmp

trap ctrl_c INT

function ctrl_c() {
	echo " * Caught ctrl+c - aborting!"
	exit 1
}

function run
{
	echo
	echo " -- $2 --"
	echo
	gdb -q --ex run --ex quit --args src/warzone2100 --window --configdir=tmp --resolution=1024x768 --shadows --sound --texturecompression $1
}

function cam
{
	echo
	echo " ==== $2 ===="
	run "--game=$1 --saveandquit=savegames/campaign/$1.gam" "Initial run"
	run "--loadcampaign=$1 --saveandquit=savegames/campaign/$1-loadsave.gam" "Loadsave run"
}

function skirmish
{
	echo
	echo " ==== $1 : $2 ===="
	run "--skirmish=$1.json --autogame" "$1 : Running"
	# TBD: Use the below instead when we have ported player part of savegames to JSON, and can save more AI state. For now,
	# this will crash, because it expects an AI name. We do not want to use AI names for challenge files.
	#run "--skirmish=$1.json --autogame --saveandquit=savegames/skirmish/$1.gam" "$1 : Launching and saving"
	#run "--autogame --loadskirmish=$1" "$1 : Loading and running"
}

echo
echo "Running Warzone2100 automated tests"
echo -n "Time is: "
date -R

cam CAM_1A "Alpha campaign"
cam CAM_2A "Beta campaign"
cam CAM_3A "Gamma campaign"
cam TUTORIAL3 "Tutorial"
cam FASTPLAY "Fastplay"

skirmish highground "Basic skirmish"
skirmish miza "All AIs"
skirmish miza_challenge "Best AI vs 7 old timers"