separate out a separate makefile for the tests
This commit is contained in:
parent
c7d946a3d9
commit
c2ab11e034
39
Makefile
39
Makefile
@ -6,28 +6,16 @@ SOURCE=\
|
|||||||
space_map_disk.cc \
|
space_map_disk.cc \
|
||||||
transaction_manager.cc
|
transaction_manager.cc
|
||||||
|
|
||||||
TEST_SOURCE=\
|
|
||||||
unit-tests/block_t.cc \
|
|
||||||
unit-tests/btree_t.cc \
|
|
||||||
unit-tests/endian_t.cc \
|
|
||||||
unit-tests/space_map_t.cc \
|
|
||||||
unit-tests/space_map_disk_t.cc \
|
|
||||||
unit-tests/transaction_manager_t.cc \
|
|
||||||
|
|
||||||
OBJECTS=$(subst .cc,.o,$(SOURCE))
|
OBJECTS=$(subst .cc,.o,$(SOURCE))
|
||||||
TEST_PROGRAMS=$(subst .cc,,$(TEST_SOURCE))
|
|
||||||
TOP_DIR:=$(PWD)
|
TOP_DIR:=$(PWD)
|
||||||
#CPPFLAGS=-Wall -g -I$(TOP_DIR)
|
#CPPFLAGS=-Wall -g -I$(TOP_DIR)
|
||||||
CPPFLAGS=-Wall -std=c++0x -g -I$(TOP_DIR)
|
CPPFLAGS=-Wall -std=c++0x -g -I$(TOP_DIR)
|
||||||
LIBS=-lstdc++
|
LIBS=-lstdc++
|
||||||
|
|
||||||
.PHONEY: unit-tests test-programs
|
.PHONEY: test-programs
|
||||||
|
|
||||||
test-programs: $(TEST_PROGRAMS)
|
test-programs: $(TEST_PROGRAMS)
|
||||||
|
|
||||||
unit-test: $(TEST_PROGRAMS)
|
|
||||||
for p in $(TEST_PROGRAMS); do echo Running $$p; ./$$p; done
|
|
||||||
|
|
||||||
.SUFFIXES: .cc .o .d
|
.SUFFIXES: .cc .o .d
|
||||||
|
|
||||||
%.d: %.cc
|
%.d: %.cc
|
||||||
@ -38,35 +26,12 @@ unit-test: $(TEST_PROGRAMS)
|
|||||||
.cc.o:
|
.cc.o:
|
||||||
g++ -c $(CPPFLAGS) $(INCLUDES) -o $@ $<
|
g++ -c $(CPPFLAGS) $(INCLUDES) -o $@ $<
|
||||||
|
|
||||||
multisnap_display: $(OBJECTS) main.o
|
|
||||||
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
|
||||||
|
|
||||||
thin_dump: $(OBJECTS) thin_dump.o
|
thin_dump: $(OBJECTS) thin_dump.o
|
||||||
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
||||||
|
|
||||||
thin_repair: $(OBJECTS) thin_repair.o
|
thin_repair: $(OBJECTS) thin_repair.o
|
||||||
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
||||||
|
|
||||||
unit-tests/block_t: unit-tests/block_t.o
|
include unit-tests/Makefile.in
|
||||||
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
|
||||||
|
|
||||||
unit-tests/btree_t: unit-tests/btree_t.o $(OBJECTS)
|
|
||||||
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
|
||||||
|
|
||||||
unit-tests/space_map_t: unit-tests/space_map_t.o $(OBJECTS)
|
|
||||||
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
|
||||||
|
|
||||||
unit-tests/space_map_disk_t: unit-tests/space_map_disk_t.o $(OBJECTS)
|
|
||||||
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
|
||||||
|
|
||||||
unit-tests/transaction_manager_t: unit-tests/transaction_manager_t.o $(OBJECTS)
|
|
||||||
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
|
||||||
|
|
||||||
unit-tests/metadata_t: unit-tests/metadata_t.o $(OBJECTS)
|
|
||||||
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
|
||||||
|
|
||||||
unit-tests/endian_t: unit-tests/endian_t.o $(OBJECTS)
|
|
||||||
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
|
||||||
|
|
||||||
include $(subst .cc,.d,$(SOURCE))
|
include $(subst .cc,.d,$(SOURCE))
|
||||||
include $(subst .cc,.d,$(TEST_SOURCE))
|
include $(subst .cc,.d,$(TEST_SOURCE))
|
35
unit-tests/Makefile.in
Normal file
35
unit-tests/Makefile.in
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
TEST_SOURCE=\
|
||||||
|
unit-tests/block_t.cc \
|
||||||
|
unit-tests/btree_t.cc \
|
||||||
|
unit-tests/endian_t.cc \
|
||||||
|
unit-tests/space_map_t.cc \
|
||||||
|
unit-tests/space_map_disk_t.cc \
|
||||||
|
unit-tests/transaction_manager_t.cc
|
||||||
|
|
||||||
|
TEST_PROGRAMS=$(subst .cc,,$(TEST_SOURCE))
|
||||||
|
|
||||||
|
.PHONEY: unit-test
|
||||||
|
|
||||||
|
unit-test: $(TEST_PROGRAMS)
|
||||||
|
for p in $(TEST_PROGRAMS); do echo Running $$p; ./$$p; done
|
||||||
|
|
||||||
|
unit-tests/block_t: unit-tests/block_t.o
|
||||||
|
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
||||||
|
|
||||||
|
unit-tests/btree_t: unit-tests/btree_t.o $(OBJECTS)
|
||||||
|
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
||||||
|
|
||||||
|
unit-tests/space_map_t: unit-tests/space_map_t.o $(OBJECTS)
|
||||||
|
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
||||||
|
|
||||||
|
unit-tests/space_map_disk_t: unit-tests/space_map_disk_t.o $(OBJECTS)
|
||||||
|
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
||||||
|
|
||||||
|
unit-tests/transaction_manager_t: unit-tests/transaction_manager_t.o $(OBJECTS)
|
||||||
|
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
||||||
|
|
||||||
|
unit-tests/metadata_t: unit-tests/metadata_t.o $(OBJECTS)
|
||||||
|
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
||||||
|
|
||||||
|
unit-tests/endian_t: unit-tests/endian_t.o $(OBJECTS)
|
||||||
|
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
|
Loading…
Reference in New Issue
Block a user