From d315a9255a6103ad82d2bc2b9cdb0482a6b4954b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Tue, 8 Nov 2022 16:17:14 +0300 Subject: [PATCH] =?UTF-8?q?mdbx-test:=20=D1=81=D0=BC=D0=B5=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=80=D0=B0=D1=81=D1=88=D0=B8=D1=80=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=83=20C++=20=D0=B8=D1=81=D1=85=D0=BE=D0=B4=D0=BD=D0=B8=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GNUmakefile | 10 ++--- test/CMakeLists.txt | 52 +++++++++++----------- test/{append.cc => append.c++} | 2 +- test/{base.h => base.h++} | 0 test/{cases.cc => cases.c++} | 2 +- test/{chrono.cc => chrono.c++} | 2 +- test/{chrono.h => chrono.h++} | 4 +- test/{config.cc => config.c++} | 2 +- test/{config.h => config.h++} | 6 +-- test/{copy.cc => copy.c++} | 2 +- test/{dead.cc => dead.c++} | 2 +- test/{hill.cc => hill.c++} | 2 +- test/{jitter.cc => jitter.c++} | 2 +- test/{keygen.cc => keygen.c++} | 2 +- test/{keygen.h => keygen.h++} | 8 ++-- test/{log.cc => log.c++} | 2 +- test/{log.h => log.h++} | 4 +- test/{main.cc => main.c++} | 2 +- test/{nested.cc => nested.c++} | 2 +- test/{osal-unix.cc => osal-unix.c++} | 2 +- test/{osal-windows.cc => osal-windows.c++} | 2 +- test/{osal.h => osal.h++} | 2 +- test/{test.cc => test.c++} | 2 +- test/{test.h => test.h++} | 14 +++--- test/{try.cc => try.c++} | 2 +- test/{ttl.cc => ttl.c++} | 2 +- test/{utils.cc => utils.c++} | 2 +- test/{utils.h => utils.h++} | 2 +- 28 files changed, 69 insertions(+), 69 deletions(-) rename test/{append.cc => append.c++} (99%) rename test/{base.h => base.h++} (100%) rename test/{cases.cc => cases.c++} (99%) rename test/{chrono.cc => chrono.c++} (99%) rename test/{chrono.h => chrono.h++} (98%) rename test/{config.cc => config.c++} (99%) rename test/{config.h => config.h++} (99%) rename test/{copy.cc => copy.c++} (98%) rename test/{dead.cc => dead.c++} (98%) rename test/{hill.cc => hill.c++} (99%) rename test/{jitter.cc => jitter.c++} (99%) rename test/{keygen.cc => keygen.c++} (99%) rename test/{keygen.h => keygen.h++} (98%) rename test/{log.cc => log.c++} (99%) rename test/{log.h => log.h++} (98%) rename test/{main.cc => main.c++} (99%) rename test/{nested.cc => nested.c++} (99%) rename test/{osal-unix.cc => osal-unix.c++} (99%) rename test/{osal-windows.cc => osal-windows.c++} (99%) rename test/{osal.h => osal.h++} (98%) rename test/{test.cc => test.c++} (99%) rename test/{test.h => test.h++} (98%) rename test/{try.cc => try.c++} (97%) rename test/{ttl.cc => ttl.c++} (99%) rename test/{utils.cc => utils.c++} (99%) rename test/{utils.h => utils.h++} (99%) diff --git a/GNUmakefile b/GNUmakefile index 92c23dbc..68972f99 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -353,9 +353,9 @@ TEST_DB ?= $(shell [ -d /dev/shm ] && echo /dev/shm || echo /tmp)/mdbx-test.d TEST_LOG ?= $(shell [ -d /dev/shm ] && echo /dev/shm || echo /tmp)/mdbx-test.log TEST_OSAL := $(shell $(uname2osal)) TEST_ITER := $(shell $(uname2titer)) -TEST_SRC := test/osal-$(TEST_OSAL).cc $(filter-out $(wildcard test/osal-*.cc), $(wildcard test/*.cc)) -TEST_INC := $(wildcard test/*.h) -TEST_OBJ := $(patsubst %.cc,%.o,$(TEST_SRC)) +TEST_SRC := test/osal-$(TEST_OSAL).c++ $(filter-out $(wildcard test/osal-*.c++), $(wildcard test/*.c++)) +TEST_INC := $(wildcard test/*.h++) +TEST_OBJ := $(patsubst %.c++,%.o,$(TEST_SRC)) TAR ?= $(shell which gnu-tar || echo tar) ZIP ?= $(shell which zip || echo "echo 'Please install zip'") CLANG_FORMAT ?= $(shell (which clang-format-14 || which clang-format-13 || which clang-format) 2>/dev/null) @@ -363,7 +363,7 @@ CLANG_FORMAT ?= $(shell (which clang-format-14 || which clang-format-13 || which reformat: @echo ' RUNNING clang-format...' $(QUIET)if [ -n "$(CLANG_FORMAT)" ]; then \ - git ls-files | grep -E '\.(c|cxx|cc|cpp|h|hxx|hpp)(\.in)?$$' | xargs -r $(CLANG_FORMAT) -i --style=file; \ + git ls-files | grep -E '\.(c|c++|h|h++)(\.in)?$$' | xargs -r $(CLANG_FORMAT) -i --style=file; \ else \ echo "clang-format version 13..14 not found for 'reformat'"; \ fi @@ -469,7 +469,7 @@ mdbx_example: mdbx.h example/example-mdbx.c libmdbx.$(SO_SUFFIX) build-test: all mdbx_example mdbx_test define test-rule -$(patsubst %.cc,%.o,$(1)): $(1) $(TEST_INC) $(HEADERS) $(lastword $(MAKEFILE_LIST)) +$(patsubst %.c++,%.o,$(1)): $(1) $(TEST_INC) $(HEADERS) $(lastword $(MAKEFILE_LIST)) @echo ' CC $$@' $(QUIET)$$(CXX) $$(CXXFLAGS) $$(MDBX_BUILD_OPTIONS) -c $(1) -o $$@ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f8fb1618..0a067d09 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,32 +2,32 @@ enable_language(CXX) include(../cmake/compiler.cmake) set(LIBMDBX_TEST_SOURCES - base.h - cases.cc - chrono.cc - chrono.h - config.cc - config.h - copy.cc - dead.cc - hill.cc - jitter.cc - keygen.cc - keygen.h - log.cc - log.h - main.cc - osal.h - osal-unix.cc - osal-windows.cc - test.cc - test.h - try.cc - utils.cc - utils.h - append.cc - ttl.cc - nested.cc + base.h++ + cases.c++ + chrono.c++ + chrono.h++ + config.c++ + config.h++ + copy.c++ + dead.c++ + hill.c++ + jitter.c++ + keygen.c++ + keygen.h++ + log.c++ + log.h++ + main.c++ + osal.h++ + osal-unix.c++ + osal-windows.c++ + test.c++ + test.h++ + try.c++ + utils.c++ + utils.h++ + append.c++ + ttl.c++ + nested.c++ ) if(NOT MDBX_BUILD_CXX) diff --git a/test/append.cc b/test/append.c++ similarity index 99% rename from test/append.cc rename to test/append.c++ index d75e0231..5ca2245f 100644 --- a/test/append.cc +++ b/test/append.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" class testcase_append : public testcase { public: diff --git a/test/base.h b/test/base.h++ similarity index 100% rename from test/base.h rename to test/base.h++ diff --git a/test/cases.cc b/test/cases.c++ similarity index 99% rename from test/cases.cc rename to test/cases.c++ index 75432e5c..51d84b86 100644 --- a/test/cases.cc +++ b/test/cases.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" registry *registry::instance() { static registry *singleton; diff --git a/test/chrono.cc b/test/chrono.c++ similarity index 99% rename from test/chrono.cc rename to test/chrono.c++ index ec22b39b..33456867 100644 --- a/test/chrono.cc +++ b/test/chrono.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" namespace chrono { diff --git a/test/chrono.h b/test/chrono.h++ similarity index 98% rename from test/chrono.h rename to test/chrono.h++ index 5ee08856..4f86cf65 100644 --- a/test/chrono.h +++ b/test/chrono.h++ @@ -14,8 +14,8 @@ #pragma once -#include "base.h" -#include "utils.h" +#include "base.h++" +#include "utils.h++" namespace chrono { diff --git a/test/config.cc b/test/config.c++ similarity index 99% rename from test/config.cc rename to test/config.c++ index 38063892..e86984d4 100644 --- a/test/config.cc +++ b/test/config.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" #if defined(_MSC_VER) && !defined(strcasecmp) #define strcasecmp(str, len) _stricmp(str, len) diff --git a/test/config.h b/test/config.h++ similarity index 99% rename from test/config.h rename to test/config.h++ index 8c93981e..1e6e57e5 100644 --- a/test/config.h +++ b/test/config.h++ @@ -14,9 +14,9 @@ #pragma once -#include "base.h" -#include "log.h" -#include "utils.h" +#include "base.h++" +#include "log.h++" +#include "utils.h++" #define ACTOR_ID_MAX INT16_MAX diff --git a/test/copy.cc b/test/copy.c++ similarity index 98% rename from test/copy.cc rename to test/copy.c++ index d164fc45..93ae77c8 100644 --- a/test/copy.cc +++ b/test/copy.c++ @@ -1,4 +1,4 @@ -#include "test.h" +#include "test.h++" class testcase_copy : public testcase { const std::string copy_pathname; diff --git a/test/dead.cc b/test/dead.c++ similarity index 98% rename from test/dead.cc rename to test/dead.c++ index 05304bc2..0d698d91 100644 --- a/test/dead.cc +++ b/test/dead.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" class testcase_deadread : public testcase { public: diff --git a/test/hill.cc b/test/hill.c++ similarity index 99% rename from test/hill.cc rename to test/hill.c++ index 5aea4d71..3a5c29f3 100644 --- a/test/hill.cc +++ b/test/hill.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" /* LY: тест "холмиком": * - сначала наполняем таблицу циклическими CRUD-манипуляциями, diff --git a/test/jitter.cc b/test/jitter.c++ similarity index 99% rename from test/jitter.cc rename to test/jitter.c++ index 2c781d7f..391d5deb 100644 --- a/test/jitter.cc +++ b/test/jitter.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" class testcase_jitter : public testcase { protected: diff --git a/test/keygen.cc b/test/keygen.c++ similarity index 99% rename from test/keygen.cc rename to test/keygen.c++ index 807954f3..2cd7e574 100644 --- a/test/keygen.cc +++ b/test/keygen.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" namespace keygen { diff --git a/test/keygen.h b/test/keygen.h++ similarity index 98% rename from test/keygen.h rename to test/keygen.h++ index 53219f5d..54122ab1 100644 --- a/test/keygen.h +++ b/test/keygen.h++ @@ -14,10 +14,10 @@ #pragma once -#include "base.h" -#include "config.h" -#include "log.h" -#include "utils.h" +#include "base.h++" +#include "config.h++" +#include "log.h++" +#include "utils.h++" namespace keygen { diff --git a/test/log.cc b/test/log.c++ similarity index 99% rename from test/log.cc rename to test/log.c++ index 9597328f..f9cb1194 100644 --- a/test/log.cc +++ b/test/log.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" static void fflushall() { fflush(nullptr); } diff --git a/test/log.h b/test/log.h++ similarity index 98% rename from test/log.h rename to test/log.h++ index bc9f4579..0ff12ec2 100644 --- a/test/log.h +++ b/test/log.h++ @@ -14,8 +14,8 @@ #pragma once -#include "base.h" -#include "chrono.h" +#include "base.h++" +#include "chrono.h++" MDBX_NORETURN void usage(void); MDBX_NORETURN void MDBX_PRINTF_ARGS(1, 2) failure(const char *fmt, ...); diff --git a/test/main.cc b/test/main.c++ similarity index 99% rename from test/main.cc rename to test/main.c++ index 67ea1bd0..0cd82dbd 100644 --- a/test/main.cc +++ b/test/main.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" #if !(defined(_WIN32) || defined(_WIN64)) #include diff --git a/test/nested.cc b/test/nested.c++ similarity index 99% rename from test/nested.cc rename to test/nested.c++ index 098eada0..60c02ae9 100644 --- a/test/nested.cc +++ b/test/nested.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" #include /* LY: тест "эмуляцией time-to-live" с вложенными транзакциями: diff --git a/test/osal-unix.cc b/test/osal-unix.c++ similarity index 99% rename from test/osal-unix.cc rename to test/osal-unix.c++ index 320ebad3..1711518e 100644 --- a/test/osal-unix.cc +++ b/test/osal-unix.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" #if !(defined(_WIN32) || defined(_WIN64)) diff --git a/test/osal-windows.cc b/test/osal-windows.c++ similarity index 99% rename from test/osal-windows.cc rename to test/osal-windows.c++ index 70b8cf5c..711a9b12 100644 --- a/test/osal-windows.cc +++ b/test/osal-windows.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" #if defined(_WIN32) || defined(_WIN64) diff --git a/test/osal.h b/test/osal.h++ similarity index 98% rename from test/osal.h rename to test/osal.h++ index a893ddb4..0fe44f68 100644 --- a/test/osal.h +++ b/test/osal.h++ @@ -14,7 +14,7 @@ #pragma once -#include "base.h" +#include "base.h++" void osal_setup(const std::vector &actors); void osal_broadcast(unsigned id); diff --git a/test/test.cc b/test/test.c++ similarity index 99% rename from test/test.cc rename to test/test.c++ index 60fd6914..1d06dd77 100644 --- a/test/test.cc +++ b/test/test.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" const char *testcase2str(const actor_testcase testcase) { switch (testcase) { diff --git a/test/test.h b/test/test.h++ similarity index 98% rename from test/test.h rename to test/test.h++ index 40bb01ac..4442aaa7 100644 --- a/test/test.h +++ b/test/test.h++ @@ -14,13 +14,13 @@ #pragma once -#include "base.h" -#include "chrono.h" -#include "config.h" -#include "keygen.h" -#include "log.h" -#include "osal.h" -#include "utils.h" +#include "base.h++" +#include "chrono.h++" +#include "config.h++" +#include "keygen.h++" +#include "log.h++" +#include "osal.h++" +#include "utils.h++" #include #include diff --git a/test/try.cc b/test/try.c++ similarity index 97% rename from test/try.cc rename to test/try.c++ index da81e631..50c959c9 100644 --- a/test/try.cc +++ b/test/try.c++ @@ -1,4 +1,4 @@ -#include "test.h" +#include "test.h++" class testcase_try : public testcase { public: diff --git a/test/ttl.cc b/test/ttl.c++ similarity index 99% rename from test/ttl.cc rename to test/ttl.c++ index de3c9f42..f8239e94 100644 --- a/test/ttl.cc +++ b/test/ttl.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" #include #include diff --git a/test/utils.cc b/test/utils.c++ similarity index 99% rename from test/utils.cc rename to test/utils.c++ index 33420cc0..9e61e4bf 100644 --- a/test/utils.cc +++ b/test/utils.c++ @@ -12,7 +12,7 @@ * . */ -#include "test.h" +#include "test.h++" #include #if defined(HAVE_IEEE754_H) || __has_include() #include diff --git a/test/utils.h b/test/utils.h++ similarity index 99% rename from test/utils.h rename to test/utils.h++ index dd52dc00..3fbf4513 100644 --- a/test/utils.h +++ b/test/utils.h++ @@ -13,7 +13,7 @@ */ #pragma once -#include "base.h" +#include "base.h++" #if !defined(__BYTE_ORDER__) || !defined(__ORDER_LITTLE_ENDIAN__) || \ !defined(__ORDER_BIG_ENDIAN__)