diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ccc5446..311ebcd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,9 +2,43 @@ include: - template: Jobs/Code-Quality.gitlab-ci.yml stages: + - build - test + - trigger_build_peerplays + +build: + stage: build + script: + - rm -rf .git/modules/vendor ./vendor + - git submodule sync + - git submodule update --init --recursive + - rm -rf build + - mkdir build + - cd build + - cmake -DCMAKE_BUILD_TYPE=Release .. + - make -j$(nproc) + artifacts: + untracked: true + paths: + - build/tests/ + tags: + - builder-fc + +test: + stage: test + dependencies: + - build + script: + - ./build/tests/all_test + tags: + - builder-fc + when: + - manual trigger_build_peerplays: - stage: test + stage: trigger_build_peerplays + dependencies: + - test script: - "curl -X POST -F token=$CI_JOB_TOKEN -F ref=$REF_NAME https://gitlab.com/api/v4/projects/10735589/trigger/pipeline" + \ No newline at end of file diff --git a/include/fc/config.hpp b/include/fc/config.hpp index d08eaf1..8e64a1d 100644 --- a/include/fc/config.hpp +++ b/include/fc/config.hpp @@ -3,7 +3,12 @@ #define FC_PACK_MAX_DEPTH 1000 #endif +#ifndef FC_MAX_STRING_OBJECT_DEPTH + // how many levels of nested objects are proceed for string functions +#define FC_MAX_STRING_OBJECT_DEPTH 200 +#endif + #ifndef FC_MAX_LOG_OBJECT_DEPTH // how many levels of nested objects are displayed in log messages - #define FC_MAX_LOG_OBJECT_DEPTH 200 + #define FC_MAX_LOG_OBJECT_DEPTH 1000 #endif \ No newline at end of file diff --git a/include/fc/log/gelf_appender.hpp b/include/fc/log/gelf_appender.hpp index ba81c3d..1df2b2a 100755 --- a/include/fc/log/gelf_appender.hpp +++ b/include/fc/log/gelf_appender.hpp @@ -15,7 +15,7 @@ namespace fc { string endpoint = "127.0.0.1:12201"; string host = "fc"; // the name of the host, source or application that sent this message (just passed through to GELF server) - uint32_t max_object_depth; + uint32_t max_object_depth = FC_MAX_LOG_OBJECT_DEPTH; }; gelf_appender(const variant& args); diff --git a/include/fc/string.hpp b/include/fc/string.hpp index 13e10da..2fce7b0 100755 --- a/include/fc/string.hpp +++ b/include/fc/string.hpp @@ -2,6 +2,7 @@ #include #include #include +#include #ifndef USE_FC_STRING #include @@ -25,7 +26,7 @@ namespace fc typedef fc::optional ostring; class variant_object; - fc::string format_string( const fc::string&, const variant_object&, uint32_t max_object_depth = 200 ); + fc::string format_string( const fc::string&, const variant_object&, uint32_t max_object_depth = FC_MAX_STRING_OBJECT_DEPTH ); fc::string trim( const fc::string& ); fc::string to_lower( const fc::string& ); string trim_and_normalize_spaces( const string& s ); diff --git a/src/log/file_appender.cpp b/src/log/file_appender.cpp index f499ed4..1840c34 100755 --- a/src/log/file_appender.cpp +++ b/src/log/file_appender.cpp @@ -168,7 +168,8 @@ namespace fc { filename(p), flush(true), rotate(false), - rotation_compression(false) + rotation_compression(false), + max_object_depth(FC_MAX_LOG_OBJECT_DEPTH) {} file_appender::file_appender( const variant& args ) : diff --git a/tests/io/json_tests.cpp b/tests/io/json_tests.cpp index e06f51b..3bc16d8 100644 --- a/tests/io/json_tests.cpp +++ b/tests/io/json_tests.cpp @@ -335,7 +335,7 @@ BOOST_AUTO_TEST_CASE(recursion_test) BOOST_AUTO_TEST_CASE(rethrow_test) { fc::variants biggie; - for( int i = 0; i < 250; i++ ) + for( int i = 0; i < 1010; i++ ) { fc::variant tmp( std::move(biggie) ); biggie.reserve(1);