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:
mkdir bin
@mkdir bin
bin/example: bin/Makefile
bin/server: bin/Makefile
cd bin ; make
bin/Makefile: bin
bin/Makefile: CMakeLists.txt | bin
cd bin ; cmake ..
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 *entry_point = NULL;
static const char *inifile = "eressea.ini";
static const char *logfile="eressea.log";
static int memdebug = 0;
static void parse_config(const char *filename)
@ -96,6 +97,9 @@ static int parse_args(int argc, char **argv, int *exitcode)
case 'C':
entry_point = NULL;
break;
case 'l':
logfile = argv[i][2] ? argv[i]+2 : argv[++i];
break;
case 'e':
entry_point = argv[i][2] ? argv[i]+2 : argv[++i];
break;
@ -157,14 +161,14 @@ int main(int argc, char **argv)
parse_config(inifile);
log_open("eressea.log");
locale_init();
err = parse_args(argc, argv, &result);
if (err) {
return result;
}
log_open(logfile);
locale_init();
err = eressea_init();
if (err) {
log_error("initialization failed with code %d\n", err);