mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
Update log-test to work better and test some logging as unit tests. Addresses #484.
git-svn-id: file:///svn/tokudb@2739 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
42d88c4ec2
commit
c7461dd3a9
3 changed files with 33 additions and 4 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage
|
||||
# PROF_FLAGS = -pg
|
||||
OPTFLAGS = -O2
|
||||
# OPTFLAGS = -O2
|
||||
|
||||
ifeq ($(VERBOSE),2)
|
||||
VERBVERBOSE=-v
|
||||
|
@ -58,6 +58,7 @@ REGRESSION_TESTS = \
|
|||
brt-test4 \
|
||||
brt-test-cursor \
|
||||
log-test \
|
||||
log-test2 \
|
||||
test_oexcl \
|
||||
test-assert \
|
||||
test-primes \
|
||||
|
@ -134,7 +135,7 @@ check-fanout:
|
|||
let BRT_FANOUT=BRT_FANOUT+1; \
|
||||
done
|
||||
|
||||
log-test pma-test benchmark-test brt-test brt-test3 brt-test4 brt-test-cursor test-brt-delete-both brt-serialize-test brtdump test-inc-split test-del-inorder: LDFLAGS+=-lz
|
||||
log-test log-test2 pma-test benchmark-test brt-test brt-test3 brt-test4 brt-test-cursor test-brt-delete-both brt-serialize-test brtdump test-inc-split test-del-inorder: LDFLAGS+=-lz
|
||||
# pma: PROF_FLAGS=-fprofile-arcs -ftest-coverage
|
||||
|
||||
BRT_INTERNAL_H_INCLUDES = brt-internal.h cachetable.h fifo.h pma.h brt.h brttypes.h yerror.h ybt.h log.h ../include/db.h kv-pair.h memory.h crc.h
|
||||
|
@ -163,7 +164,7 @@ fifo-test: fifo.o memory.o toku_assert.o ybt.o
|
|||
brt-serialize.o: $(BRT_INTERNAL_H_INCLUDES) key.h wbuf.h rbuf.h
|
||||
brt-bigtest: memory.o ybt.o brt.o pma.o cachetable.o key.o fifo.o brt-serialize.o
|
||||
brt-bigtest.o: brt.h ../include/db.h
|
||||
log-test: log.o memory.o toku_assert.o roll.o log_code.o brt-serialize.o brt.o cachetable.o pma.o ybt.o fifo.o key.o fingerprint.o brt-verify.o mempool.o primes.o
|
||||
log-test2 log-test: log.o memory.o toku_assert.o roll.o log_code.o brt-serialize.o brt.o cachetable.o pma.o ybt.o fifo.o key.o fingerprint.o brt-verify.o mempool.o primes.o
|
||||
brt-verify.o: $(BRT_INTERNAL_H_INCLUDES)
|
||||
fingerprint.o: $(BRT_INTERNAL_H_INCLUDES)
|
||||
toku_assert.o: toku_assert.h
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define dname "log-test-dir"
|
||||
#define dname __FILE__ ".dir"
|
||||
#define rmrf "rm -rf " dname "/"
|
||||
|
||||
int main (int argc __attribute__((__unused__)),
|
||||
|
|
28
newbrt/log-test2.c
Normal file
28
newbrt/log-test2.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
/* -*- mode: C; c-basic-offset: 4 -*- */
|
||||
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
|
||||
|
||||
#include "log-internal.h"
|
||||
#include "toku_assert.h"
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define dname __FILE__ ".dir"
|
||||
#define rmrf "rm -rf " dname "/"
|
||||
|
||||
// create and close, making sure that everything is deallocated properly.
|
||||
|
||||
int main (int argc __attribute__((__unused__)),
|
||||
char *argv[] __attribute__((__unused__))) {
|
||||
int r;
|
||||
system(rmrf);
|
||||
r = mkdir(dname, 0700); assert(r==0);
|
||||
TOKULOGGER logger;
|
||||
r = toku_logger_create(&logger);
|
||||
assert(r == 0);
|
||||
r = toku_logger_close(&logger);
|
||||
assert(r == 0);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue