Makefile 30.7 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

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

20 21 22 23 24 25 26
TDB_EXTRA_NEEDED=
ifeq ($(OS_CHOICE),windows)
LIBTDB=$(WIN_YDB)
%.tdb$(BINSUF):  $(WIN_YDB)
%.tdb$(BINSUF):  LINK_FILES+=$(WIN_YDB)
TDB_EXTRA_NEEDED=$(WIN_YDB)
else
27
LIBTDB=../../lib/libtokudb.$(SOEXT)
28 29
TLIBTDB=../libtokudbtrace.$(SOEXT)
%.tdb$(BINSUF):  DLINK_FILES+=$(LIBTDB)
30
%.tdb$(BINSUF):  RPATH_DIRS+=$(patsubst %/,%,$(dir $(LIBTDB)))
31
endif
32

33
RECOVER_SRCS = $(wildcard recover-*.c)
34
LOADER_SRCS = $(wildcard loader-*.c)
35
TRANSPARENT_UPGRADE_SRCS = $(wildcard upgrade*.c)
36 37 38
NONSTANDARD_SRCS= \
		  $(RECOVER_SRCS) \
		  $(LOADER_SRCS) \
39

40 41 42 43 44
FAIL3312C_SRCS = filesize.c test_update_broadcast_stress.c test3529.c

#SRCS = $(sort $(wildcard *.c))
# To patch out upgrade tests, replace line above with line below,
# and patch out loader-stress-test3 (see below)
45
#SRCS = $(sort $(filter-out $(TRANSPARENT_UPGRADE_SRCS),$(wildcard *.c)))
46
# To patch out tests failing on 3312c branch (including upgrade tests), use this:
47
SRCS = $(sort $(filter-out $(TRANSPARENT_UPGRADE_SRCS),$(filter-out $(FAIL3312C_SRCS),$(wildcard *.c))))
48

49

50
#end
51

Yoni Fogel's avatar
Yoni Fogel committed
52 53 54 55 56
#Tests that don't compile in windows.  SHould
WINDOWS_NOT_PORTED_TESTS = \
        diskfull \
#\ ends prev line

57 58
#Tests that are irrelevant in windows.
WINDOWS_DONTRUN_TESTS = \
Yoni Fogel's avatar
Yoni Fogel committed
59
	$(WINDOWS_NOT_PORTED_TESTS) \
60 61 62 63 64
	helgrind1 \
	helgrind2 \
	helgrind3 \
#\ ends prev line

65 66 67 68
#BDB Tests that are irrelevant in windows.
WINDOWS_BDB_DONTRUN_TESTS = \
	diskfull \
	test_groupcommit_count \
69
	test_set_func_malloc \
70 71 72
#\ 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
73
#test_set_func_malloc: windows bdb (some) are missing db_env_set_func_(malloc|realloc|free)
74

75 76 77 78 79 80

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

81
ifeq ($(OS_CHOICE),windows)
82
    TDB_BINS = $(patsubst %.c,%.tdb$(BINSUF),$(filter-out $(patsubst %,%.c,$(WINDOWS_DONTRUN_TESTS)),$(SRCS)))
83
    TDB_TESTS = $(patsubst %.c,%.tdb$(BINSUF),$(filter-out $(patsubst %,%.c,$(WINDOWS_DONTRUN_TESTS)),$(filter-out $(NONSTANDARD_SRCS),$(SRCS))))
84
else
85
    TDB_BINS = $(patsubst %.c,%.tdb$(BINSUF),$(SRCS))
86
    TDB_TESTS = $(patsubst %.c,%.tdb$(BINSUF),$(filter-out $(NONSTANDARD_SRCS),$(SRCS)))
87 88
endif

89
# For diskfull.bdb: db-4.6 seems OK, but db-4.3 segfaults
90
BDB_DONTRUN_TESTS = \
91 92 93
        backwards_10_each_le_and_msg \
        bug1381 \
        bug627 \
94
	cachetable-race \
95 96 97 98
        checkpoint_1 \
        checkpoint_callback \
        checkpoint_stress \
        checkpoint_truncate_1 \
99
	cursor-isolation \
100 101
	cursor-set-del-rmw \
	cursor-set-range-rmw \
102 103
	del-simple \
	del-multiple \
104
	del-multiple-huge-primary-row \
105
	del-multiple-srcdb \
106
	directory_lock \
107 108 109
        diskfull \
        env-put-multiple \
        env_startup \
110
	execute-updates \
111 112 113 114
        filesize \
        helgrind1 \
        helgrind2 \
        helgrind3 \
115 116 117 118 119 120
	hotindexer-bw \
	hotindexer-db-busy \
	hotindexer-error-callback \
	hotindexer-insert-committed-optimized \
	hotindexer-insert-committed \
	hotindexer-insert-provisional \
121
	hotindexer-lock-test \
122 123
	hotindexer-multiclient \
	hotindexer-nested-insert-committed \
124 125
	hotindexer-put-abort \
	hotindexer-put-commit \
126 127 128 129
	hotindexer-put-multiple \
	hotindexer-simple-abort \
	hotindexer-undo-do-test \
	hotindexer-with-queries \
130
	insert-dup-prelock \
131
        isolation \
132
        isolation-read-committed \
133 134 135 136 137
        keyrange \
        keyrange-dupsort \
        keyrange-dupsort-unflat \
        keyrange-unflat \
        loader-cleanup-test \
138 139
	loader-create-abort \
	loader-create-close \
140
	loader-db-busy \
141 142 143
        loader-dup-test \
        loader-no-puts \
        loader-reference-test \
144
	loader-stress-del \
145 146
        loader-stress-test \
        loader-tpch-load \
147
	lock-pressure \
148
        manyfiles \
Yoni Fogel's avatar
Yoni Fogel committed
149
	multiprocess \
150
	mvcc-create-table \
151
        mvcc-many-committed \
152 153 154 155
	prelock-read-read \
	prelock-read-write \
	prelock-write-read \
	prelock-write-write \
156
        powerfail \
157
	preload-db \
158
	preload-db-nested \
159
        progress \
160
	put-multiple \
161
        recover-2483 \
162
        recover-3113 \
163 164
        recover-compare-db \
        recover-compare-db-descriptor \
165 166
	recover-del-multiple \
	recover-del-multiple-abort \
167
        recover-del-multiple-srcdb-fdelete-all \
168 169
        recover-delboth-after-checkpoint \
        recover-delboth-checkpoint \
170 171 172
        recover-descriptor \
        recover-descriptor2 \
        recover-descriptor3 \
173 174 175 176 177 178 179
        recover-descriptor4 \
        recover-descriptor5 \
        recover-descriptor6 \
        recover-descriptor7 \
        recover-descriptor8 \
        recover-descriptor9 \
        recover-descriptor10 \
180 181
        recover-descriptor11 \
        recover-descriptor12 \
182
        recover-fclose-in-checkpoint \
183
        recover-fcreate-basementnodesize \
184 185
        recover-loader-test \
        recover-lsn-filter-multiple \
186 187
	recover-put-multiple \
	recover-put-multiple-abort \
188 189
        recover-put-multiple-fdelete-all \
        recover-put-multiple-fdelete-some \
190
        recover-put-multiple-srcdb-fdelete-all \
191 192
        recover-split-checkpoint \
        recover-tablelock \
193
	recover-test-logsuppress \
194
	recover-test-logsuppress-put \
195 196
	recover-upgrade-db-descriptor-multihandle \
	recover-upgrade-db-descriptor \
197 198
	recover-update-multiple \
	recover-update-multiple-abort \
199 200 201 202 203 204 205
	recover-update_aborts \
	recover-update_aborts_before_checkpoint \
	recover-update_aborts_before_close \
	recover-update_changes_values \
	recover-update_changes_values_before_checkpoint \
	recover-update_changes_values_before_close \
	recover-update_broadcast_aborts \
206 207
	recover-update_broadcast_aborts2 \
	recover-update_broadcast_aborts3 \
208 209 210
	recover-update_broadcast_aborts_before_checkpoint \
	recover-update_broadcast_aborts_before_close \
	recover-update_broadcast_changes_values \
211 212
	recover-update_broadcast_changes_values2 \
	recover-update_broadcast_changes_values3 \
213 214 215
	recover-update_broadcast_changes_values_before_checkpoint \
	recover-update_broadcast_changes_values_before_close \
	recover-update_changes_values_before_close \
216 217 218 219
        recovery_fileops_stress \
        recovery_fileops_unit \
        recovery_stress \
        redirect \
220
	replace-into-write-lock \
221 222 223
        root_fifo_2 \
        root_fifo_32 \
        root_fifo_41 \
224
	shutdown-3344 \
225
        stat64 stat64_flatten stat64-null-txn \
226
	stress-gc \
227 228 229
        test1324 \
        test1426 \
        test1572 \
230
	test3219 \
231
	test3522 \
232
	test3522b \
233
        test938c \
Zardosht Kasheff's avatar
Zardosht Kasheff committed
234
        test_3645 \
235
        test_3755 \
236 237 238
        test_abort1 \
        test_abort4 \
        test_abort5 \
239
	test_blobs_leaf_split \
Zardosht Kasheff's avatar
Zardosht Kasheff committed
240
	test_bulk_fetch \
241 242 243 244 245 246
        test_cursor_delete_2119 \
        test_db_descriptor \
        test_db_descriptor_named_db \
        test_dbremove_old \
        test_dupsort_get_both_range_reverse \
        test_dupsort_set_range_reverse \
247
	test_large_update_broadcast_small_cachetable \
248
        test_logflush \
249
        test_transactional_descriptor \
250 251 252 253
        test_trans_desc_during_chkpt \
        test_trans_desc_during_chkpt2 \
        test_trans_desc_during_chkpt3 \
        test_trans_desc_during_chkpt4 \
254 255 256 257 258 259 260 261 262 263
        test_txn_abort6 \
        test_txn_abort8 \
        test_txn_abort9 \
        test_txn_close_open_commit \
        test_txn_commit8 \
        test_txn_nested1 \
        test_txn_nested2 \
        test_txn_nested3 \
        test_txn_nested4 \
        test_txn_nested5 \
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
	test_update_abort_works \
	test_update_calls_back \
	test_update_can_delete_elements \
	test_update_changes_values \
	test_update_nonexistent_keys \
	test_update_previously_deleted \
	test_update_stress \
	test_update_txn_snapshot_works_concurrently \
	test_update_txn_snapshot_works_correctly_with_deletes \
	test_update_broadcast_abort_works \
	test_update_broadcast_calls_back \
	test_update_broadcast_can_delete_elements \
	test_update_broadcast_changes_values \
	test_update_broadcast_previously_deleted \
	test_update_broadcast_stress \
	test_update_broadcast_update_fun_has_choices \
	test_update_broadcast_with_empty_table \
        test_update_broadcast_indexer \
	test_update_broadcast_loader \
	test_update_broadcast_nested_updates \
	test_update_nested_updates \
	test_update_with_empty_table \
286
	txn-ignore \
287
        transactional_fileops \
288
	update-multiple-data-diagonal \
289 290 291
	update-multiple-key0 \
	update-multiple-nochange \
	update-multiple-with-indexer \
292
	update \
293
        upgrade_simple \
294 295 296 297
	upgrade-test-1 \
	upgrade-test-2 \
	upgrade-test-3 \
	upgrade-test-4 \
298
	upgrade-test-5 \
299
        upgrade-test-6 \
300
        upgrade-test-7 \
301
        zombie_db \
302 303
#\ ends prev line

304 305 306 307
# 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)

308 309 310
BDB_TESTS_THAT_SHOULD_FAIL= \
#\ ends prev line
ifeq ($(OS_CHOICE),windows)
311 312
    #The following are nondeterministic test failures or hangs in windows.  Just get rid of them in BDB. (for now)
    WINDOWS_BDB_DONTRUN_TESTS += \
313
	test_archive2 \
314
	test_cursor_delete \
315
	test_cursor_stickyness \
316 317
	test_db_dbt_mem_behavior \
	test_dup_insert \
318
	test_dup_search \
319
	test_dupsort_get \
320 321 322
	test_dupsort_set \
	test_unused_memory_crash \
	test_dupsort_get_both_range \
323 324
	test_reverse_compare_fun \
	test-recover3 \
325 326 327
#\ ends prev line
endif

328

329 330 331 332
ifeq ($(OS_CHOICE),windows)
    BDB_DONTRUN_TESTS+=$(WINDOWS_BDB_DONTRUN_TESTS)
endif

333 334 335 336
ifeq ($(OS_CHOICE),windows)
BDB_TESTS=
BDB_BINS=
else
337
BDB_TESTS = $(patsubst %.c,%.bdb$(BINSUF),$(filter-out $(patsubst %,%.c,$(BDB_DONTRUN_TESTS)),$(SRCS)))
338 339
BDB_BINS = $(patsubst %.c,%.bdb$(BINSUF),$(filter-out $(patsubst %,%.c,$(BDB_DONTRUN_TESTS)),$(SRCS)))
endif
340 341

TDB_TESTS_THAT_SHOULD_FAIL= \
342
	test_blobs_leaf_split \
343
	test_truncate_txn_abort \
344
	test_db_no_env \
345
#\ ends prev line
346 347
#ifneq ($(OS_CHOICE),windows)
#    TDB_TESTS_THAT_SHOULD_FAIL+= \
348
#\ ends prev line
349
#endif
350

351
TDB_TESTS_THAT_SHOULD_FAIL_LIT= \
352 353 354
	test_log8.recover \
	test_log9.recover \
	test_log10.recover \
355 356
	recover-missing-dbfile.abortrecover \
	recover-missing-dbfile-2.abortrecover \
357 358
	recover-missing-dbfile-2.abortrecover \
	recover-dbopen-eclose.abortrecover \
359
	loader-tpch-load.loader \
360 361
#\ ends prev line

362 363
ifeq ($(OS_CHOICE),windows)
    #Tests that fail in windows but shouldn't.  TODO: Fix each one of these and remove from the list!
364
    WIN_IGNORE_TDB_TESTS_THAT_SHOULD_FAIL += \
365
#\ ends prev line
366
    WIN_IGNORE_TDB_TESTS_THAT_SHOULD_FAIL_LIT += \
367 368 369
#\ ends prev line
endif

370 371 372 373 374 375 376
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
377 378
endif

379
TLRECOVER = 2 3 4 5 6 7 8 9 10
380

381 382
EXTRA_TDB_TESTS = \
	$(patsubst %,test_log%.recover,$(TLRECOVER)) \
383 384
	test_groupcommit_count_hgrind.tdbrun \
	test_groupcommit_count_vgrind.tdbrun \
385
#\ ends prev line
Bradley C. Kuszmaul's avatar
up  
Bradley C. Kuszmaul committed
386

387 388 389 390 391 392
ifeq ($(OS_CHOICE),windows)
EXTRA_TDB_TESTS = \
	$(patsubst %,test_log%.recover,$(filter-out $(patsubst %,%.c,$(WINDOWS_DONTRUN_TESTS)),$(TLRECOVER))) \
#\ ends prev line
endif

393
RECOVER_TESTS = $(patsubst %.c,%.abortrecover,$(RECOVER_SRCS))
394
LOADER_TESTS = $(patsubst %.c,%.loader,$(LOADER_SRCS))
395 396
ifeq ($(OS_CHOICE),windows)
RECOVER_TESTS = $(patsubst %.c,%.abortrecover,$(filter-out $(patsubst %,%.c,$(WINDOWS_DONTRUN_TESTS)),$(RECOVER_SRCS)))
397
LOADER_TESTS = $(patsubst %.c,%.loader,$(filter-out $(patsubst %,%.c,$(WINDOWS_DONTRUN_TESTS)),$(LOADER_SRCS)))
398
endif
399

400 401

RUN_TDB_TESTS = $(patsubst %.tdb$(BINSUF),%.tdbrun,$(TDB_TESTS))  $(EXTRA_TDB_TESTS) $(RECOVER_TESTS) $(LOADER_TESTS)
402 403
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
404

405
MORE_BDB_BINS = test1426.bdb$(BINSUF)
406

407 408
ALL_BINS = $(TDB_BINS) $(BDB_BINS) $(MORE_BDB_BINS)

409
.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
410

411
default all build: $(ALL_BINS)
412

413
ifndef TOKUDBONLY
Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
414 415 416
MAYBE_CHECK_BDB = check.bdb
else
MAYBE_CHECK_BDB =
Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
417
endif
Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
418
check: check.tdb $(MAYBE_CHECK_BDB) ;
419

420
tests: tests.bdb tests.tdb ;
421
tests.bdb: $(BDB_BINS) ;
422
check.bdb: $(RUN_BDB_TESTS) ;
423
tests.tdb: $(TDB_BINS) ;
424
check.tdb: $(LIBTDB) $(PTHREAD_LOCAL) $(RUN_TDB_TESTS) ;
425 426
check.tdb.extra: $(EXTRA_TDB_TESTS) ;
check.abortrecover: $(RECOVER_TESTS) ;
427

428
foo:
429 430
	echo RUN_TDB_TESTS: $(RUN_TDB_TESTS)
	echo ALL_TESTS: $(ALL_TESTS)
431

432 433 434
#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))
435

436 437
.PHONY: %.bdbrun %.run %.tdbrun
# STUFF!!!!
438

439 440
%.run: %.bdbrun %.tdbrun

441 442
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))
443 444 445
# Any test that should fail, we invert the result by using MAYBEINVERTER
$(SHOULD_FAIL): MAYBEINVERTER=$(INVERTER)
$(SHOULD_FAIL): SUMMARIZE_CMD=$(SUMMARIZE_SHOULD_FAIL)
446 447 448
# I want the failing tests to send their stderr to /dev/null
$(SHOULD_FAIL): VGRIND+= --log-file=/dev/null
# $(SHOULD_FAIL): INVERTER= 2> /dev/null ;test $$? -ne 0
449

450 451
TDBVGRIND=$(VGRIND)

452 453
ifeq ($(OS_CHOICE),windows)
ifdef BDBDIR
454
%.bdb$(BINSUF): INCLUDEDIRS=-I$(BDBDIR)/include -I$(TOKUROOT)newbrt
455 456 457
%.bdb$(BINSUF): RPATH_DIRS=$(BDBDIR)/lib
endif
ifeq ($(DEBUG),0)
458
WINDOWS_BDB_LIB_NAME=libdb.$(SOEXT)
459
$(WINDOWS_BDB_LIB_NAME):
460
	cp $(BDBDIR)/lib/libdb[0-9][0-9].$(SOEXT) ./
461
else
462
WINDOWS_BDB_LIB_NAME=libdbd.$(SOEXT)
463
$(WINDOWS_BDB_LIB_NAME):
464
	cp $(BDBDIR)/lib/libdb[0-9][0-9]d.$(SOEXT) ./
465 466
endif
%.bdb$(BINSUF): DLINK_FILES=$(BDBDIR)/lib/$(WINDOWS_BDB_LIB_NAME)
467
#empty
468 469 470 471 472 473 474 475 476 477 478
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
479
# Use -s on the command line to make things quiet.
480
# Use -s on the command line to make things quiet.
481
%.bdbrun: %.bdb$(BINSUF) $(DEPEND_COMPILE) $(DEPEND_LINK) $(WINDOWS_BDB_LIB_NAME)
482
	$(BDBVGRIND) ./$< $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
483
%.tdbrun: %.tdb$(BINSUF) $(DEPEND_COMPILE) $(DEPEND_LINK) $(LIBTDB) $(PTHREAD_LOCAL)
484
	$(TDBVGRIND) ./$< $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
485

486 487 488 489 490 491 492
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
493
TDBRECOVER=$(TOKUROOT)newbrt/tdb-recover$(BINSUF)
494 495 496
TDBBRTDUMP=$(TOKUROOT)newbrt/brtdump$(BINSUF)

$(TDBBRTDUMP) $(TDBLOAD) $(TDBDUMP) $(TDBRECOVER):
497
	cd $(@D) && $(MAKE) $(@F)
498

499
%.recover: %.tdb$(BINSUF) $(PTHREAD_LOCAL) $(TDBRECOVER) $(TDBDUMP)
500
	echo doing ./$< &&\
501 502 503 504 505 506
	./$< --no-shutdown                                                         && \
	rm -rf dir.$*.c.tdb.recover                                                && \
	mkdir dir.$*.c.tdb.recover                                                 && \
	cp dir.$*.c.tdb/tokudb.directory   dir.$*.c.tdb.recover/                   && \
	cp dir.$*.c.tdb/tokudb.environment dir.$*.c.tdb.recover/                   && \
	cp dir.$*.c.tdb/tokudb.rollback    dir.$*.c.tdb.recover/                   && \
507
	cp dir.$*.c.tdb/*.tokulog*         dir.$*.c.tdb.recover/                   && \
508
	echo doing recovery &&\
509
	$(VGRIND) $(TDBRECOVER) dir.$*.c.tdb.recover dir.$*.c.tdb.recover         && \
510
	echo dump and compare &&\
511 512
	$(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  && \
513
	diff -q dir.$*.c.tdb/foo.dump dir.$*.c.tdb.recover/foo.dump                                   \
514 515
	$(MAYBEINVERTER) $(SUMMARIZE_CMD)

516
%.recoverwc: %.tdb$(BINSUF) $(PTHREAD_LOCAL)
517
	 (cd dir.$*.c.tdb;pwd;cat log*| ../../../newbrt/tdb_logprint |wc -c)
518

519
ABORTCODE=137
520
%.abortrecover: %.tdb$(BINSUF) $(PTHREAD_LOCAL)
521
	{ ./$< --test ; } ; \
522
        if [ $$? -ne $(ABORTCODE) ] ; then \
523
		echo $* --test did not return $(ABORTCODE); \
524 525
		test 0 = 1; \
        else \
526
		$(VGRIND) ./$< --recover; \
527 528 529
	fi \
	$(MAYBEINVERTER) $(SUMMARIZE_CMD)

530
.PHONY: %.loader
531
# Generally these subtests cannot run in parallel unless they support an environment arg
532
%.loader: %.tdb$(BINSUF) $(PTHREAD_LOCAL)
533
	$(TDBVGRIND) ./$< $(EXTRA_ARGS) $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
534
	$(TDBVGRIND) ./$< $(EXTRA_ARGS) -p $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
535

536
.PHONY: %.recover
537
all.recover: $(patsubst %,test_log%.recover,$(TLRECOVER)) $(PTHREAD_LOCAL) ;
538 539 540 541

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

542 543 544
BDB_CFLAGS=
TDB_CFLAGS=
%.bdb$(BINSUF): BDB_CFLAGS= -DENVDIR=\"dir.$<.bdb\" -DUSE_BDB -DIS_TDB=0 -DTOKU_ALLOW_DEPRECATED
545 546

%.bdb$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK)
547
	$(CC) $< $(BDB_CFLAGS) $(BIN_FROM_C_FLAGS) -L$(TOKUROOT)lib -Wl,-rpath,$(shell pwd)/$(TOKUROOT)lib -ltokuportability $(LINK_MUST_BE_LAST)
548 549

%.tdbt$(BINSUF): DLINK_FILES+=$(TLIBTDB)
Yoni Fogel's avatar
Yoni Fogel committed
550
%.tdbt$(BINSUF): RPATH_DIRS+=$(dir $(TLIBTDB))
551 552

%.tdb$(BINSUF) %.tdbt$(BINSUF): TDB_CFLAGS= -DENVDIR=\"dir.$<.tdb\" -DUSE_TDB -DIS_TDB=1
553
%.tdb$(BINSUF) %.tdbt$(BINSUF): CPPFLAGS+=-I$(TOKUROOT)include
554
%.tdb$(BINSUF) %.tdbt$(BINSUF): LDFLAGS+=-ltokuportability
555
loader-stress-test: CPPFLAGS+=-I$(TOKUROOT)include -DENVDIR=\"dir.$<\"
556
loader-stress-test: LOADLIBES+=-L../lib -ltokudb -Wl,-rpath,..
557

Yoni Fogel's avatar
Yoni Fogel committed
558
%.tdb$(BINSUF) %.tdbt$(BINSUF): %.c $(DEPEND_COMPILE) $(DEPEND_LINK) $(TDB_EXTRA_NEEDED)
559
	$(CC) $< $(TDB_CFLAGS) $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
560 561 562 563 564 565 566 567

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
568

569
# Need these rule so that Make knows about all the file names
Vincenzo Liberatore's avatar
Vincenzo Liberatore committed
570
.PHONY: %.run
571 572
$(RUN_ALL_TESTS):
$(ALL_TESTS):
Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
573

574
%.run: %.bdbrun %.tdbrun
575
	@ echo ok
576

577 578 579



580 581 582 583 584
INVERTER=;test $$? -ne 0

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

585 586
HERE = src/tests

587

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

590 591
# Don't run valgrind on the groupcommit performance tests
test_groupcommit_perf.bdbrun test_groupcommit_perf.tdbrun: VGRIND=
592
# Use helgrind on the group commit count test
593 594
# helgrind is too flakey, so I'm removing it from the tests. -Bradley
#test_groupcommit_count_helgrind.tdbrun: test_groupcommit_count_helgrind.tdb
595
#	$(HGRIND) ./$< $(VERBVERBOSE)
596 597


598 599
# Don't run valgrind on the diskfull test (since it aborts)
diskfull.tdbrun: VGRIND=
600
stress-gc.tdbrun: VGRIND=
601
insert-dup-prelock: VGRIND=
Zardosht Kasheff's avatar
Zardosht Kasheff committed
602
test_3645: VGRIND=
603
test_large_update_broadcast_small_cachetable.tdbrun: VGRIND=
604 605
test_update_broadcast_stress.tdbrun: VGRIND=
test_update_stress.tdbrun: VGRIND=
606 607
stress-test.tdbrun: VGRIND=
stress-test.bdbrun: VGRIND=
608

609

610
libs:
Yoni Fogel's avatar
Yoni Fogel committed
611
	cd ..;$(MAKE)
612

613

614

Vincenzo Liberatore's avatar
Vincenzo Liberatore committed
615

616 617

loader-cleanup-test.tdb$(BINSUF) diskfull.tdb$(BINSUF): CPPFLAGS+=-DDONT_DEPRECATE_WRITES
618 619
test_db_curs4.tdb$(BINSUF): trace.h
test_db_curs4.bdb$(BINSUF): trace.h
620 621 622 623 624 625 626 627 628 629 630 631
# 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
632
	true $(SUMMARIZE_CMD) #State that this has passed.
633

634
tgbr_%_a.tdbrun: test_get_both_range.tdb$(BINSUF) $(PTHREAD_LOCAL)
635
	$(VGRIND) ./$< $(VERBVERBOSE) -i $* -a $(MAYBEINVERTER) $(SUMMARIZE_CMD)
636
tgbr_%_b.tdbrun: test_get_both_range.tdb$(BINSUF) $(PTHREAD_LOCAL)
637
	$(VGRIND) ./$< $(VERBVERBOSE) -i $* -b $(MAYBEINVERTER) $(SUMMARIZE_CMD)
638
tgbr_%_c.tdbrun: test_get_both_range.tdb$(BINSUF) $(PTHREAD_LOCAL)
639
	$(VGRIND) ./$< $(VERBVERBOSE) -i $* -c $(MAYBEINVERTER) $(SUMMARIZE_CMD)
640

641 642 643 644
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 > $@
645

646
else
647
dump.bdb.1426: test1426.bdb$(BINSUF) test1426.bdbdump/dump.bdb.1426
648 649 650 651 652
	./$< -q  && \
	 $(BDBDIR)/bin/db_dump -p -h dir.test1426.c.bdb main > $@
	diff -q $@ test1426.bdbdump/$@ #Assert output is correct.
endif

653
# test1426 is run by comparing the BDB output to the TDB output
654
# we use the -x flag (no transactions or recovery) in the dump program.  (-x is not in the BDB version of dump, but it's in ours)
655
test1426.tdbrun: test1426.tdb$(BINSUF) dump.bdb.1426 $(PTHREAD_LOCAL) $(TDBDUMP)
656
	(./test1426.tdb$(BINSUF) -q && \
657
	 $(TDBDUMP) -x -p -h dir.test1426.c.tdb main > dump.tdb.1426 && \
658
	 diff -q -I db_pagesize=4096 dump.bdb.1426 dump.tdb.1426 ) \
659
	 $(MAYBEINVERTER) $(SUMMARIZE_CMD)
660

661
# STRESS RUNS is number of iterations, STRESS_SIZE is operations per iteration (must not change between iterations)
662 663 664
# Note the magic with the brackets is there to suppress the printout of "/bin/bash: line 11: 1234 Killed ...."
# See http://stackoverflow.com/questions/714855/bash-suppress-notice-of-forked-command-being-killed
# also we only print the date if VERBOSE is set to non-null
665 666
STRESS_RUNS=5
STRESS_SIZE=5001
667
checkpoint_stress.tdbrun: SHELL=/bin/bash
668
checkpoint_stress.tdbrun: checkpoint_stress.tdb$(BINSUF) $(PTHREAD_LOCAL)
669 670
	$(VGRIND) ./$< -C -n $(STRESS_SIZE) $(VERBVERBOSE) && \
	($(VGRIND) ./$< -C -i 0 -n $(STRESS_SIZE) $(VERBVERBOSE) && \
671
	 for (( i = 1; i < $(STRESS_RUNS); i++ )); do \
672 673
		$(if $(VERBOSE),date;) \
		{ ./$< -c -i $$i -n $(STRESS_SIZE) $(VERBVERBOSE) 2> dir.checkpoint_stress.c.tdb/error.$$i ; } 2>/dev/null ; \
674 675 676
                if [ $$? -ne $(ABORTCODE) ] ; then \
                   exit 1 ; \
                fi ; \
677
		if ! grep -q 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.$$i; then break; fi; \
678 679 680 681
	done && \
	test `grep -l 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.* |wc -l` = $$(($(STRESS_RUNS)-1)) \
	) $(MAYBEINVERTER) $(SUMMARIZE_CMD)

682 683 684 685 686 687
DISKFULL_ABORTCODE=134

diskfull.tdbrun: SHELL=/bin/bash
diskfull.tdbrun: diskfull.tdb$(BINSUF) $(PTHREAD_LOCAL)
	NUM_WRITES=$$($(VGRIND) ./$< -q) && \
	(for (( i = 0; i < $$NUM_WRITES; i++ )); do \
688
		{ ./$< -C $$i $(VERBVERBOSE) 2>/dev/null; } 2>/dev/null; \
689 690 691 692 693 694
		if [ $$? -ne $(DISKFULL_ABORTCODE) ] ; then \
		    echo "Diskfull (iteration $$i) did not abort" ; \
		    exit 1; \
		fi; \
	done; ) $(MAYBEINVERTER) $(SUMMARIZE_CMD)

695 696 697 698 699
recover_stress.tdbrun: SHELL=/bin/bash
recover_stress.tdbrun: checkpoint_stress.tdb$(BINSUF) $(PTHREAD_LOCAL)
	$(VGRIND) ./$< -C -n $(STRESS_SIZE) -l $(VERBVERBOSE) && \
	($(VGRIND) ./$< -C -i 0 -n $(STRESS_SIZE) -l $(VERBVERBOSE) && \
	 for (( i = 1; i < $(STRESS_RUNS); i++ )); do \
700 701
		$(if $(VERBOSE),date;) \
		{ ./$< -c -i $$i -n $(STRESS_SIZE) -l $(VERBVERBOSE) 2> dir.checkpoint_stress.c.tdb/error.$$i ; } 2>/dev/null ; \
702 703 704
                if [ $$? -ne $(ABORTCODE) ] ; then \
                   exit 1 ; \
                fi ; \
705
		if ! grep -q 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.$$i; then break; fi; \
706 707 708 709
	done && \
	test `grep -l 'HAPPY CRASH' dir.checkpoint_stress.c.tdb/error.* |wc -l` = $$(($(STRESS_RUNS)-1)) \
	) $(MAYBEINVERTER) $(SUMMARIZE_CMD)

710 711 712 713
recovery_fileops_unit.tdbrun: SHELL=/bin/bash
recovery_fileops_unit.tdbrun: recovery_fileops_unit.tdb$(BINSUF) $(PTHREAD_LOCAL)
	rm -rf dir.$@.errors
	mkdir dir.$@.errors
714
	$(MAYBEATSIGN)( \
715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743
        Oset="c d r"; \
        aset="0 1"; \
        bset="0 1"; \
        cset="0 1 2"; \
        fset="0 1"; \
        count=0; \
        for O in $$Oset; do \
           if test $$O = c ; then \
              gset="0"; \
              hset="0"; \
           else \
              gset="0 1 2 3 4 5"; \
              hset="0 1"; \
           fi; \
           for a in $$aset; do \
              for b in $$bset; do \
                 if test $$b -eq 0 ; then \
                    dset="0"; \
                    eset="0"; \
                 else \
                    dset="0 1"; \
                    eset="0 1"; \
                 fi; \
                 for c in $$cset; do \
                    for d in $$dset; do \
                       for e in $$eset; do \
                          for f in $$fset; do \
                             for g in $$gset; do \
                                for h in $$hset; do \
744 745 746 747 748 749 750 751
                                   if test \( $$O != c \) -a \( $$c -eq 0 \) -a \( \( $$b -eq 0 \) -o \( $$e -eq 0 \) -o  \( $$d -eq 1 \)  \) ; then \
                                      iset="0 1"; \
                                   else \
                                      iset="0"; \
                                   fi; \
                                   for i in $$iset; do \
                                      errorfile=dir.$@.errors/crash.$$O.$$a.$$b.$$c.$$d.$$e.$$f.$$g.$$h.$$i; \
                                      combination="-O $$O -A $$a -B $$b -C $$c -D $$d -E $$e -F $$f -G $$g -H $$h -I $$i"; \
752
                                      { ./$< $(VERBVERBOSE) -c $$combination 2> $$errorfile ; } 2>/dev/null ;\
753 754 755
                                      if [ $$? -ne $(ABORTCODE) ] ; then \
                                         { cat dir.$@.errors/crash; echo Error: no crash in $$errorfile ; exit 1; }; \
                                      fi ; \
756 757 758 759
                                      grep 'HAPPY CRASH' $$errorfile >/dev/null || { cat $$errorfile; echo Error: incorrect crash in $$errorfile ; exit 1; }; \
                                      ./$< $(VERBVERBOSE) -r $$combination 2>> $$errorfile || { cat $$errorfile ; echo Error: during recovery in $$errorfile ; exit 1; }; \
                                      count=$$(($$count + 1)); \
                                   done; \
760 761 762 763 764 765 766 767 768
                                done; \
                             done; \
                          done; \
                       done; \
                    done; \
                 done; \
              done; \
           done; \
        done; \
769
	(test -n "$(VERBOSE)" && echo $$count tests passed) || true; \
770 771
	) $(SUMMARIZE_CMD)

Yoni Fogel's avatar
Yoni Fogel committed
772
# helgrind1 is supposed to fail.
773
helgrind1.tdbrun: TDBVGRIND=$(HGRIND) --log-file=helgrind1.tdb.deleteme
Yoni Fogel's avatar
Yoni Fogel committed
774 775
helgrind1.tdbrun: MAYBEINVERTER=$(INVERTER)
helgrind2.bdbrun: BDBVGRIND=$(HGRIND)
776 777
helgrind2.tdbrun helgrind3.tdbrun: TDBVGRIND=$(HGRIND)
helgrind2.tdbrun helgrind3.tdbrun: HGRIND+=--suppressions=helgrind.suppressions
Yoni Fogel's avatar
Yoni Fogel committed
778 779
helgrind3.bdbrun: BDBVGRIND=$(HGRIND)

780

781 782 783 784 785 786
test_groupcommit_count_hgrind.tdbrun: HGRIND+=--suppressions=helgrind.suppressions
test_groupcommit_count_hgrind.tdbrun: test_groupcommit_count.tdb$(BINSUF)
	$(HGRIND) ./test_groupcommit_count.tdb$(BINSUF) $(VERBVERBOSE) -n 1 -p hgrind $(SUMMARIZE_CMD)
test_groupcommit_count_vgrind.tdbrun: test_groupcommit_count.tdb$(BINSUF)
	$(VGRIND) ./test_groupcommit_count.tdb$(BINSUF) $(VERBVERBOSE) -n 1 -p vgrind $(SUMMARIZE_CMD)

787 788 789 790 791 792
# we deliberately don't close the env, so recovery runs
# lets avoid all of the valgrind errors
test-recover1.tdbrun: VGRIND=
test-recover2.tdbrun: VGRIND=
test-recover3.tdbrun: VGRIND=

793 794 795
# filesize is too slow with vgrind.
filesize.tdbrun: VGRIND=

796 797 798
powerfail.tdbrun:
	@echo must run powerfail by hand $(SUMMARIZE_CMD)

799 800
dumpit: $(TDBBRTDUMP)
	$(TDBBRTDUMP)  dir.test_log5.c.tdb.recover/foo.db > dump.r && $(TDBBRTDUMP) dir.test_log5.c.tdb/foo.db > dump.o && diff -q dump.o dump.r
801 802

# test on small stacks
803
test_thread_stack.%run: test_thread_stack.%$(BINSUF) $(PTHREAD_LOCAL)
804 805
	./$< -a -thread_stack 16384         && \
	./$< -a -thread_stack 16384 -resume $(SUMMARIZE_CMD)
806

807 808 809
preload-db-nested.tdbrun: VGRIND=
upgrade-test-4.tdbrun: VGRIND=

810 811 812
# re-enable loader-stress-test3 when upgrade is complete
#loader-stress-test.loader: $(patsubst %,loader-stress-test%.tdbrun, 0 1 2 3)
loader-stress-test.loader: $(patsubst %,loader-stress-test%.tdbrun, 0 1 2)
813 814 815
	true

loader-stress-test0.tdbrun: loader-stress-test.tdb$(BINSUF)
816
	$(TDBVGRIND) ./$< $(EXTRA_ARGS) -e 0 -c $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
817 818

loader-stress-test1.tdbrun: loader-stress-test.tdb$(BINSUF)
819
	$(TDBVGRIND) ./$< $(EXTRA_ARGS) -e 1 -c -p $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
820 821

loader-stress-test2.tdbrun: loader-stress-test.tdb$(BINSUF) 
822
	$(TDBVGRIND) ./$< $(EXTRA_ARGS) -e 2 -r 5000 -s $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD) # to manifest #2717.
823

824 825 826
loader-stress-test3.tdbrun: loader-stress-test.tdb$(BINSUF)
	$(TDBVGRIND) ./$< $(EXTRA_ARGS) -e 3 -u -c $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)

827 828
loader-dup-test.loader loader-dup-test.tdbrun: $(patsubst %,loader-dup-test%.tdbrun, 0 1 2 3 4 5)
	true $(SUMMARIZE_CMD) #State that this has passed.  Override the default rule.
829 830 831

loader-dup-test0.tdbrun: loader-dup-test.tdb$(BINSUF)
	$(VGRIND) ./loader-dup-test.tdb -e 0 $(SUMMARIZE_CMD)
832 833 834

loader-dup-test1.tdbrun: loader-dup-test.tdb$(BINSUF)
	$(VGRIND) ./loader-dup-test.tdb -d 1 -r 500000 -e 1 $(SUMMARIZE_CMD)
835 836 837 838 839 840 841 842 843 844 845 846 847

loader-dup-test2.tdbrun: loader-dup-test.tdb$(BINSUF)
	$(VGRIND) ./loader-dup-test.tdb -d 1 -r 1000000 -e 2 $(SUMMARIZE_CMD)

loader-dup-test3.tdbrun: loader-dup-test.tdb$(BINSUF)
	$(VGRIND) ./loader-dup-test.tdb -d 1 -s -r 100 -e 3 $(SUMMARIZE_CMD)

loader-dup-test4.tdbrun: loader-dup-test.tdb$(BINSUF)
	$(VGRIND) ./loader-dup-test.tdb -d 1 -s -r 1000 -e 4 $(SUMMARIZE_CMD)

loader-dup-test5.tdbrun: loader-dup-test.tdb$(BINSUF)
	$(VGRIND) ./loader-dup-test.tdb -d 1 -s -r 1000 -E -e 5 $(SUMMARIZE_CMD)

848 849 850 851 852 853 854 855
loader-cleanup-test.loader: $(patsubst %,loader-cleanup-test%.tdbrun, 0 1)
	true

loader-cleanup-test0.tdbrun: loader-cleanup-test.tdb$(BINSUF)
	$(VGRIND) ./$< -s -r 8000 -e 0 $(SUMMARIZE_CMD)

loader-cleanup-test1.tdbrun: loader-cleanup-test.tdb$(BINSUF)
	$(VGRIND) ./$< -s -r 8000 -p -e 1 $(SUMMARIZE_CMD)
856

857 858 859 860 861 862 863 864 865 866
ROOT_FIFO_41_RUNS = $(foreach num, $(shell seq 1 100), root_fifo_41_$(num)_populate.tdbrun root_fifo_41_$(num)_nopopulate.tdbrun)
root_fifo_41.tdbrun: $(ROOT_FIFO_41_RUNS)
	@echo -n
root_fifo_41_%_populate.tdbrun: root_fifo_41.tdb
	$(VGRIND) ./$< -n $(patsubst root_fifo_41_%_populate.tdbrun, %, $@)   -h $(patsubst %.tdbrun, %.tdbdir, $@) -populate $(SUMMARIZE_CMD)
	@rm -rf $(patsubst %.tdbrun, %.dir, $@) 
root_fifo_41_%_nopopulate.tdbrun: root_fifo_41.tdb
	$(VGRIND) ./$< -n $(patsubst root_fifo_41_%_nopopulate.tdbrun, %, $@) -h $(patsubst %.tdbrun, %.tdbdir, $@)           $(SUMMARIZE_CMD)
	@rm -rf $(patsubst %.tdbrun, %.dir, $@) 

867
LOADER_USE_DEFAULT_TESTS = create-abort create-close no-puts reference-test stress-test tpch-load
868

869 870
loader-tests: $(LOADER_TESTS)
	echo $(LOADER_TESTS)
871

872 873 874
HOTINDEXER_UNDO_TESTS = $(wildcard hotindexer-undo-do-tests/*.test)
CHECK_HOTINDEXER_UNDO_TESTS = $(patsubst %.test,%.run,$(HOTINDEXER_UNDO_TESTS))

875
hotindexer-undo-do-test.tdbrun: $(CHECK_HOTINDEXER_UNDO_TESTS)
876 877
	true

878 879 880
test3039.tdbrun: test3039.tdb
	( ($(VGRIND) ./$< -v -n 1000 ) && ./$< -v ) $(SUMMARIZE_CMD)

881
$(CHECK_HOTINDEXER_UNDO_TESTS): %.run: %.test hotindexer-undo-do-test.tdb$(BINSUF)
882 883
	./run-hotindexer-undo-do-tests.bash $< $(SUMMARIZE_CMD)

884 885 886 887 888
clean:
	rm -f $(ALL_BINS)
	rm -rf dir.* *.check.output *.check.valgrind
	rm -f dump.bdb.1426 dump.tdb.1426 test1426.bdb
	rm -f *.bdb *.tdb