[functional-tests] roll all the C code into a single libft.so

This commit is contained in:
Joe Thornber 2017-10-10 10:28:56 +01:00
parent 5b5aa971a0
commit b9230d1bbb
9 changed files with 19 additions and 9 deletions

View File

@ -22,7 +22,7 @@ PROGRAMS=\
bin/pdata_tools bin/pdata_tools
.PHONY: all .PHONY: all
all: $(PROGRAMS) all: $(PROGRAMS) lib/libft.so
SOURCE=\ SOURCE=\
base/output_file_requirements.cc \ base/output_file_requirements.cc \
@ -231,7 +231,7 @@ clean:
find . -name \*.o -delete find . -name \*.o -delete
find . -name \*.gmo -delete find . -name \*.gmo -delete
find . -name \*.d -delete find . -name \*.d -delete
$(RM) $(TEST_PROGRAMS) $(PROGRAMS) $(GMOCK_OBJECTS) lib/*.a $(RM) $(TEST_PROGRAMS) $(PROGRAMS) $(GMOCK_OBJECTS) lib/*.a lib/*.so
distclean: clean distclean: clean
$(RM) config.cache config.log config.status configure.h version.h Makefile unit-tests/Makefile $(RM) config.cache config.log config.status configure.h version.h Makefile unit-tests/Makefile
@ -319,12 +319,22 @@ include contrib/Makefile
ifeq ("@TESTING@", "yes") ifeq ("@TESTING@", "yes")
include unit-tests/Makefile include unit-tests/Makefile
.PHONEY: features LIBFT_SOURCE=\
ft-lib/bcache.c \
ft-lib/crc32c.c \
ft-lib/dm-ioctl.c
features: pdata_tools LIBFT_OBJECTS=$(subst .c,.o,$(LIBFT_SOURCE))
cucumber --no-color --format progress
test: features unit-test lib/libft.so: $(LIBFT_OBJECTS)
gcc -shared -o $@ $+ -laio
.PHONEY: functional-test unit-test
functional-test: bin/pdata_tools lib/libft.so
cd functional-tests && ./run-tests run
test: functional-test unit-test
endif endif
-include $(DEPEND_FILES) -include $(DEPEND_FILES)

View File

@ -26,7 +26,7 @@
(srfi s8 receive) (srfi s8 receive)
(utils)) (utils))
(define __ (load-shared-object "./bcache/bcache.so")) (define __ (load-shared-object "../lib/libft.so"))
(define bcache-simple (define bcache-simple
(foreign-procedure "bcache_simple" (string unsigned) ptr)) (foreign-procedure "bcache_simple" (string unsigned) ptr))

View File

@ -5,7 +5,7 @@
(import (chezscheme)) (import (chezscheme))
(define __ (load-shared-object "./crc32c/crc32c.so")) (define __ (load-shared-object "../lib/libft.so"))
(define crc32c (define crc32c
(foreign-procedure "crc32c" (unsigned-32 (* unsigned-8) unsigned) unsigned-32))) (foreign-procedure "crc32c" (unsigned-32 (* unsigned-8) unsigned) unsigned-32)))

View File

@ -16,7 +16,7 @@
(srfi s8 receive) (srfi s8 receive)
(utils)) (utils))
(define __ (load-shared-object "./device-mapper/dm-ioctl.so")) (define __ (load-shared-object "../lib/libft.so"))
(define (fail msg) (define (fail msg)
(raise (raise