Skip to content

Commit 4af63f9

Browse files
authored
Merge pull request #6767 from wilzbach/run_unittests
Run dmd internal unittests on CIs
2 parents 270dddd + fed25ec commit 4af63f9

4 files changed

Lines changed: 10 additions & 1 deletion

File tree

circleci.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ coverage()
114114
make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd clean
115115
make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd ENABLE_COVERAGE=1
116116
117+
cp $build_path/dmd _${build_path}/host_dmd_cov
118+
make -j1 -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd_cov ENABLE_COVERAGE=1 unittest
117119
make -j1 -C test MODEL=$MODEL ARGS="-O -inline -release" DMD_TEST_COVERAGE=1
118120
}
119121

posix.mak

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ECTAGS_FILES = src/*.[chd] src/backend/*.[chd] src/root/*.[chd] src/tk/*.[chd]
55
.PHONY: all clean test install auto-tester-build auto-tester-test toolchain-info
66

77
all:
8-
$(QUIET)$(MAKE) -C src -f posix.mak
8+
$(QUIET)$(MAKE) -C src -f posix.mak all
99

1010
auto-tester-build: toolchain-info
1111
$(QUIET)$(MAKE) -C src -f posix.mak auto-tester-build ENABLE_RELEASE=1
@@ -21,6 +21,7 @@ clean:
2121
$(RM) tags
2222

2323
test:
24+
$(QUIET)$(MAKE) -C src -f posix.mak unittest
2425
$(QUIET)$(MAKE) -C test -f Makefile
2526

2627
html:

src/ddmd/mars.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,7 @@ Language changes listed by -transition=id:
10821082
* Returns:
10831083
* Return code of the application
10841084
*/
1085+
version(unittest) {} else
10851086
int main()
10861087
{
10871088
import core.memory;

src/posix.mak

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,11 @@ $G/dmd: $(DMD_SRCS) $(ROOT_SRCS) $G/newdelete.o $G/backend.a $G/lexer.a $(STRING
461461
CC="$(HOST_CXX)" $(HOST_DMD_RUN) -of$@ $(MODEL_FLAG) -vtls -J$G -J../res -L-lstdc++ $(DFLAGS) $(filter-out $(STRING_IMPORT_FILES) $(HOST_DMD_PATH) $(LEXER_ROOT),$^)
462462
endif
463463

464+
$G/dmd-unittest: $(DMD_SRCS) $(ROOT_SRCS) $G/newdelete.o $G/lexer.a $(G_GLUE_OBJS) $(G_OBJS) $(STRING_IMPORT_FILES) $(HOST_DMD_PATH)
465+
CC=$(HOST_CXX) $(HOST_DMD_RUN) -of$@ $(MODEL_FLAG) -vtls -J$G -J../res -L-lstdc++ $(DFLAGS) -g -unittest -main $(filter-out $(STRING_IMPORT_FILES) $(HOST_DMD_PATH),$^)
466+
467+
unittest: $G/dmd-unittest
468+
$<
464469

465470
clean:
466471
rm -R $(GENERATED)

0 commit comments

Comments
 (0)