Skip to content

Commit 39d1916

Browse files
committed
CI: test gdmd
Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
1 parent 829e771 commit 39d1916

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
matrix:
1818
os: [ macos-latest, ubuntu-latest, windows-latest ]
1919
dc: [ dmd-latest, ldc-latest ]
20+
include:
21+
- { os: ubuntu-latest, dc: gdc-14 }
2022
name: ${{ matrix.os }}, ${{ matrix.dc }}
2123
runs-on: ${{ matrix.os }}
2224
timeout-minutes: 10
@@ -28,6 +30,7 @@ jobs:
2830
uses: dlang-community/setup-dlang@v2
2931
with:
3032
compiler: ${{ matrix.dc }}
33+
dub: latest
3134
# rdmd_test.d needs this
3235
- name: Set DMD to its basename without extension
3336
run: |

Makefile

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ DUB=dub
99
WITH_DOC = no
1010
DOC = ../dlang.org
1111

12+
ifneq (,$(findstring gdmd,$(notdir $(DMD))))
13+
DC_IS_GDC=1
14+
endif
15+
1216
# Load operating system $(OS) (e.g. linux, osx, ...) and $(MODEL) (e.g. 32, 64) detection Makefile from dmd
1317
$(shell [ ! -d $(DMD_DIR) ] && git clone --depth=1 https://github.com/dlang/dmd $(DMD_DIR))
1418
include $(DMD_DIR)/compiler/src/osmodel.mak
@@ -52,7 +56,12 @@ DOC_TOOLS = \
5256
TEST_TOOLS = \
5357
$(ROOT)/rdmd_test$(DOTEXE)
5458

55-
all: $(TOOLS) $(CURL_TOOLS) $(ROOT)/dustmite$(DOTEXE)
59+
all = $(TOOLS) $(CURL_TOOLS)
60+
ifndef DC_IS_GDC
61+
# dustmite fails to build with gdc: https://github.com/dlang/tools/pull/476
62+
all += $(ROOT)/dustmite$(DOTEXE)
63+
endif
64+
all: $(all)
5665

5766
rdmd: $(ROOT)/rdmd$(DOTEXE)
5867
ddemangle: $(ROOT)/ddemangle$(DOTEXE)
@@ -87,6 +96,7 @@ install: $(TOOLS) $(CURL_TOOLS) $(ROOT)/dustmite$(DOTEXE)
8796
clean:
8897
rm -rf $(GENERATED)
8998

99+
$(ROOT)/tests_extractor$(DOTEXE): override DFLAGS += -allinst # For gdmd
90100
$(ROOT)/tests_extractor$(DOTEXE): tests_extractor.d
91101
mkdir -p $(ROOT)
92102
DFLAGS="$(DFLAGS)" $(DUB) build \
@@ -124,19 +134,29 @@ ifeq (osx,$(OS))
124134
# /tmp is a symlink on Mac, and rdmd_test.d doesn't like it
125135
test_rdmd: export TMPDIR=$(shell cd /tmp && pwd -P)
126136
endif
127-
test_rdmd: $(ROOT)/rdmd_test$(DOTEXE) $(RDMD_TEST_EXECUTABLE)
137+
138+
all_rdmd_tests = ut
139+
ifndef DC_IS_GDC
140+
# rdmd_test.d fails with gdmd, see: https://github.com/dlang/tools/pull/469
141+
all_rdmd_tests += it
142+
endif
143+
test_rdmd: $(all_rdmd_tests:%=test_rdmd_%)
144+
145+
test_rdmd_ut: rdmd.d
146+
$(DMD) $(DFLAGS) -unittest -main -run rdmd.d
147+
148+
test_rdmd_it: $(ROOT)/rdmd_test$(DOTEXE) $(RDMD_TEST_EXECUTABLE)
128149
$< $(RDMD_TEST_EXECUTABLE) $(MODEL_FLAG) \
129150
--rdmd-default-compiler=$(RDMD_TEST_DEFAULT_COMPILER) \
130151
--test-compilers=$(RDMD_TEST_COMPILERS) \
131152
$(VERBOSE_RDMD_TEST_FLAGS)
132-
$(DMD) $(DFLAGS) -unittest -main -run rdmd.d
133153

134154
test: test_tests_extractor test_rdmd
135155

136156
ifeq ($(WITH_DOC),yes)
137157
all install: $(DOC_TOOLS)
138158
endif
139159

140-
.PHONY: all install clean
160+
.PHONY: all install clean test_rdmd test_rdmd_ut test_rdmd_it
141161

142162
.DELETE_ON_ERROR: # GNU Make directive (delete output files on error)

0 commit comments

Comments
 (0)