Add unit test for memory layout based off the Kenton's layout-test.c++ and whole slew of fixes to get the test to pass

This commit is contained in:
James McKaskill 2013-05-07 11:04:49 -04:00
parent 12d72511b1
commit 3a235fe8c6
7 changed files with 824 additions and 273 deletions

View file

@ -1,12 +1,23 @@
.PHONY: all clean
.PHONY: all clean test
all: capn.so
CFLAGS=-g -Wall -Werror -fPIC -I. -Wno-unused-function
all: capn.so test
clean:
rm -f *.o *.so
rm -f *.o *.so capnpc-c compiler/*.o
%.o: %.c *.h *.inc
$(CC) -Wall -Werror -g -O2 -c $< -o $@
$(CC) $(CFLAGS) -c $< -o $@
capn.so: capn-malloc.o capn-stream.o capn.o
$(CC) -shared -Wall -Werror -fPIC -g -O2 $^ -o $@
$(CC) -shared $(CFLAGS) $^ -o $@
test: capn-test
./capn-test
%-test.o: %-test.cpp *.h *.c *.inc
$(CXX) `gtest-config --cppflags --cxxflags` -o $@ -c $<
capn-test: capn-test.o
$(CXX) `gtest-config --ldflags --libs` -o $@ $^