Skip to content

Commit

Permalink
Fix unittest build
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed Sep 17, 2015
1 parent 2c94b22 commit 75abf1e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/dunittest.d
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

module ddmd.dunittest;

import ddmd.root.aav;
import ddmd.root.speller;
import ddmd.imphint;

extern (C++) void unittests()
{
version (unittest)
Expand Down
2 changes: 1 addition & 1 deletion src/posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ endif
# Append different flags for debugging, profiling and release.
ifdef ENABLE_DEBUG
CFLAGS += -g -g3 -DDEBUG=1 -DUNITTEST
DFLAGS += -g -debug
DFLAGS += -g -debug -unittest
endif
ifdef ENABLE_RELEASE
CFLAGS += -O2
Expand Down
6 changes: 3 additions & 3 deletions src/root/speller.d
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ version (unittest)
[null, null, null]
];
//printf("unittest_speller()\n");
const(void)* p = speller("hello", &speller_test, cast(void*)"hell", idchars);
const(void)* p = speller(cast(const(char)*)"hello", &speller_test, cast(char*)"hell", idchars);
assert(p !is null);
for (int i = 0; cases[i][0]; i++)
{
//printf("case [%d]\n", i);
void* p = speller(cases[i][0], &speller_test, cast(void*)cases[i][1], idchars);
if (p)
void* p2 = speller(cases[i][0], &speller_test, cast(void*)cases[i][1], idchars);
if (p2)
assert(cases[i][2][0] == 'y');
else
assert(cases[i][2][0] == 'n');
Expand Down
4 changes: 2 additions & 2 deletions src/win32.mak
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ release:
$(DMDMAKE) clean

debdmd:
$(DMDMAKE) "OPT=" "DEBUG=-D -g -DUNITTEST" "DDEBUG=-debug -g" "DOPT=" "LFLAGS=-L/ma/co/la" $(TARGETEXE)
$(DMDMAKE) "OPT=" "DEBUG=-D -g -DUNITTEST" "DDEBUG=-debug -g -unittest" "DOPT=" "LFLAGS=-L/ma/co/la" $(TARGETEXE)

reldmd:
$(DMDMAKE) "OPT=-o" "DEBUG=" "DDEBUG=" "DOPT=-O -release -inline" "LFLAGS=-L/delexe/la" $(TARGETEXE)

trace:
$(DMDMAKE) "OPT=-o" "DEBUG=-gt -Nc" "DDEBUG=-debug -g" "DOPT=" "LFLAGS=-L/ma/co/delexe/la" $(TARGETEXE)
$(DMDMAKE) "OPT=-o" "DEBUG=-gt -Nc" "DDEBUG=-debug -g -unittest" "DOPT=" "LFLAGS=-L/ma/co/delexe/la" $(TARGETEXE)

################################ Libraries ##################################

Expand Down

0 comments on commit 75abf1e

Please sign in to comment.