diff --git a/scripts/check_format.sh b/scripts/check_format.sh index 6151fbd43..6563b19a2 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -11,7 +11,7 @@ if hash astyle; then rm -f astyle.log touch astyle.log astyle --options=.astylerc "*.c" >> astyle.log - astyle --options=.astylerc "*.cpp" >> astyle.log + astyle --options=.astylerc --exclude=test/cpp_headers "*.cpp" >> astyle.log astyle --options=.astylerc "*.h" >> astyle.log if grep -q "^Formatted" astyle.log; then echo " errors detected" diff --git a/test/cpp_headers/.gitignore b/test/cpp_headers/.gitignore new file mode 100644 index 000000000..ce1da4c53 --- /dev/null +++ b/test/cpp_headers/.gitignore @@ -0,0 +1 @@ +*.cpp diff --git a/test/cpp_headers/Makefile b/test/cpp_headers/Makefile index d27d26927..76e77469e 100644 --- a/test/cpp_headers/Makefile +++ b/test/cpp_headers/Makefile @@ -34,11 +34,16 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -CXX_SRCS := cpp_headers.cpp +HEADERS := $(wildcard $(SPDK_ROOT_DIR)/include/spdk/*.h) +CXX_SRCS := $(patsubst %.h,%.cpp,$(notdir $(HEADERS))) -all : cpp_headers.o +%.cpp: $(SPDK_ROOT_DIR)/include/spdk/%.h + $(Q)echo " TEST_HEADER include/spdk/$(notdir $<)"; \ + echo '#include "spdk/$(notdir $<)"' > $@ + +all : $(CXX_SRCS) $(OBJS) clean : - $(CLEAN_C) + $(CLEAN_C) $(CXX_SRCS) include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk diff --git a/test/cpp_headers/cpp_headers.cpp b/test/cpp_headers/cpp_headers.cpp deleted file mode 100644 index 4893dd1b1..000000000 --- a/test/cpp_headers/cpp_headers.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// Make sure all of the SPDK public headers compile as C++ - -extern "C" { -#include "spdk/assert.h" -#include "spdk/barrier.h" -#include "spdk/bdev.h" -#include "spdk/bit_array.h" -#include "spdk/conf.h" -#include "spdk/copy_engine.h" -#include "spdk/endian.h" -#include "spdk/event.h" -#include "spdk/fd.h" -#include "spdk/gpt_spec.h" -#include "spdk/ioat.h" -#include "spdk/ioat_spec.h" -#include "spdk/iscsi_spec.h" -#include "spdk/json.h" -#include "spdk/jsonrpc.h" -#include "spdk/likely.h" -#include "spdk/log.h" -#include "spdk/mmio.h" -#include "spdk/net.h" -#include "spdk/nvme.h" -#include "spdk/nvme_intel.h" -#include "spdk/nvme_spec.h" -#include "spdk/nvmf_spec.h" -#include "spdk/pci.h" -#include "spdk/pci_ids.h" -#include "spdk/queue.h" -#include "spdk/rpc.h" -#include "spdk/scsi.h" -#include "spdk/scsi_spec.h" -#include "spdk/string.h" -#include "spdk/trace.h" -#include "spdk/vtophys.h" -}