Makefile 14.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
# -*- Mode: Makefile -*-

.DEFAULT_GOAL= build
TOKUROOT=../../
INCLUDEDIRS=-I. -I../ -I$(TOKUROOT)newbrt -I../range_tree -I../lock_tree
DEPEND_COMPILE += \
	../*.h \
	../range_tree/*.h \
	../lock_tree/*.h \
	test.h \
#end
12 13
include $(TOKUROOT)toku_include/Makefile.include
CPPFLAGS+=-D_GNU_SOURCE
14 15 16 17 18 19
LIBTDB=../libtokudb.$(SOEXT)
TLIBTDB=../libtokudbtrace.$(SOEXT)

ifeq ($(CC),icc)
SKIP_WARNING += $(ICC_NOWARN)1418 #Non static functions do not need prototypes.
endif
Yoni Fogel's avatar
Yoni Fogel committed
20
BDBVGRIND=
Bradley C. Kuszmaul's avatar
up  
Bradley C. Kuszmaul committed
21

22
$(LIBTDB) $(TLIBTDB):
23
	cd $(@D) && $(MAKE) $(@F)
24

25
$(notdir $(LIBTDB)): $(LIBTDB)
26
	cp $< $@
27

28
$(notdir $(TLIBTDB)): $(TLIBTDB)
29
	cp $< $@
Zardosht Kasheff's avatar
Zardosht Kasheff committed
30

31
SRCS = $(sort $(wildcard *.c))
Zardosht Kasheff's avatar
Zardosht Kasheff committed
32

33 34 35 36 37 38 39 40

#Tests that are irrelevant in windows.
WINDOWS_DONTRUN_TESTS = \
	helgrind1 \
	helgrind2 \
	helgrind3 \
#\ ends prev line

41 42 43 44
#BDB Tests that are irrelevant in windows.
WINDOWS_BDB_DONTRUN_TESTS = \
	diskfull \
	test_groupcommit_count \
45
	test_set_func_malloc \
46 47 48
#\ ends prev line
#diskfull: windows bdb is missing db_env_set_func_pwrite and db_env_set_func_write
#test_groupcommit_count: windows bdb is missing db_env_set_func_fsync
49
#test_set_func_malloc: windows bdb (some) are missing db_env_set_func_(malloc|realloc|free)
50

51 52 53 54 55 56

#These tests fail, but sometimes they hang! (in windows).  Just disable them.
WINDOWS_BDB_DONTRUN_TESTS += \
	test_error \
#\ ends prev line

57 58 59 60 61 62
ifeq ($(OS_CHOICE),windows)
    TDB_TESTS = $(patsubst %.c,%.tdb$(BINSUF),$(filter-out $(patsubst %,%.c,$(WINDOWS_DONTRUN_TESTS)),$(SRCS)))
else
    TDB_TESTS = $(patsubst %.c,%.tdb$(BINSUF),$(SRCS))
endif

63
# For diskfull.bdb: db-4.6 seems OK, but db-4.3 segfaults
64
BDB_DONTRUN_TESTS = \
65
	bug1381 \
66
	bug627 \
67
	diskfull \
68
	test_abort1 \
69 70
	test_abort4 \
	test_abort5 \
71 72 73 74 75
	keyrange \
	keyrange-unflat \
	keyrange-dupsort \
	keyrange-dupsort-unflat \
	manyfiles \
76
	stat64 stat64_flatten \
77
	test938c \
78
	test1324 \
Yoni Fogel's avatar
Yoni Fogel committed
79
	helgrind1 \
80
	helgrind2 \
81
	helgrind3 \
82
	test1426 \
83
	test1572 \
84
	test_logflush \
85
	test_txn_abort6 \
86 87 88 89
	test_txn_abort8 \
	test_txn_abort9 \
	test_txn_close_open_commit \
	test_txn_commit8 \
90
	test_db_descriptor \
91
	test_db_descriptor_named_db \
92 93
	test_db_txn_locks_heaviside \
	test_heaviside_rh_1756 \
94
	test_heaviside_straddle_1622 \
95
	test_dbremove_old \
96 97 98
	root_fifo_2 \
	root_fifo_32 \
	root_fifo_41 \
99
	checkpoint_1 \
100
	checkpoint_stress \
101 102
#\ ends prev line

103 104 105 106
# checkpoint tests depend on this header file, 
checkpoint_1.tdb$(BINSUF) checkpoint_stress.tdb$(BINSUF): checkpoint_test.h
# dependency only, not a rule (do not insert a tab at this line)

107 108 109
BDB_TESTS_THAT_SHOULD_FAIL= \
#\ ends prev line
ifeq ($(OS_CHOICE),windows)
110 111
    #The following are nondeterministic test failures or hangs in windows.  Just get rid of them in BDB. (for now)
    WINDOWS_BDB_DONTRUN_TESTS += \
112
	test_archive2 \
113
	test_cursor_delete \
114
	test_cursor_stickyness \
115 116
	test_db_dbt_mem_behavior \
	test_dup_insert \
117
	test_dup_search \
118
	test_dupsort_get \
119 120 121
	test_dupsort_set \
	test_unused_memory_crash \
	test_dupsort_get_both_range \
122 123
	test_reverse_compare_fun \
	test-recover3 \
124 125 126
#\ ends prev line
endif

127

128 129 130 131
ifeq ($(OS_CHOICE),windows)
    BDB_DONTRUN_TESTS+=$(WINDOWS_BDB_DONTRUN_TESTS)
endif

132
BDB_TESTS = $(patsubst %.c,%.bdb$(BINSUF),$(filter-out $(patsubst %,%.c,$(BDB_DONTRUN_TESTS)),$(SRCS)))
133 134 135 136 137 138 139 140

TDB_TESTS_THAT_SHOULD_FAIL= \
	test_groupcommit_count \
	test944 \
	test_truncate_txn_abort \
	test_txn_nested_abort3 \
	test_txn_nested_abort4 \
#\ ends prev line
141 142 143 144 145 146
ifneq ($(OS_CHOICE),windows)
    TDB_TESTS_THAT_SHOULD_FAIL+= \
	test_db_remove \
#\ ends prev line
endif

147 148 149
TDB_TESTS_THAT_SHOULD_FAIL_LIT= \
#\ ends prev line

150 151 152 153 154 155 156 157 158 159
ifeq ($(OS_CHOICE),windows)
    #Tests that fail in windows but shouldn't.  TODO: Fix each one of these and remove from the list!
    TDB_TESTS_THAT_SHOULD_FAIL += \
	test-recover2 \
	test-recover3 \
#\ ends prev line
    TDB_TESTS_THAT_SHOULD_FAIL_LIT += \
	test_log4.recover \
	test_log5.recover \
	test_log7.recover \
160 161
	test_log8.recover \
	test_log9.recover \
162 163
	test_log10.recover \
#\ ends prev line
164
    #NOTE:  test_log[89].recover is non-deterministic.  Sometimes passes/fails
165 166
endif

167 168 169 170 171 172 173
ALL_TESTS  = $(TDB_TESTS)

#Skip all BDB tests for CYGWIN+ICC
ifeq ($(CYGWIN),)
ALL_TESTS += $(BDB_TESTS)
else ifneq ($(CC),icc)
ALL_TESTS += $(BDB_TESTS)
Bradley C. Kuszmaul's avatar
up  
Bradley C. Kuszmaul committed
174 175
endif

176
TLRECOVER = 2 3 4 5 6 7 8 9 10
177

178 179
EXTRA_TDB_TESTS = \
	$(patsubst %,test_log%.recover,$(TLRECOVER)) \
180
#	test_db_assoc3.tdbrun_wasbad \# Obsolete right now.
181
#\ ends prev line
Bradley C. Kuszmaul's avatar
up  
Bradley C. Kuszmaul committed
182

183 184 185
RUN_TDB_TESTS = $(patsubst %.tdb$(BINSUF),%.tdbrun,$(TDB_TESTS))  $(EXTRA_TDB_TESTS)
RUN_BDB_TESTS  = $(patsubst %.bdb$(BINSUF),%.bdbrun,$(BDB_TESTS))
RUN_ALL_TESTS  = $(RUN_BDB_TESTS) $(RUN_TDB_TESTS)
Bradley C. Kuszmaul's avatar
up  
Bradley C. Kuszmaul committed
186

187
MORE_BDB_BINS = test1426.bdb$(BINSUF)
188

189
.PHONY: default all check tests check.lin check.tlog check.log tests.lin tests.log tests.tlog
Bradley C. Kuszmaul's avatar
up  
Bradley C. Kuszmaul committed
190

191
default all build: $(ALL_TESTS) $(MORE_BDB_BINS)
192

193
ifndef TOKUDBONLY
Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
194 195 196
MAYBE_CHECK_BDB = check.bdb
else
MAYBE_CHECK_BDB =
Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
197
endif
Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
198
check: check.tdb $(MAYBE_CHECK_BDB) ;
199

200
tests: tests.bdb tests.tdb ;
201
tests.bdb: $(BDB_TESTS) ;
202 203
check.bdb: $(RUN_BDB_TESTS) ;
tests.tdb: $(TDB_TESTS) ;
204
check.tdb: $(notdir $(LIBTDB)) $(RUN_TDB_TESTS) ;
Bradley C. Kuszmaul's avatar
up  
Bradley C. Kuszmaul committed
205

206
foo:
207 208
	echo RUN_TDB_TESTS: $(RUN_TDB_TESTS)
	echo ALL_TESTS: $(ALL_TESTS)
209

210 211 212
#TODO: What is this for? TODO: Port this if necessary.
#traces: test_env_open_flags.tdbt$(BINSUF)
traces: $(patsubst %.tdb$(BINSUF),%.tdbt$(BINSUF),$(TDB_TESTS))
213

214 215
.PHONY: %.bdbrun %.run %.tdbrun
# STUFF!!!!
216

217 218
%.run: %.bdbrun %.tdbrun

219 220
SHOULD_FAIL = $(TDB_TESTS_THAT_SHOULD_FAIL_LIT) $(patsubst %,%.tdbrun,$(TDB_TESTS_THAT_SHOULD_FAIL)) \
	      $(BDB_TESTS_THAT_SHOULD_FAIL_LIT) $(patsubst %,%.bdbrun,$(BDB_TESTS_THAT_SHOULD_FAIL))
221 222 223 224
# Any test that should fail, we invert the result by using MAYBEINVERTER
$(SHOULD_FAIL): MAYBEINVERTER=$(INVERTER)
$(SHOULD_FAIL): SUMMARIZE_CMD=$(SUMMARIZE_SHOULD_FAIL)

225 226
TDBVGRIND=$(VGRIND)

227 228 229 230 231 232
ifeq ($(OS_CHOICE),windows)
ifdef BDBDIR
%.bdb$(BINSUF): INCLUDEDIRS=-I$(BDBDIR)/include
%.bdb$(BINSUF): RPATH_DIRS=$(BDBDIR)/lib
endif
ifeq ($(DEBUG),0)
233
WINDOWS_BDB_LIB_NAME=libdb.$(SOEXT)
234
$(WINDOWS_BDB_LIB_NAME):
235
	cp $(BDBDIR)/lib/libdb[0-9][0-9].$(SOEXT) ./
236
else
237
WINDOWS_BDB_LIB_NAME=libdbd.$(SOEXT)
238
$(WINDOWS_BDB_LIB_NAME):
239
	cp $(BDBDIR)/lib/libdb[0-9][0-9]d.$(SOEXT) ./
240 241
endif
%.bdb$(BINSUF): DLINK_FILES=$(BDBDIR)/lib/$(WINDOWS_BDB_LIB_NAME)
242
#empty
243 244 245 246 247 248 249 250 251 252 253 254 255
else
WINDOWS_BDB_LIB_NAME=
#linux
ifdef BDBDIR
%.bdb$(BINSUF): INCLUDEDIRS=-I$(BDBDIR)/include
%.bdb$(BINSUF): RPATH_DIRS=$(BDBDIR)/lib
endif
%.bdb$(BINSUF): DLINK_FILES=db.$(SOEXT)
endif
#empty on purpose



Yoni Fogel's avatar
Yoni Fogel committed
256
# Use -s on the command line to make things quiet.
257
# Use -s on the command line to make things quiet.
258
%.bdbrun: %.bdb$(BINSUF) $(DEPEND_COMPILE) $(DEPEND_LINK) $(WINDOWS_BDB_LIB_NAME)
259
	$(BDBVGRIND) ./$< $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
260
%.tdbrun: %.tdb$(BINSUF) $(DEPEND_COMPILE) $(DEPEND_LINK) $(notdir $(LIBTDB))
261
	$(TDBVGRIND) ./$< $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
262

263 264 265 266 267 268 269 270
ifeq ($(OS_CHOICE),windows)
    TDBDUMP=$(TOKUROOT)utils/tokudb_dump$(BINSUF)
    TDBLOAD=$(TOKUROOT)utils/tokudb_load$(BINSUF)
else
    TDBDUMP=$(TOKUROOT)utils/tokudb_dump_static$(BINSUF)
    TDBLOAD=$(TOKUROOT)utils/tokudb_load_static$(BINSUF)
endif

271

272
%.recover: %.tdb$(BINSUF)
273 274 275 276 277 278 279
	echo doing ./$< &&\
	$(VGRIND) ./$<                                                                          && \
	rm -rf dir.$*.c.tdb.recover                                                             && \
	mkdir dir.$*.c.tdb.recover                                                              && \
	echo doing recovery &&\
	$(VGRIND) ../../newbrt/tdb-recover dir.$*.c.tdb.recover dir.$*.c.tdb                    && \
	echo dump and compare &&\
280 281
	$(TDBDUMP) -h dir.$*.c.tdb         foo.db > dir.$*.c.tdb/foo.dump          && \
	$(TDBDUMP) -h dir.$*.c.tdb.recover foo.db > dir.$*.c.tdb.recover/foo.dump  && \
282
	diff -q dir.$*.c.tdb/foo.dump dir.$*.c.tdb.recover/foo.dump                                   \
283 284 285
	$(MAYBEINVERTER) $(SUMMARIZE_CMD)

%.recoverwc: %.tdb$(BINSUF)
286
	 (cd dir.$*.c.tdb;pwd;cat log*| ../../../newbrt/tdb_logprint |wc -c)
287 288 289 290 291 292 293

.PHONY: %.recover
all.recover: $(patsubst %,test_log%.recover,$(TLRECOVER)) ;

#DISABLE standard tdbrun for recover tests.
$(patsubst %,test_log%.tdbrun,$(TLRECOVER)): ;

294
%.bdb$(BINSUF): CFLAGS+= -DENVDIR=\"dir.$<.bdb\" -DUSE_BDB -DIS_TDB=0 -DTOKU_ALLOW_DEPRECATED
295 296

%.bdb$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK)
297
	$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
298

Yoni Fogel's avatar
Yoni Fogel committed
299 300 301 302 303
TDB_EXTRA_NEEDED=
ifeq ($(CYGWIN),)
%.tdb$(BINSUF):  DLINK_FILES+=$(LIBTDB)
%.tdb$(BINSUF):  RPATH_DIRS+=$(dir $(LIBTDB))
else ifneq ($(CC),icc)
304
%.tdb$(BINSUF):  DLINK_FILES+=$(LIBTDB)
Yoni Fogel's avatar
Yoni Fogel committed
305
%.tdb$(BINSUF):  RPATH_DIRS+=$(dir $(LIBTDB))
Yoni Fogel's avatar
Yoni Fogel committed
306 307 308 309 310 311 312 313
else ifeq  ($(DEBUG),0)
%.tdb$(BINSUF):  LINK_FILES+=$(IPO_YDB)
TDB_EXTRA_NEEDED=$(IPO_YDB)
else
%.tdb$(BINSUF):  LINK_FILES+=$(NOIPO_YDB)
TDB_EXTRA_NEEDED=$(NOIPO_YDB)
endif

314
%.tdbt$(BINSUF): DLINK_FILES+=$(TLIBTDB)
Yoni Fogel's avatar
Yoni Fogel committed
315
%.tdbt$(BINSUF): RPATH_DIRS+=$(dir $(TLIBTDB))
316
%.tdb$(BINSUF) %.tdbt$(BINSUF): CFLAGS+= -DENVDIR=\"dir.$<.tdb\" -DUSE_TDB -DIS_TDB=1
317
%.tdb$(BINSUF) %.tdbt$(BINSUF): CPPFLAGS+=-I$(TOKUROOT)include
318

Yoni Fogel's avatar
Yoni Fogel committed
319
%.tdb$(BINSUF) %.tdbt$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK) $(TDB_EXTRA_NEEDED)
320
	$(CC) $< $(filter-out ../../lib/libtokuportability.a,$(BIN_FROM_C_FLAGS)) $(LINK_MUST_BE_LAST)
321 322

clean:
323 324
	rm -f $(ALL_TESTS)
	rm -rf dir.*.tdb dir.*.bdb dir.*.tdb.recover
325
	rm -f dump.bdb.1426 dump.tdb.1426 test1426.bdb
326 327 328 329 330 331 332 333

ifeq ($(VGRIND),)
  BDB_SUPPRESSIONS =
else
  BDB_SUPPRESSIONS = --suppressions=bdb.supressions --gen-suppressions=all
endif

# VERBOSE=true
Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
334

335
# Need these rule so that Make knows about all the file names
Vincenzo Liberatore's avatar
Vincenzo Liberatore committed
336
.PHONY: %.run
337 338
$(RUN_ALL_TESTS):
$(ALL_TESTS):
Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
339

340
%.run: %.bdbrun %.tdbrun
341
	@ echo ok
342

343 344 345



346 347 348 349 350
INVERTER=;test $$? -ne 0

# Any test that should fail, we invert the result by using MAYBEINVERTER
$(SHOULD_FAIL): MAYBEINVERTER=$(INVERTER)

351 352
HERE = src/tests

353

354
# Don't include log2 log3 log4 log5 etc since they are covered by all.recover
355

356 357
# Don't run valgrind on the groupcommit performance tests
test_groupcommit_perf.bdbrun test_groupcommit_perf.tdbrun: VGRIND=
358
# Use helgrind on the group commit count test
359 360
# helgrind is too flakey, so I'm removing it from the tests. -Bradley
#test_groupcommit_count_helgrind.tdbrun: test_groupcommit_count_helgrind.tdb
361
#	$(HGRIND) ./$< $(VERBVERBOSE)
362 363


364

365
libs:
Yoni Fogel's avatar
Yoni Fogel committed
366
	cd ..;$(MAKE)
367

368

369

Vincenzo Liberatore's avatar
Vincenzo Liberatore committed
370

371 372 373
test_db_curs4.tdb$(BINSUF): trace.h
test_db_curs4.bdb$(BINSUF): trace.h
test_db_assoc3.tdb$(BINSUF) test_db_assoc3.bdb$(BINSUF): test.h
374

375

376
# This one failed in both BDB and TokuDB, in the same way.  It was a program error.  Now it works
377
test_db_assoc3.tdbrun_wasbad: test_db_assoc3.tdb$(BINSUF)
378 379 380 381 382 383 384
	./$< --seed=1 --count=200
	./$< --seed=1 --count=200 --more
	./$< --seed=1 --count=200 --more
	./$< --seed=1 --count=200 --more
	./$< --seed=1 --count=200 --more
	./$< --seed=1 --count=200 --more
	./$< --seed=1 --count=200 --more
385 386
# serialize these two tests since they use the same directory
test_db_assoc3.tdbrun_wasbad: test_db_assoc3.tdbrun
387

388 389

.phony: build_primary_db build_name_db  build_expire_db
390
test_v6_assoc3.dir/dir.test_db_assoc3.c.tdb$(BINSUF):
391
	mkdir $@
392
build_primary_db: test_v6_assoc3.dir/dir.test_db_assoc3.c.tdb$(BINSUF)
393
	gunzip < test_v6_assoc3.dir/dir.test_db_assoc3.c.tdb.original/primary.db.gz > test_v6_assoc3.dir/dir.test_db_assoc3.c.tdb/primary.db
394
build_name_db: test_v6_assoc3.dir/dir.test_db_assoc3.c.tdb$(BINSUF)
395
	gunzip < test_v6_assoc3.dir/dir.test_db_assoc3.c.tdb.original/name.db.gz > test_v6_assoc3.dir/dir.test_db_assoc3.c.tdb/name.db
396
build_expire_db: test_v6_assoc3.dir/dir.test_db_assoc3.c.tdb$(BINSUF)
397
	gunzip < test_v6_assoc3.dir/dir.test_db_assoc3.c.tdb.original/expire.db.gz > test_v6_assoc3.dir/dir.test_db_assoc3.c.tdb/expire.db
398 399

test_v6v7_assoc3.tdbrun: test_db_assoc3.tdb$(BINSUF) build_primary_db  build_name_db build_expire_db
400
	(cd test_v6_assoc3.dir; LD_LIBRARY_PATH=../.. $(VGRIND) ../test_db_assoc3.tdb$(BINSUF) --seed=3 --count=1000 --more)  $(SUMMARIZE_CMD)
401 402

test_db_assoc3.tdbrun: test_db_assoc3.tdb$(BINSUF)
403
	$(VGRIND) ./$< --seed=2 --count=100000 $(VERBVERBOSE) && \
404
	              $(VGRIND) ./$< --seed=2 --count=100000 --more $(VERBVERBOSE) $(SUMMARIZE_CMD)
405

406
# Give up on VGRIND for bdbrun
407
test_db_assoc3.bdbrun: test_db_assoc3.bdb$(BINSUF) $(WINDOWS_BDB_LIB_NAME)
408
	./$< --seed=2 --count=100000        $(VERBVERBOSE) && \
409
	              ./$< --seed=2 --count=100000 --more $(VERBVERBOSE) $(SUMMARIZE_CMD)
410

411 412 413 414 415 416 417 418 419 420 421 422
# a bunch of little tests designed to run in parallel
test_get_both_range.tdbrun: \
 tgbr_256_a.tdbrun tgbr_256_b.tdbrun tgbr_256_c.tdbrun \
 tgbr_128_a.tdbrun tgbr_128_b.tdbrun tgbr_128_c.tdbrun \
 tgbr_64_a.tdbrun  tgbr_64_b.tdbrun  tgbr_64_c.tdbrun \
 tgbr_32_a.tdbrun  tgbr_32_b.tdbrun  tgbr_32_c.tdbrun \
 tgbr_16_a.tdbrun  tgbr_16_b.tdbrun  tgbr_16_c.tdbrun \
 tgbr_8_a.tdbrun   tgbr_8_b.tdbrun   tgbr_8_c.tdbrun \
 tgbr_4_a.tdbrun   tgbr_4_b.tdbrun   tgbr_4_c.tdbrun \
 tgbr_2_a.tdbrun   tgbr_2_b.tdbrun   tgbr_2_c.tdbrun \
 tgbr_1_a.tdbrun   tgbr_1_b.tdbrun   tgbr_1_c.tdbrun \
 # intentionally blank line
423
	true $(SUMMARIZE_CMD) #State that this has passed.
424

425
tgbr_%_a.tdbrun: test_get_both_range.tdb$(BINSUF)
426
	$(VGRIND) ./$< $(VERBVERBOSE) -i $* -a $(MAYBEINVERTER) $(SUMMARIZE_CMD)
427
tgbr_%_b.tdbrun: test_get_both_range.tdb$(BINSUF)
428
	$(VGRIND) ./$< $(VERBVERBOSE) -i $* -b $(MAYBEINVERTER) $(SUMMARIZE_CMD)
429
tgbr_%_c.tdbrun: test_get_both_range.tdb$(BINSUF)
430
	$(VGRIND) ./$< $(VERBVERBOSE) -i $* -c $(MAYBEINVERTER) $(SUMMARIZE_CMD)
431

432 433 434 435 436 437
ifeq ($(OS_CHOICE),windows)
    #Windows BDB cannot run 1426.  Save output from linux and compare.
dump.bdb.1426: test1426.bdbdump/dump.bdb.1426
	cat $< | unix2dos --u2d > $@
    	
else
438
dump.bdb.1426: test1426.bdb$(BINSUF) test1426.bdbdump/dump.bdb.1426
439 440 441 442 443
	./$< -q  && \
	 $(BDBDIR)/bin/db_dump -p -h dir.test1426.c.bdb main > $@
	diff -q $@ test1426.bdbdump/$@ #Assert output is correct.
endif

444
# test1426 is run by comparing the BDB output to the TDB output
445 446
test1426.tdbrun: test1426.tdb$(BINSUF) dump.bdb.1426
	(./test1426.tdb$(BINSUF) -q && \
447
	 $(TDBDUMP) -p -h dir.test1426.c.tdb main > dump.tdb.1426 && \
448
	 diff -q -I db_pagesize=4096 dump.bdb.1426 dump.tdb.1426 ) \
449
	 $(MAYBEINVERTER) $(SUMMARIZE_CMD)
450

451 452 453
# STRESS RUNS is number of iterations, STRESS_SIZE is operations per iteration (must not change between iterations)
STRESS_RUNS=5
STRESS_SIZE=5001
454 455
checkpoint_stress.tdbrun: SHELL=/bin/bash
checkpoint_stress.tdbrun: checkpoint_stress.tdb$(BINSUF)
456 457
	$(VGRIND) ./$< -C -n $(STRESS_SIZE) $(VERBVERBOSE) && \
	($(VGRIND) ./$< -C -i 0 -n $(STRESS_SIZE) $(VERBVERBOSE) && \
458
	 for (( i = 1; i < $(STRESS_RUNS); i++ )); do \
459
		date; \
460
		./$< -c -i $$i -n $(STRESS_SIZE) $(VERBVERBOSE) 2> dir.checkpoint_stress.c.tdb/error.$$i ; \
461 462 463 464 465
		if ! grep -q 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.$$i; then break; fi; \
	done && \
	test `grep -l 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.* |wc -l` = $$(($(STRESS_RUNS)-1)) \
	) $(MAYBEINVERTER) $(SUMMARIZE_CMD)

Yoni Fogel's avatar
Yoni Fogel committed
466
# helgrind1 is supposed to fail.
467
helgrind1.tdbrun: TDBVGRIND=$(HGRIND) --log-file=helgrind1.tdb.deleteme
Yoni Fogel's avatar
Yoni Fogel committed
468
helgrind1.tdbrun: MAYBEINVERTER=$(INVERTER)
469
helgrind2.tdbrun: TDBVGRIND=$(HGRIND)
Yoni Fogel's avatar
Yoni Fogel committed
470
helgrind2.bdbrun: BDBVGRIND=$(HGRIND)
471
helgrind3.tdbrun: TDBVGRIND=$(HGRIND)
Yoni Fogel's avatar
Yoni Fogel committed
472 473
helgrind3.bdbrun: BDBVGRIND=$(HGRIND)

474
dumpit:
475
	../../newbrt/brtdump  dir.test_log5.c.tdb.recover/foo.db > dump.r && ../../newbrt/brtdump  dir.test_log5.c.tdb/foo.db > dump.o && diff -q dump.o dump.r
476 477

# test on small stacks
478
test_thread_stack.%run: test_thread_stack.%$(BINSUF)
479 480
	./$< -a -thread_stack 16384         && \
	./$< -a -thread_stack 16384 -resume $(SUMMARIZE_CMD)