1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
|
# $Id: Makefile.kmk 20647 2009-06-16 21:58:09Z vboxsync $
## @file
# Sub-Makefile for the IPRT testcases.
#
#
# Copyright (C) 2006-2009 Sun Microsystems, Inc.
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# The contents of this file may alternatively be used under the terms
# of the Common Development and Distribution License Version 1.0
# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
# VirtualBox OSE distribution, in which case the provisions of the
# CDDL are applicable instead of those of the GPL.
#
# You may elect to license modified versions of this file under the
# terms and conditions of either the GPL or the CDDL or both.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
# Clara, CA 95054 USA or visit http://www.sun.com if you need
# additional information or have any questions.
#
SUB_DEPTH = ../../../..
include $(KBUILD_PATH)/subheader.kmk
ifdef VBOX_WITH_TESTCASES
#
# Globals
#
# WARNING: Careful with this wrt to the other sub-makefiles this joins.
#
TEMPLATE = VBOXR3TSTEXE
# Defined by the parent makefile as well (for errmsgdata.h).
IPRT_OUT_DIR ?= $(PATH_TARGET)/Runtime
#
# Target lists
#
PROGRAMS += \
tstRTAvl \
tstRTBase64 \
tstRTBitOperations \
tstRTCidr \
tstRTCritSect \
tstDeadlock \
tstDir \
tstDir-2 \
tstDir-3 \
tstEnv \
tstErrUnique \
tstFile \
tstFileLock \
tstFork \
tstGetOpt \
tstHandleTable \
tstHeapSimple \
tstInlineAsm \
tstLdr \
tstLdr-2 \
tstLdr-3 \
tstLdr-4 \
tstLdrLoad \
tstLog \
tstMemAutoPtr \
tstRTMemPool \
tstMove \
tstMp-1 \
tstNoCrt-1 \
tstOnce \
tstPath \
tstPrfRT \
tstRand \
tstRTFsQueries \
tstR0ThreadPreemptionDriver \
tstSems \
tstSemPingPong \
tstRTStrCache \
tstStrFormat \
tstStrSimplePattern \
tstStrToNum \
tstSystemQueryOsInfo \
tstRTTemp \
tstTermCallbacks \
tstThread-1 \
tstTime \
tstTime-2 \
tstTime-3 \
tstTime-4 \
tstTimer \
tstTimerLR \
tstTimeSpec \
tstTSC \
tstUtf8 \
tstUuid
# tstSems
PROGRAMS.win += \
tstRTProcWait \
tstRTCritSectW32 \
tstFileAppendWin-1 \
ntGetTimerResolution
PROGRAMS.linux += \
tstRTProcWait \
tstRTProcIsRunningByName \
tstRTBitOperationsPIC3 \
tstInlineAsmPIC \
tstInlineAsmPIC3 \
tstSemMutex \
tstSemRW
PROGRAMS.l4 += \
tstIoCtl
PROGRAMS.darwin += \
tstDarwinSched
SYSMODS += \
tstLdrObj \
tstLdrObjR0 \
tstR0ThreadPreemption
if1of ($(VBOX_LDR_FMT)), lx pe)
LIBRARIES += \
tstLdr-4Imp
endif
ifdef RT_ASYNC_IO_CODE
PROGRAMS += \
tstFileAio
endif
if defined(VBOX_WITH_LIBXML2_IN_VBOXRT)
PROGRAMS += \
tstRTS3
endif
#
# Target configs in almost alphabetical order.
#
tstRTAvl_TEMPLATE = VBOXR3TSTEXE
tstRTAvl_SOURCES = tstRTAvl.cpp
tstRTBase64_TEMPLATE = VBOXR3TSTEXE
tstRTBase64_SOURCES = tstRTBase64.cpp
tstRTBitOperations_TEMPLATE = VBOXR3TSTEXE
tstRTBitOperations_SOURCES = tstRTBitOperations.cpp
tstRTBitOperationsPIC3_TEMPLATE = VBOXR3TSTEXE
tstRTBitOperationsPIC3_SOURCES = tstRTBitOperations.cpp
tstRTBitOperationsPIC3_CXXFLAGS = -fPIC -fomit-frame-pointer -O3
tstRTBitOperationsPIC3_DEFS = PIC
tstRTCidr_TEMPLATE = VBOXR3TSTEXE
tstRTCidr_SOURCES = tstRTCidr.cpp
tstRTCritSect_TEMPLATE = VBOXR3TSTEXE
tstRTCritSect_SOURCES = tstRTCritSect.cpp
tstRTCritSectW32_TEMPLATE = VBOXR3TSTEXE
tstRTCritSectW32_SOURCES = tstRTCritSect.cpp
tstRTCritSectW32_DEFS = TRY_WIN32_CRIT
tstDeadlock_SOURCES = tstDeadlock.cpp
tstDir_SOURCES = tstDir.cpp
tstDir-2_SOURCES = tstDir-2.cpp
tstDir-3_SOURCES = tstDir-3.cpp
tstEnv_SOURCES = tstEnv.cpp
# Note: tstErrUnique.cpp depends on a header generated by the makefile above us.
tstErrUnique_SOURCES = tstErrUnique.cpp
tstErrUnique_INCS = $(IPRT_OUT_DIR)/
tstErrUnique.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgdata.h
tstFile_SOURCES = tstFile.cpp
tstFileAppendWin-1_SOURCES = tstFileAppendWin-1.cpp
tstFileAio_SOURCES = tstFileAio.cpp
tstFileLock_SOURCES = tstFileLock.cpp
tstFork_SOURCES = tstFork.cpp
tstGetOpt_SOURCES = tstGetOpt.cpp
tstHandleTable_SOURCES = tstHandleTable.cpp
tstHeapSimple_SOURCES = tstHeapSimple.cpp
tstIoCtl_SOURCES = tstIoCtl.cpp
tstInlineAsm_SOURCES = tstInlineAsm.cpp
tstInlineAsmPIC_SOURCES = tstInlineAsm.cpp
tstInlineAsmPIC_CXXFLAGS = -fPIC
tstInlineAsmPIC_DEFS = PIC
tstInlineAsmPIC3_SOURCES = tstInlineAsm.cpp
tstInlineAsmPIC3_CXXFLAGS = -fPIC -fomit-frame-pointer -O3
tstInlineAsmPIC3_DEFS = PIC
tstLdr_SOURCES = tstLdr.cpp
tstLdr-2_SOURCES = tstLdr-2.cpp
tstLdr-2_DEFS = IN_DIS
tstLdr-2_LIBS = \
$(PATH_LIB)/DisasmR3$(VBOX_SUFF_LIB)
tstLdrObj_TEMPLATE = VBOXGC
tstLdrObj_INST = $(INST_TESTCASE)
tstLdrObj_SYSSUFF = .gc
tstLdrObj_SOURCES = tstLdrObj.cpp
tstLdrObj_DEFS = IN_DIS IN_RT_GC IN_RT_RC DIS_CORE_ONLY
ifeq ($(VBOX_LDR_FMT32),elf)
tstLdrObj_DEFS += VBOX_SOME_IMPORT_FUNCTION
endif
tstLdrObj_LIBS = \
$(PATH_LIB)/DisasmGC$(VBOX_SUFF_LIB) \
$(PATH_LIB)/RuntimeGC$(VBOX_SUFF_LIB)
ifeq ($(VBOX_LDR_FMT32),pe)
tstLdrObj_LDFLAGS = -Entry:Entrypoint
tstLdrObj_LIBS += \
$(PATH_LIB)/VMMGCBuiltin$(VBOX_SUFF_LIB)
endif # PE
ifeq ($(VBOX_LDR_FMT32),elf)
tstLdrObj_LDFLAGS = -e Entrypoint
endif
ifeq ($(VBOX_LDR_FMT32),lx)
tstLdrObj_LIBS += \
$(PATH_LIB)/VMMGCBuiltin$(VBOX_SUFF_LIB)
endif
tstLdr-3_SOURCES = tstLdr-3.cpp
tstLdr-3_DEFS = IN_DIS
tstLdr-3_LIBS = \
$(PATH_LIB)/DisasmR3$(VBOX_SUFF_LIB)
tstLdr-4Imp_TEMPLATE = VBOXR0
ifeq ($(VBOX_LDR_FMT),lx)
tstLdr-4Imp_SOURCES = tstLdr-4Imp-os2.def
else ifeq ($(VBOX_LDR_FMT),pe)
tstLdr-4Imp_SOURCES.win = tstLdr-4Imp-win.def
endif
tstLdrObjR0_TEMPLATE = VBOXR0
tstLdrObjR0_INST = $(INST_TESTCASE)
tstLdrObjR0_SYSSUFF = .r0
tstLdrObjR0_SOURCES = tstLdrObjR0.cpp tstLdrDisasmTest.cpp
tstLdrObjR0_DEFS = IN_DIS IN_RT_R0 DIS_CORE_ONLY
ifeq ($(VBOX_LDR_FMT32),elf)
tstLdrObjR0_DEFS += VBOX_SOME_IMPORT_FUNCTION
endif
tstLdrObjR0_LIBS = \
$(PATH_LIB)/DisasmR0$(VBOX_SUFF_LIB) \
$(PATH_LIB)/RuntimeR0$(VBOX_SUFF_LIB)
ifeq ($(VBOX_LDR_FMT),pe)
tstLdrObjR0_LDFLAGS = -Entry:Entrypoint
tstLdrObjR0_LIBS += \
$(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB) \
$(TARGET_tstLdr-4Imp)
endif
ifeq ($(VBOX_LDR_FMT),elf)
tstLdrObjR0_LDFLAGS = -e Entrypoint
endif
ifeq ($(VBOX_LDR_FMT),lx)
tstLdrObjR0_LIBS += \
$(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB) \
$(TARGET_tstLdr-4Imp)
endif
tstLdr-4_SOURCES = tstLdr-4.cpp tstLdrDisasmTest.cpp
tstLdr-4_DEFS = IN_DIS
tstLdr-4_LIBS = \
$(PATH_LIB)/DisasmR3$(VBOX_SUFF_LIB)
tstLdrLoad_SOURCES = tstLdrLoad.cpp
tstLog_SOURCES = tstLog.cpp
tstMemAutoPtr_SOURCES = tstMemAutoPtr.cpp
tstRTMemPool_TEMPLATE = VBOXR3TSTEXE
tstRTMemPool_SOURCES = tstRTMemPool.cpp
tstMove_SOURCES = tstMove.cpp
tstMp-1_SOURCES = tstMp-1.cpp
tstNoCrt-1_DEFS = RT_WITHOUT_NOCRT_WRAPPER_ALIASES
tstNoCrt-1_SOURCES = \
tstNoCrt-1.cpp \
../common/string/memcpy.asm \
../common/string/mempcpy.asm \
../common/string/memmove.asm \
../common/string/memset.asm \
../common/string/memchr.asm \
../common/string/memcmp.asm \
../common/string/strchr.asm \
../common/string/strcmp.asm \
../common/string/strcpy.asm \
../common/string/strlen.asm
tstOnce_SOURCES = tstOnce.cpp
tstPath_SOURCES = tstPath.cpp
tstPrfRT_SOURCES = tstPrfRT.cpp
tstRand_SOURCES = tstRand.cpp
tstR0ThreadPreemption_TEMPLATE = VBOXR0
tstR0ThreadPreemption_INST = $(INST_TESTCASE)
tstR0ThreadPreemption_DEFS = IN_RT_R0
tstR0ThreadPreemption_SYSSUFF = .r0
tstR0ThreadPreemption_SOURCES = tstR0ThreadPreemption.cpp
tstR0ThreadPreemption_LIBS = $(PATH_LIB)/RuntimeR0$(VBOX_SUFF_LIB)
if1of ($(VBOX_LDR_FMT), pe lx)
tstR0ThreadPreemption_LIBS += $(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB)
endif
tstR0ThreadPreemptionDriver_SOURCES = tstR0ThreadPreemptionDriver.cpp
tstRTFsQueries_SOURCES = tstRTFsQueries.cpp
tstRTProcWait_SOURCES = tstRTProcWait.cpp
tstRTProcIsRunningByName_SOURCES = tstRTProcIsRunningByName.cpp
tstRTS3_SOURCES = tstRTS3.cpp
tstSemMutex_SOURCES = tstSemMutex.cpp
tstSemRW_SOURCES = tstSemRW.cpp
tstSemPingPong_SOURCES = tstSemPingPong.cpp
tstSems_SOURCES = tstSems.cpp
tstRTStrCache_TEMPLATE = VBOXR3TSTEXE
tstRTStrCache_SOURCES = tstRTStrCache.cpp
tstStrFormat_SOURCES = tstStrFormat.cpp
tstStrSimplePattern_SOURCES = tstStrSimplePattern.cpp
tstStrToNum_SOURCES = tstStrToNum.cpp
tstSystemQueryOsInfo_SOURCES = tstSystemQueryOsInfo.cpp
tstRTTemp_TEMPLATE = VBOXR3TSTEXE
tstRTTemp_SOURCES = tstRTTemp.cpp
tstTermCallbacks_SOURCES = tstTermCallbacks.cpp
tstThread-1_SOURCES = tstThread-1.cpp
tstTime_SOURCES = tstTime.cpp
tstTime-2_SOURCES = tstTime-2.cpp
tstTime-3_SOURCES = tstTime-3.cpp
tstTime-4_SOURCES = tstTime-4.cpp
tstTimer_SOURCES = tstTimer.cpp
tstTimerLR_SOURCES = tstTimerLR.cpp
tstTimeSpec_SOURCES = tstTimeSpec.cpp
tstTSC_SOURCES = tstTSC.cpp
tstTSC_CXXFLAGS.linux += -O3
tstUuid_SOURCES = tstUuid.cpp
tstUtf8_SOURCES = tstUtf8.cpp
#
# odds and ends
#
tstDarwinSched_SOURCES = tstDarwinSched.cpp
ntGetTimerResolution_SOURCES = ntGetTimerResolution.cpp
ntGetTimerResolution_SDKS.win = WINPSDK W2K3DDK VBOX_NTDLL
endif # VBOX_WITH_TESTCASES
include $(KBUILD_PATH)/subfooter.kmk
|