Advanced Strategic Command
maptest.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * *
3  * This program is free software; you can redistribute it and/or modify *
4  * it under the terms of the GNU General Public License as published by *
5  * the Free Software Foundation; either version 2 of the License, or *
6  * (at your option) any later version. *
7  * *
8  ***************************************************************************/
9 
10 #include <iostream>
11 
12 #include "../actions/jumpdrivecommand.h"
13 #include "../loaders.h"
14 #include "../itemrepository.h"
15 #include "unittestutil.h"
16 #include "../gamemap.h"
17 #include "../lua/luarunner.h"
18 #include "../lua/luastate.h"
19 #include "../spfst-legacy.h"
20 
21 
22 void runScript( const ASCString& script )
23 {
24  LuaState state;
25  LuaRunner runner( state );
26  runner.runFile( script );
27  assertOrThrow( runner.getErrors().empty() );
28 }
29 
30 void testMaps()
31 {
32  auto_ptr<GameMap> game ( startMap("kam005.map"));
33  actmap = game.get();
34  runScript( "kam005.lua" );
35  actmap = NULL;
36 }
37 
#define assertOrThrow(expr)
Definition: errors.h:69
void runFile(const ASCString &filename)
Definition: luarunner.cpp:25
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
void testMaps()
Definition: maptest.cpp:30
GameMap * startMap(const ASCString &filename)
void runScript(const ASCString &script)
Definition: maptest.cpp:22
const ASCString & getErrors()
Definition: luarunner.cpp:61
GameMap * actmap
Definition: spfst.cpp:64