make tests

do not write a logfile during tests
This commit is contained in:
Enno Rehling 2012-06-01 17:59:01 -07:00
parent a65a176ba0
commit 09336e35e8
2 changed files with 14 additions and 7 deletions

View file

@ -1,12 +1,15 @@
all: bin/example all: tests
tests: bin/server
@bin/server -l/dev/null --tests
bin: bin:
mkdir bin @mkdir bin
bin/example: bin/Makefile bin/server: bin/Makefile
cd bin ; make cd bin ; make
bin/Makefile: bin bin/Makefile: CMakeLists.txt | bin
cd bin ; cmake .. cd bin ; cmake ..
clean: clean:

View file

@ -35,6 +35,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
static const char *luafile = "setup.lua"; static const char *luafile = "setup.lua";
static const char *entry_point = NULL; static const char *entry_point = NULL;
static const char *inifile = "eressea.ini"; static const char *inifile = "eressea.ini";
static const char *logfile="eressea.log";
static int memdebug = 0; static int memdebug = 0;
static void parse_config(const char *filename) static void parse_config(const char *filename)
@ -96,6 +97,9 @@ static int parse_args(int argc, char **argv, int *exitcode)
case 'C': case 'C':
entry_point = NULL; entry_point = NULL;
break; break;
case 'l':
logfile = argv[i][2] ? argv[i]+2 : argv[++i];
break;
case 'e': case 'e':
entry_point = argv[i][2] ? argv[i]+2 : argv[++i]; entry_point = argv[i][2] ? argv[i]+2 : argv[++i];
break; break;
@ -157,14 +161,14 @@ int main(int argc, char **argv)
parse_config(inifile); parse_config(inifile);
log_open("eressea.log");
locale_init();
err = parse_args(argc, argv, &result); err = parse_args(argc, argv, &result);
if (err) { if (err) {
return result; return result;
} }
log_open(logfile);
locale_init();
err = eressea_init(); err = eressea_init();
if (err) { if (err) {
log_error("initialization failed with code %d\n", err); log_error("initialization failed with code %d\n", err);