From 37d8e66a814f53c6a3cfcea3c14c72b2811126e0 Mon Sep 17 00:00:00 2001 From: "Maxim [maxirmx] Samsonov" Date: Sat, 24 Jun 2023 15:04:00 +0300 Subject: [PATCH 1/4] Renamed the project and project artifacts to sexpp --- .github/workflows/coverity.yml | 2 +- CMakeLists.txt | 85 +++++++++++------------- README.adoc | 20 +++--- cmake/{sexp.pc.in => sexpp.pc.in} | 4 +- cmake/version.cmake | 23 ++++--- include/{sexp => sexpp}/ext-key-format.h | 3 +- include/{sexp => sexpp}/sexp-error.h | 2 +- include/{sexp => sexpp}/sexp.h | 8 +-- man/{sexp.1 => sexpp.1} | 10 +-- src/ext-key-format.cpp | 2 +- src/sexp-char-defs.cpp | 2 +- src/sexp-depth-manager.cpp | 3 +- src/sexp-error.cpp | 2 +- src/sexp-input.cpp | 2 +- src/sexp-main.cpp | 2 +- src/sexp-object.cpp | 2 +- src/sexp-output.cpp | 2 +- src/sexp-simple-string.cpp | 2 +- tests/include/sexp-tests.h | 5 +- tests/scripts/tests.sh | 48 ++++++------- tests/src/baseline-tests.cpp | 2 +- tests/src/compare-files.cpp | 2 +- tests/src/exception-tests.cpp | 2 +- tests/src/g10-compat-tests.cpp | 2 +- tests/src/g23-compat-tests.cpp | 4 +- tests/src/g23-exception-tests.cpp | 4 +- tests/src/primitives-tests.cpp | 2 +- version.txt | 2 +- 28 files changed, 123 insertions(+), 126 deletions(-) rename cmake/{sexp.pc.in => sexpp.pc.in} (68%) rename include/{sexp => sexpp}/ext-key-format.h (99%) rename include/{sexp => sexpp}/sexp-error.h (99%) rename include/{sexp => sexpp}/sexp.h (96%) rename man/{sexp.1 => sexpp.1} (78%) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 1ef2d1f..2046b1e 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -37,7 +37,7 @@ jobs: env: CC: gcc CXX: g++ - COVERITY_TOKEN: AK2euT-neBcvZB1g_m3pbg + COVERITY_TOKEN: qjcM1CWLcq9PJB3yL0ZXIw MAKEFLAGS: j4 steps: - name: Checkout diff --git a/CMakeLists.txt b/CMakeLists.txt index 0910cc0..d88547e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,11 +23,10 @@ cmake_minimum_required(VERSION 3.14) include(cmake/version.cmake) -determine_version("${CMAKE_CURRENT_SOURCE_DIR}" SEXP) - +determine_version("${CMAKE_CURRENT_SOURCE_DIR}" SEXPP) # project name, etc -project(sexp - VERSION "${SEXP_VERSION}" +project(sexpp + VERSION "${SEXPP_VERSION}" LANGUAGES C CXX DESCRIPTION "S-expressions parser and generator C++ library, fully compliant to [https://people.csail.mit.edu/rivest/Sexp.txt]" ) @@ -111,7 +110,7 @@ if(NOT MSVC) endif(NOT MSVC) -add_library(sexp ${TYPE} +add_library(sexpp ${TYPE} "src/sexp-input.cpp" "src/sexp-output.cpp" "src/sexp-object.cpp" @@ -120,43 +119,39 @@ add_library(sexp ${TYPE} "src/sexp-error.cpp" "src/sexp-depth-manager.cpp" "src/ext-key-format.cpp" - "include/sexp/sexp.h" - "include/sexp/sexp-error.h" - "include/sexp/ext-key-format.h" + "include/sexpp/sexp.h" + "include/sexpp/sexp-error.h" + "include/sexpp/ext-key-format.h" ) -target_compile_features(sexp PUBLIC cxx_std_11) -target_include_directories(sexp PUBLIC +target_compile_features(sexpp PUBLIC cxx_std_11) +target_include_directories(sexpp PUBLIC $ $ ) -string(REGEX MATCH "^([0-9]+)\\.[0-9]+\\.[0-9]+$" vmatches "${SEXP_VERSION}") -if (NOT vmatches) - message(FATAL_ERROR "Failed to extract major version from SEXP_VERSION (${SEXP_VERSION}).") -endif() -set(SEXP_MAJOR_VERSION "${CMAKE_MATCH_1}") - -set_target_properties(sexp PROPERTIES +set_target_properties(sexpp PROPERTIES POSITION_INDEPENDENT_CODE ON RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" - VERSION "${SEXP_VERSION}" - SOVERSION "${SEXP_MAJOR_VERSION}" - OUTPUT_NAME "sexp" + VERSION "${SEXPP_VERSION}" + SOVERSION "${SEXPP_MAJOR_VERSION}" + OUTPUT_NAME "sexpp" ) -if(WITH_SEXP_CLI) - add_executable (sexp-cli +if (WITH_SEXP_CLI) + add_executable (sexpp-cli src/sexp-main.cpp - include/sexp/sexp.h - include/sexp/sexp-error.h + include/sexpp/sexp.h + include/sexpp/sexp-error.h ) - target_include_directories (sexp-cli PUBLIC include) - target_link_libraries(sexp-cli PRIVATE sexp) - target_compile_features(sexp-cli PUBLIC cxx_std_11) - set_target_properties(sexp-cli PROPERTIES RUNTIME_OUTPUT_NAME sexp) - set_target_properties(sexp-cli PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) -endif(WITH_SEXP_CLI) + target_include_directories (sexpp-cli PUBLIC include) + target_link_libraries(sexpp-cli PRIVATE sexpp) + target_compile_features(sexpp-cli PUBLIC cxx_std_11) + set_target_properties(sexpp-cli PROPERTIES + RUNTIME_OUTPUT_NAME sexpp + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + ) +endif (WITH_SEXP_CLI) if(WITH_SEXP_TESTS) @@ -194,7 +189,7 @@ if(WITH_SEXP_TESTS) @ONLY ) - add_executable(sexp-tests + add_executable(sexpp-tests "tests/src/baseline-tests.cpp" "tests/src/exception-tests.cpp" "tests/src/primitives-tests.cpp" @@ -229,45 +224,45 @@ if(WITH_SEXP_TESTS) set(GTest GTest::GTest) if(NOT MSVC) - target_link_libraries(sexp-tests PRIVATE pthread) + target_link_libraries(sexpp-tests PRIVATE pthread) endif(NOT MSVC) endif(DOWNLOAD_GTEST) - target_link_libraries(sexp-tests PRIVATE - sexp + target_link_libraries(sexpp-tests PRIVATE + sexpp ${GTestMain} ${GTest} ) - target_include_directories(sexp-tests PRIVATE + target_include_directories(sexpp-tests PRIVATE tests/include include "${GTEST_INCLUDE_DIRS}" ) - target_compile_features(sexp-tests PUBLIC cxx_std_11) - set_target_properties(sexp-tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + target_compile_features(sexpp-tests PUBLIC cxx_std_11) + set_target_properties(sexpp-tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - gtest_discover_tests(sexp-tests) + gtest_discover_tests(sexpp-tests) endif(WITH_SEXP_TESTS) -set(CONFIGURED_PC "${CMAKE_CURRENT_BINARY_DIR}/sexp.pc") +set(CONFIGURED_PC "${CMAKE_CURRENT_BINARY_DIR}/sexpp.pc") configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/sexp.pc.in" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/sexpp.pc.in" "${CONFIGURED_PC}" @ONLY ) if (WIN32 AND BUILD_SHARED_LIBS) - install(TARGETS sexp RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - install(TARGETS sexp ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + install(TARGETS sexpp RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + install(TARGETS sexpp ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") else(WIN32 AND BUILD_SHARED_LIBS) - install(TARGETS sexp DESTINATION "${CMAKE_INSTALL_LIBDIR}") + install(TARGETS sexpp DESTINATION "${CMAKE_INSTALL_LIBDIR}") endif(WIN32 AND BUILD_SHARED_LIBS) install(DIRECTORY include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") install(FILES "${CONFIGURED_PC}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") if(WITH_SEXP_CLI) - install(TARGETS sexp-cli DESTINATION "${CMAKE_INSTALL_BINDIR}") - install(FILES man/sexp.1 DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") + install(TARGETS sexpp-cli DESTINATION "${CMAKE_INSTALL_BINDIR}") + install(FILES man/sexpp.1 DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") endif(WITH_SEXP_CLI) diff --git a/README.adoc b/README.adoc index 80b9253..1570325 100644 --- a/README.adoc +++ b/README.adoc @@ -6,9 +6,9 @@ image:https://github.com/rnpgp/sexp/workflows/build-and-test-deb/badge.svg["Buil image:https://github.com/rnpgp/sexp/workflows/build-and-test-msys/badge.svg["Build status MSys", link="https://github.com/rnpgp/sexp/actions?workflow=build-and-test-msys"] -image:https://codecov.io/gh/rnpgp/sexp/branch/feat/g23/graph/badge.svg["Code coverage", link="https://codecov.io/gh/rnpgp/sexp"] +image:https://codecov.io/gh/rnpgp/sexp/branch/feat/g23/graph/badge.svg["Code coverage", link="https://codecov.io/gh/rnpgp/sexpp"] image:https://github.com/rnpgp/sexp/workflows/CodeQL/badge.svg["CodeQL analysis", link="https://github.com/rnpgp/sexp/actions?workflow=CodeQL"] -image:https://scan.coverity.com/projects/27150/badge.svg["Coverity Scan Build Status", link="https://scan.coverity.com/projects/rnpgp-sexp"] +image:https://scan.coverity.com/projects/28717/badge.svg["Coverity Scan Build Status", link="https://scan.coverity.com/projects/rnpgp-sexpp"] == Purpose @@ -120,14 +120,14 @@ build with address and other sanitizers (requires clang compiler) -== SEXP command-line utility +== SEXPP command-line utility -The `sexp` command-line utility is reference parser and generator of +The `sexpp` command-line utility is reference parser and generator of S-Expressions. It can read, parse and print out SEXP in all defined formats. === Switches -.`sexp` switches +.`sexpp` switches [options="header"] |=== | Switch | Description | Default @@ -160,7 +160,7 @@ Prompt for S-Expressions input from console, parse and output it to [source] ---- -$ sexp -o certificate.dat -p -b +$ sexpp -o certificate.dat -p -b > Input: > (aa bb (cc dd)) @@ -173,7 +173,7 @@ advanced transport format with no prompts: [source,sh] ---- -$ sexp -i certificate.dat -x +$ sexpp -i certificate.dat -x > (2:aa2:bb(2:cc2:dd)) ---- @@ -183,7 +183,7 @@ base64 and advanced format with prompts and no width limitation: [source,sh] ---- -$ sexp -i certificate.dat -a -b -c -p -w 0 +$ sexpp -i certificate.dat -a -b -c -p -w 0 > Reading input from certificate.dat > @@ -200,14 +200,14 @@ console in advanced, base64 and canonical formats: [source,sh] ---- -$ sexp -p -a -b -c -x +$ sexpp -p -a -b -c -x ---- or just [source,sh] ---- -$ sexp +$ sexpp > Input: > (abc def (ghi jkl)) diff --git a/cmake/sexp.pc.in b/cmake/sexpp.pc.in similarity index 68% rename from cmake/sexp.pc.in rename to cmake/sexpp.pc.in index df9531f..1ab63e1 100644 --- a/cmake/sexp.pc.in +++ b/cmake/sexpp.pc.in @@ -2,8 +2,8 @@ libdir=@CMAKE_INSTALL_FULL_LIBDIR@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: sexp -Description: S-expressions library +Description: C++ library for working with S-Expressions Version: @PROJECT_VERSION@ URL: https://github.com/rnpgp/sexp -Libs: -L${libdir} -lsexp +Libs: -L${libdir} -lsexpp Cflags: -I${includedir} diff --git a/cmake/version.cmake b/cmake/version.cmake index 5f029a3..41287e4 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -38,29 +38,30 @@ function(extract_version_info version var_prefix) # extract the main components # v1.9.0-3-g5b92266+1546836556 # v1.9.0-3-g5b92266-dirty+1546836556 - string(REGEX MATCH "^v?([0-9]+\\.[0-9]+\\.[0-9]+)(-([0-9]+)-g([0-9a-f]+)(-dirty)?)?(\\+([0-9]+))?$" matches "${version}") + string(REGEX MATCH "^v?(([0-9]+)\\.[0-9]+\\.[0-9]+)(-([0-9]+)-g([0-9a-f]+)(-dirty)?)?(\\+([0-9]+))?$" matches "${version}") if (NOT matches) message(FATAL_ERROR "Failed to extract version components from ${version}.") endif() set(${var_prefix}_VERSION "${CMAKE_MATCH_1}" PARENT_SCOPE) # 1.9.0 - if (NOT CMAKE_MATCH_3) - set(CMAKE_MATCH_3 "0") - endif() - set(${var_prefix}_VERSION_NCOMMITS "${CMAKE_MATCH_3}" PARENT_SCOPE) # 3 + set(${var_prefix}_MAJOR_VERSION "${CMAKE_MATCH_2}" PARENT_SCOPE) # 1 if (NOT CMAKE_MATCH_4) set(CMAKE_MATCH_4 "0") endif() - set(${var_prefix}_VERSION_GIT_REV "${CMAKE_MATCH_4}" PARENT_SCOPE) # 5b92266 - if (CMAKE_MATCH_5 STREQUAL "-dirty") + set(${var_prefix}_VERSION_NCOMMITS "${CMAKE_MATCH_4}" PARENT_SCOPE) # 3 + if (NOT CMAKE_MATCH_5) + set(CMAKE_MATCH_5 "0") + endif() + set(${var_prefix}_VERSION_GIT_REV "${CMAKE_MATCH_5}" PARENT_SCOPE) # 5b92266 + if (CMAKE_MATCH_6 STREQUAL "-dirty") set(${var_prefix}_VERSION_IS_DIRTY TRUE PARENT_SCOPE) else() set(${var_prefix}_VERSION_IS_DIRTY FALSE PARENT_SCOPE) endif() # timestamp is optional, default to 0 - if (NOT CMAKE_MATCH_7) - set(CMAKE_MATCH_7 "0") + if (NOT CMAKE_MATCH_8) + set(CMAKE_MATCH_8 "0") endif() - set(${var_prefix}_VERSION_COMMIT_TIMESTAMP "${CMAKE_MATCH_7}" PARENT_SCOPE) # 1546836556 + set(${var_prefix}_VERSION_COMMIT_TIMESTAMP "${CMAKE_MATCH_8}" PARENT_SCOPE) # 1546836556 endfunction() function(determine_version source_dir var_prefix) @@ -153,7 +154,9 @@ function(determine_version source_dir var_prefix) # set the results set(${var_prefix}_VERSION_SUFFIX "${version_suffix}" PARENT_SCOPE) set(${var_prefix}_VERSION_FULL "${version_full}" PARENT_SCOPE) + set(${var_prefix}_MAJOR_VERSION "${${local_prefix}_MAJOR_VERSION}" PARENT_SCOPE) # 1 # for informational purposes + message(STATUS "${var_prefix}_MAJOR_VERSION: ${${local_prefix}_MAJOR_VERSION}") message(STATUS "${var_prefix}_VERSION_SUFFIX: ${version_suffix}") message(STATUS "${var_prefix}_VERSION_FULL: ${version_full}") endfunction() diff --git a/include/sexp/ext-key-format.h b/include/sexpp/ext-key-format.h similarity index 99% rename from include/sexp/ext-key-format.h rename to include/sexpp/ext-key-format.h index f9e8a30..41a65f0 100644 --- a/include/sexp/ext-key-format.h +++ b/include/sexpp/ext-key-format.h @@ -24,11 +24,12 @@ #pragma once #include + #include "sexp.h" namespace ext_key_format { -void ext_key_error( +void ext_key_error( sexp::sexp_exception_t::severity level, const char *msg, size_t c1, size_t c2, int pos); class ext_key_input_stream_t; diff --git a/include/sexp/sexp-error.h b/include/sexpp/sexp-error.h similarity index 99% rename from include/sexp/sexp-error.h rename to include/sexpp/sexp-error.h index 7364a42..f38bc1c 100644 --- a/include/sexp/sexp-error.h +++ b/include/sexpp/sexp-error.h @@ -65,7 +65,7 @@ class sexp_exception_t : public std::exception { static void set_interactive(bool new_interactive) { interactive = new_interactive; }; }; -void sexp_error( +void sexp_error( sexp_exception_t::severity level, const char *msg, size_t c1, size_t c2, int pos); } // namespace sexp diff --git a/include/sexp/sexp.h b/include/sexpp/sexp.h similarity index 96% rename from include/sexp/sexp.h rename to include/sexpp/sexp.h index d97a45e..1c11214 100644 --- a/include/sexp/sexp.h +++ b/include/sexpp/sexp.h @@ -51,7 +51,7 @@ namespace sexp { * However, we do enforce 'C' locale this way */ -class sexp_char_defs_t { +class sexp_char_defs_t { protected: static const bool base64digit[256]; /* true if c is base64 digit */ static const bool tokenchar[256]; /* true if c can be in a token */ @@ -100,7 +100,7 @@ class sexp_input_stream_t; typedef uint8_t octet_t; -class sexp_simple_string_t : public std::basic_string, private sexp_char_defs_t { +class sexp_simple_string_t : public std::basic_string, private sexp_char_defs_t { public: sexp_simple_string_t(void) = default; sexp_simple_string_t(const octet_t *dt) : std::basic_string{dt} {} @@ -161,7 +161,7 @@ inline bool operator!=(const sexp_simple_string_t *left, const std::string &righ * SEXP object */ -class sexp_object_t { +class sexp_object_t { public: virtual ~sexp_object_t(){}; @@ -201,7 +201,7 @@ class sexp_object_t { * SEXP string */ -class sexp_string_t : public sexp_object_t { +class sexp_string_t : public sexp_object_t { protected: bool with_presentation_hint; sexp_simple_string_t presentation_hint; diff --git a/man/sexp.1 b/man/sexpp.1 similarity index 78% rename from man/sexp.1 rename to man/sexpp.1 index 9e1aa55..5a6965c 100644 --- a/man/sexp.1 +++ b/man/sexpp.1 @@ -1,16 +1,16 @@ -.TH SEXP "1" "June 2023" "sexp" "User Commands" +.TH SEXPP "1" "June 2023" "sexpp" "User Commands" .SH NAME -sexp - Read, parse, and print out S-expressions +sexpp - Read, parse, and print out S-expressions .SH SYNOPSIS -.B cat certificate-file | sexp -a -x +.B cat certificate-file | sexpp -a -x .SH DESCRIPTION -\fBsexp\fP typically reads an S-expression from standard input and rewrites it to standard output. +\fBsexpp\fP typically reads an S-expression from standard input and rewrites it to standard output. Running without switches implies: -p -a -b -c -x @@ -58,7 +58,7 @@ Changes line width to specified width (0 implies no line-width constraint). Defa .SH AUTHOR -The \fBsexp\fP project is maintained by Maxim Samsonov on behalf of Ribose, Inc. +The \fBsexpp\fP project is maintained by Maxim Samsonov on behalf of Ribose, Inc. It is based on code from Ron Rivest and Butler Lampson. This manual page was written by Daniel Kahn Gillmor for the Debian project, but may be used by others. diff --git a/src/ext-key-format.cpp b/src/ext-key-format.cpp index 9d43668..572f058 100644 --- a/src/ext-key-format.cpp +++ b/src/ext-key-format.cpp @@ -21,7 +21,7 @@ * */ -#include +#include using namespace sexp; diff --git a/src/sexp-char-defs.cpp b/src/sexp-char-defs.cpp index d2712a1..0dd7011 100644 --- a/src/sexp-char-defs.cpp +++ b/src/sexp-char-defs.cpp @@ -26,7 +26,7 @@ * 7/21/1997 */ -#include +#include namespace sexp { diff --git a/src/sexp-depth-manager.cpp b/src/sexp-depth-manager.cpp index 9192de4..6694cb6 100644 --- a/src/sexp-depth-manager.cpp +++ b/src/sexp-depth-manager.cpp @@ -21,8 +21,7 @@ * **/ -#include -#include +#include namespace sexp { diff --git a/src/sexp-error.cpp b/src/sexp-error.cpp index 40fa1aa..ad1458d 100644 --- a/src/sexp-error.cpp +++ b/src/sexp-error.cpp @@ -21,7 +21,7 @@ * */ -#include +#include namespace sexp { diff --git a/src/sexp-input.cpp b/src/sexp-input.cpp index 625a42a..2508331 100644 --- a/src/sexp-input.cpp +++ b/src/sexp-input.cpp @@ -26,7 +26,7 @@ * 7/21/1997 */ -#include +#include namespace sexp { diff --git a/src/sexp-main.cpp b/src/sexp-main.cpp index c10db6e..937fa4c 100644 --- a/src/sexp-main.cpp +++ b/src/sexp-main.cpp @@ -28,7 +28,7 @@ #include -#include +#include using namespace sexp; diff --git a/src/sexp-object.cpp b/src/sexp-object.cpp index d18a387..0099d19 100644 --- a/src/sexp-object.cpp +++ b/src/sexp-object.cpp @@ -26,7 +26,7 @@ * 5/5/1997 */ -#include +#include namespace sexp { diff --git a/src/sexp-output.cpp b/src/sexp-output.cpp index e3a0502..f1acd13 100644 --- a/src/sexp-output.cpp +++ b/src/sexp-output.cpp @@ -26,7 +26,7 @@ * 5/5/1997 */ -#include +#include namespace sexp { diff --git a/src/sexp-simple-string.cpp b/src/sexp-simple-string.cpp index f2854e1..ad585f0 100644 --- a/src/sexp-simple-string.cpp +++ b/src/sexp-simple-string.cpp @@ -26,7 +26,7 @@ * 5/5/1997 */ -#include +#include namespace sexp { /* diff --git a/tests/include/sexp-tests.h b/tests/include/sexp-tests.h index 9a78086..497fc91 100644 --- a/tests/include/sexp-tests.h +++ b/tests/include/sexp-tests.h @@ -30,9 +30,8 @@ #include -#include - -#include +#include "sexpp/sexp.h" +#include "sexp-samples-folder.h" bool compare_binary_files(const std::string &filename1, const std::string &filename2); bool compare_text_files(const std::string &filename1, const std::string &filename2); diff --git a/tests/scripts/tests.sh b/tests/scripts/tests.sh index 376d5ec..4c37c78 100755 --- a/tests/scripts/tests.sh +++ b/tests/scripts/tests.sh @@ -47,48 +47,48 @@ test_install_script() { version_major="${version:0:1}" case "$OSTYPE" in darwin*) - assert_installed "$DIR_INS_B/sexp" - assert_installed "$DIR_INS_L/libsexp.dylib" - assert_installed "$DIR_INS_L/libsexp.$version_major.dylib" - assert_installed "$DIR_INS_L/libsexp.$version.dylib" + assert_installed "$DIR_INS_B/sexpp" + assert_installed "$DIR_INS_L/libsexpp.dylib" + assert_installed "$DIR_INS_L/libsexpp.$version_major.dylib" + assert_installed "$DIR_INS_L/libsexpp.$version.dylib" ;; windows ) - assert_installed "$DIR_INS_B/sexp.exe" - assert_installed "$DIR_INS_B/sexp.dll" - assert_installed "$DIR_INS_L/sexp.lib" + assert_installed "$DIR_INS_B/sexpp.exe" + assert_installed "$DIR_INS_B/sexpp.dll" + assert_installed "$DIR_INS_L/sexpp.lib" ;; msys) - assert_installed "$DIR_INS_B/sexp.exe" - assert_installed "$DIR_INS_B/libsexp.dll" - assert_installed "$DIR_INS_L/libsexp.dll.a" + assert_installed "$DIR_INS_B/sexpp.exe" + assert_installed "$DIR_INS_B/libsexpp.dll" + assert_installed "$DIR_INS_L/libsexpp.dll.a" ;; *) - assert_installed "$DIR_INS_B/sexp" - assert_installed_var "$DIR_INS_L" "$DIR_INS_L64" "libsexp.so" - assert_installed_var "$DIR_INS_L" "$DIR_INS_L64" "libsexp.so.$version_major" - assert_installed_var "$DIR_INS_L" "$DIR_INS_L64" "libsexp.so.$version" + assert_installed "$DIR_INS_B/sexpp" + assert_installed_var "$DIR_INS_L" "$DIR_INS_L64" "libsexpp.so" + assert_installed_var "$DIR_INS_L" "$DIR_INS_L64" "libsexpp.so.$version_major" + assert_installed_var "$DIR_INS_L" "$DIR_INS_L64" "libsexpp.so.$version" ;; esac else case "$OSTYPE" in windows) - assert_installed "$DIR_INS_B/sexp.exe" - assert_installed "$DIR_INS_L/sexp.lib" + assert_installed "$DIR_INS_B/sexpp.exe" + assert_installed "$DIR_INS_L/sexpp.lib" ;; msys) - assert_installed "$DIR_INS_B/sexp.exe" - assert_installed "$DIR_INS_L/libsexp.a" + assert_installed "$DIR_INS_B/sexpp.exe" + assert_installed "$DIR_INS_L/libsexpp.a" ;; *) - assert_installed "$DIR_INS_B/sexp" - assert_installed_var "$DIR_INS_L" "$DIR_INS_L64" "libsexp.a" + assert_installed "$DIR_INS_B/sexpp" + assert_installed_var "$DIR_INS_L" "$DIR_INS_L64" "libsexpp.a" ;; esac fi - assert_installed_var "$DIR_INS_P" "$DIR_INS_P64" "sexp.pc" - assert_installed_var_2 "$DIR_INS_M/man1" "sexp.1" "sexp.1.gz" + assert_installed_var "$DIR_INS_P" "$DIR_INS_P64" "sexpp.pc" + assert_installed_var2 "$DIR_INS_M/man1" "sexpp.1" "sexpp.1.gz" assert_installed "$DIR_INS_I/sexp.h" assert_installed "$DIR_INS_I/sexp-error.h" @@ -106,7 +106,7 @@ test_sexp_cli() { startSkipping fi - app="$DIR_INS_B/sexp" + app="$DIR_INS_B/sexpp" # shellcheck disable=SC2251 ! IFS= read -r -d '' expected << EOM Input: @@ -182,7 +182,7 @@ DIR_INS_L64="$DIR_INSTALL/lib64" DIR_INS_M="$DIR_INSTALL/share/man" DIR_INS_P="$DIR_INS_L/pkgconfig" DIR_INS_P64="$DIR_INS_L64/pkgconfig" -DIR_INS_I="$DIR_INSTALL/include/sexp" +DIR_INS_I="$DIR_INSTALL/include/sexpp" DIR_TESTS=$( cd "$DIR0/.." && pwd) diff --git a/tests/src/baseline-tests.cpp b/tests/src/baseline-tests.cpp index 8a1b0c8..bbd59a4 100644 --- a/tests/src/baseline-tests.cpp +++ b/tests/src/baseline-tests.cpp @@ -21,7 +21,7 @@ * */ -#include +#include "sexp-tests.h" using namespace sexp; using ::testing::UnitTest; diff --git a/tests/src/compare-files.cpp b/tests/src/compare-files.cpp index 1db7f6f..49caec5 100644 --- a/tests/src/compare-files.cpp +++ b/tests/src/compare-files.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include "sexp-tests.h" bool compare_binary_files(const std::string &filename1, const std::string &filename2) { diff --git a/tests/src/exception-tests.cpp b/tests/src/exception-tests.cpp index e3e4d82..318b2b8 100644 --- a/tests/src/exception-tests.cpp +++ b/tests/src/exception-tests.cpp @@ -21,7 +21,7 @@ * */ -#include +#include "sexp-tests.h" using namespace sexp; diff --git a/tests/src/g10-compat-tests.cpp b/tests/src/g10-compat-tests.cpp index fcbbe83..62f1180 100644 --- a/tests/src/g10-compat-tests.cpp +++ b/tests/src/g10-compat-tests.cpp @@ -21,7 +21,7 @@ * */ -#include +#include "sexp-tests.h" using namespace sexp; diff --git a/tests/src/g23-compat-tests.cpp b/tests/src/g23-compat-tests.cpp index 63a5a2f..3a2e756 100644 --- a/tests/src/g23-compat-tests.cpp +++ b/tests/src/g23-compat-tests.cpp @@ -21,8 +21,8 @@ * */ -#include -#include +#include "sexp-tests.h" +#include "sexpp/ext-key-format.h" using namespace sexp; using namespace ext_key_format; diff --git a/tests/src/g23-exception-tests.cpp b/tests/src/g23-exception-tests.cpp index d83ea7e..4f4413d 100644 --- a/tests/src/g23-exception-tests.cpp +++ b/tests/src/g23-exception-tests.cpp @@ -21,8 +21,8 @@ * */ -#include -#include +#include "sexp-tests.h" +#include "sexpp/ext-key-format.h" using namespace sexp; using namespace ext_key_format; diff --git a/tests/src/primitives-tests.cpp b/tests/src/primitives-tests.cpp index d4a3474..0689d27 100644 --- a/tests/src/primitives-tests.cpp +++ b/tests/src/primitives-tests.cpp @@ -21,7 +21,7 @@ * */ -#include +#include "sexp-tests.h" using namespace sexp; diff --git a/version.txt b/version.txt index 7ada0d3..1e9b46b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.8.5 +0.8.7 From 9de4bbab676c12228bca054700c590625359a2e7 Mon Sep 17 00:00:00 2001 From: "Maxim [maxirmx] Samsonov" Date: Sat, 24 Jun 2023 23:28:32 +0300 Subject: [PATCH 2/4] Created new coverity/codecov/lint environment for sexpp project, fixed coverity CID 453360 --- .github/workflows/coverity.yml | 6 +----- .github/workflows/lint.yml | 16 ++++++++-------- README.adoc | 4 ++-- include/sexpp/ext-key-format.h | 2 +- include/sexpp/sexp-error.h | 4 ++-- include/sexpp/sexp.h | 8 ++++---- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 2046b1e..ad9c668 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -37,8 +37,8 @@ jobs: env: CC: gcc CXX: g++ - COVERITY_TOKEN: qjcM1CWLcq9PJB3yL0ZXIw MAKEFLAGS: j4 + TOKEN: qjcM1CWLcq9PJB3yL0ZXIw steps: - name: Checkout uses: actions/checkout@v3 @@ -56,8 +56,6 @@ jobs: run: cmake -Bbuild -DDOWNLOAD_GTEST=OFF - name: Download Coverity - env: - TOKEN: AK2euT-neBcvZB1g_m3pbg run: | wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=$GITHUB_REPOSITORY" -O cov-analysis-linux64.tar.gz mkdir cov-analysis-linux64 @@ -70,8 +68,6 @@ jobs: cov-build --dir cov-int cmake --build build - name: Submit - env: - TOKEN: AK2euT-neBcvZB1g_m3pbg run: | tar czvf results.tgz cov-int curl \ diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5e4ba83..0a80e40 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -41,14 +41,14 @@ jobs: source: '.' extensions: 'h,cpp,c' clangFormatVersion: 11 - inplace: True - - uses: EndBug/add-and-commit@v9 - with: - author_name: A robot on behalf of Maxim Samsonov - author_email: m.samsonov@computer.org - message: 'Committing clang-format changes' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# inplace: True +# - uses: EndBug/add-and-commit@v9 +# with: +# author_name: A robot on behalf of Maxim Samsonov +# author_email: m.samsonov@computer.org +# message: 'Committing clang-format changes' +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shellcheck: runs-on: ubuntu-latest steps: diff --git a/README.adoc b/README.adoc index 1570325..765685c 100644 --- a/README.adoc +++ b/README.adoc @@ -6,8 +6,8 @@ image:https://github.com/rnpgp/sexp/workflows/build-and-test-deb/badge.svg["Buil image:https://github.com/rnpgp/sexp/workflows/build-and-test-msys/badge.svg["Build status MSys", link="https://github.com/rnpgp/sexp/actions?workflow=build-and-test-msys"] -image:https://codecov.io/gh/rnpgp/sexp/branch/feat/g23/graph/badge.svg["Code coverage", link="https://codecov.io/gh/rnpgp/sexpp"] -image:https://github.com/rnpgp/sexp/workflows/CodeQL/badge.svg["CodeQL analysis", link="https://github.com/rnpgp/sexp/actions?workflow=CodeQL"] +image:https://codecov.io/gh/rnpgp/sexpp/branch/main/graph/badge.svg["Code coverage", link="https://codecov.io/gh/rnpgp/sexpp"] +image:https://github.com/rnpgp/sexpp/workflows/CodeQL/badge.svg["CodeQL analysis", link="https://github.com/rnpgp/sexpp/actions?workflow=CodeQL"] image:https://scan.coverity.com/projects/28717/badge.svg["Coverity Scan Build Status", link="https://scan.coverity.com/projects/rnpgp-sexpp"] diff --git a/include/sexpp/ext-key-format.h b/include/sexpp/ext-key-format.h index 41a65f0..1fcaf49 100644 --- a/include/sexpp/ext-key-format.h +++ b/include/sexpp/ext-key-format.h @@ -29,7 +29,7 @@ namespace ext_key_format { -void ext_key_error( +void ext_key_error( sexp::sexp_exception_t::severity level, const char *msg, size_t c1, size_t c2, int pos); class ext_key_input_stream_t; diff --git a/include/sexpp/sexp-error.h b/include/sexpp/sexp-error.h index f38bc1c..58bd780 100644 --- a/include/sexpp/sexp-error.h +++ b/include/sexpp/sexp-error.h @@ -48,7 +48,7 @@ class sexp_exception_t : public std::exception { int error_position, const char *prefix = "SEXP") : position{error_position}, level{error_level}, - message{format(prefix, error_message, error_level, error_position)} {}; + message{format(prefix, std::move(error_message), error_level, error_position)} {}; static std::string format(std::string prf, std::string message, @@ -65,7 +65,7 @@ class sexp_exception_t : public std::exception { static void set_interactive(bool new_interactive) { interactive = new_interactive; }; }; -void sexp_error( +void sexp_error( sexp_exception_t::severity level, const char *msg, size_t c1, size_t c2, int pos); } // namespace sexp diff --git a/include/sexpp/sexp.h b/include/sexpp/sexp.h index 1c11214..d97a45e 100644 --- a/include/sexpp/sexp.h +++ b/include/sexpp/sexp.h @@ -51,7 +51,7 @@ namespace sexp { * However, we do enforce 'C' locale this way */ -class sexp_char_defs_t { +class sexp_char_defs_t { protected: static const bool base64digit[256]; /* true if c is base64 digit */ static const bool tokenchar[256]; /* true if c can be in a token */ @@ -100,7 +100,7 @@ class sexp_input_stream_t; typedef uint8_t octet_t; -class sexp_simple_string_t : public std::basic_string, private sexp_char_defs_t { +class sexp_simple_string_t : public std::basic_string, private sexp_char_defs_t { public: sexp_simple_string_t(void) = default; sexp_simple_string_t(const octet_t *dt) : std::basic_string{dt} {} @@ -161,7 +161,7 @@ inline bool operator!=(const sexp_simple_string_t *left, const std::string &righ * SEXP object */ -class sexp_object_t { +class sexp_object_t { public: virtual ~sexp_object_t(){}; @@ -201,7 +201,7 @@ class sexp_object_t { * SEXP string */ -class sexp_string_t : public sexp_object_t { +class sexp_string_t : public sexp_object_t { protected: bool with_presentation_hint; sexp_simple_string_t presentation_hint; From c6df67f4aa26f69177c1e1fa666eb0fc17892e87 Mon Sep 17 00:00:00 2001 From: maxirmx Date: Sun, 25 Jun 2023 18:22:05 +0300 Subject: [PATCH 3/4] Added symbol visibility filter for shared library --- CMakeLists.txt | 5 +++++ include/sexpp/ext-key-format.h | 7 ++++--- include/sexpp/sexp-error.h | 8 +++++--- include/sexpp/sexp-public.h | 30 ++++++++++++++++++++++++++++++ include/sexpp/sexp.h | 19 +++++++++++-------- src/ext-key-format.cpp | 2 +- src/sexp-char-defs.cpp | 2 +- src/sexp-depth-manager.cpp | 2 +- src/sexp-error.cpp | 2 +- src/sexp-input.cpp | 2 +- src/sexp-main.cpp | 2 +- src/sexp-object.cpp | 2 +- src/sexp-output.cpp | 2 +- src/sexp-simple-string.cpp | 2 +- 14 files changed, 64 insertions(+), 23 deletions(-) create mode 100644 include/sexpp/sexp-public.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d88547e..9ac363c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,6 +130,11 @@ target_include_directories(sexpp PUBLIC $ ) +if (BUILD_SHARED_LIBS) + target_compile_definitions(sexpp PUBLIC BUILD_SHARED_LIBS) + set_target_properties(sexpp PROPERTIES CXX_VISIBILITY_PRESET "hidden") +endif (BUILD_SHARED_LIBS) + set_target_properties(sexpp PROPERTIES POSITION_INDEPENDENT_CODE ON RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" diff --git a/include/sexpp/ext-key-format.h b/include/sexpp/ext-key-format.h index 1fcaf49..bef746f 100644 --- a/include/sexpp/ext-key-format.h +++ b/include/sexpp/ext-key-format.h @@ -25,16 +25,17 @@ #include +#include "sexp-public.h" #include "sexp.h" namespace ext_key_format { -void ext_key_error( +void SEXP_PUBLIC_SYMBOL ext_key_error( sexp::sexp_exception_t::severity level, const char *msg, size_t c1, size_t c2, int pos); class ext_key_input_stream_t; -class extended_private_key_t { +class SEXP_PUBLIC_SYMBOL extended_private_key_t { public: // Comparison of names is done case insensitively !!! struct ci_less { @@ -68,7 +69,7 @@ class extended_private_key_t { void parse(ext_key_input_stream_t &is); }; -class ext_key_input_stream_t : public sexp::sexp_input_stream_t { +class SEXP_PUBLIC_SYMBOL ext_key_input_stream_t : public sexp::sexp_input_stream_t { private: static const bool namechar[256]; /* true if allowed in the name field */ diff --git a/include/sexpp/sexp-error.h b/include/sexpp/sexp-error.h index 58bd780..3ed345f 100644 --- a/include/sexpp/sexp-error.h +++ b/include/sexpp/sexp-error.h @@ -28,9 +28,11 @@ #include #include +#include "sexp-public.h" + namespace sexp { -class sexp_exception_t : public std::exception { +class SEXP_PUBLIC_SYMBOL sexp_exception_t : public std::exception { public: enum severity { error = 0, warning = 1 }; @@ -65,7 +67,7 @@ class sexp_exception_t : public std::exception { static void set_interactive(bool new_interactive) { interactive = new_interactive; }; }; -void sexp_error( - sexp_exception_t::severity level, const char *msg, size_t c1, size_t c2, int pos); +void SEXP_PUBLIC_SYMBOL +sexp_error(sexp_exception_t::severity level, const char *msg, size_t c1, size_t c2, int pos); } // namespace sexp diff --git a/include/sexpp/sexp-public.h b/include/sexpp/sexp-public.h new file mode 100644 index 0000000..ab0674e --- /dev/null +++ b/include/sexpp/sexp-public.h @@ -0,0 +1,30 @@ +/** + * + * Copyright 2023 Ribose Inc. (https://www.ribose.com) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#pragma once + +#ifdef BUILD_SHARED_LIBS +#define SEXP_PUBLIC_SYMBOL __attribute__((visibility("default"))) +#else +#define SEXP_PUBLIC_SYMBOL +#endif diff --git a/include/sexpp/sexp.h b/include/sexpp/sexp.h index d97a45e..bb6ae4e 100644 --- a/include/sexpp/sexp.h +++ b/include/sexpp/sexp.h @@ -41,6 +41,7 @@ #include #include +#include "sexp-public.h" #include "sexp-error.h" namespace sexp { @@ -51,7 +52,7 @@ namespace sexp { * However, we do enforce 'C' locale this way */ -class sexp_char_defs_t { +class SEXP_PUBLIC_SYMBOL sexp_char_defs_t { protected: static const bool base64digit[256]; /* true if c is base64 digit */ static const bool tokenchar[256]; /* true if c can be in a token */ @@ -100,7 +101,8 @@ class sexp_input_stream_t; typedef uint8_t octet_t; -class sexp_simple_string_t : public std::basic_string, private sexp_char_defs_t { +class SEXP_PUBLIC_SYMBOL sexp_simple_string_t : public std::basic_string, + private sexp_char_defs_t { public: sexp_simple_string_t(void) = default; sexp_simple_string_t(const octet_t *dt) : std::basic_string{dt} {} @@ -161,7 +163,7 @@ inline bool operator!=(const sexp_simple_string_t *left, const std::string &righ * SEXP object */ -class sexp_object_t { +class SEXP_PUBLIC_SYMBOL sexp_object_t { public: virtual ~sexp_object_t(){}; @@ -201,7 +203,7 @@ class sexp_object_t { * SEXP string */ -class sexp_string_t : public sexp_object_t { +class SEXP_PUBLIC_SYMBOL sexp_string_t : public sexp_object_t { protected: bool with_presentation_hint; sexp_simple_string_t presentation_hint; @@ -265,7 +267,8 @@ inline bool operator!=(const sexp_string_t *left, const std::string &right) noex * SEXP list */ -class sexp_list_t : public sexp_object_t, public std::vector> { +class SEXP_PUBLIC_SYMBOL sexp_list_t : public sexp_object_t, + public std::vector> { public: virtual ~sexp_list_t() {} @@ -299,7 +302,7 @@ class sexp_list_t : public sexp_object_t, public std::vector +#include "sexpp/ext-key-format.h" using namespace sexp; diff --git a/src/sexp-char-defs.cpp b/src/sexp-char-defs.cpp index 0dd7011..f31b62d 100644 --- a/src/sexp-char-defs.cpp +++ b/src/sexp-char-defs.cpp @@ -26,7 +26,7 @@ * 7/21/1997 */ -#include +#include "sexpp/sexp.h" namespace sexp { diff --git a/src/sexp-depth-manager.cpp b/src/sexp-depth-manager.cpp index 6694cb6..2f26e27 100644 --- a/src/sexp-depth-manager.cpp +++ b/src/sexp-depth-manager.cpp @@ -21,7 +21,7 @@ * **/ -#include +#include "sexpp/sexp.h" namespace sexp { diff --git a/src/sexp-error.cpp b/src/sexp-error.cpp index ad1458d..3558f02 100644 --- a/src/sexp-error.cpp +++ b/src/sexp-error.cpp @@ -21,7 +21,7 @@ * */ -#include +#include "sexpp/sexp-error.h" namespace sexp { diff --git a/src/sexp-input.cpp b/src/sexp-input.cpp index 2508331..cb21686 100644 --- a/src/sexp-input.cpp +++ b/src/sexp-input.cpp @@ -26,7 +26,7 @@ * 7/21/1997 */ -#include +#include "sexpp/sexp.h" namespace sexp { diff --git a/src/sexp-main.cpp b/src/sexp-main.cpp index 937fa4c..46fae63 100644 --- a/src/sexp-main.cpp +++ b/src/sexp-main.cpp @@ -28,7 +28,7 @@ #include -#include +#include "sexpp/sexp.h" using namespace sexp; diff --git a/src/sexp-object.cpp b/src/sexp-object.cpp index 0099d19..d01ae11 100644 --- a/src/sexp-object.cpp +++ b/src/sexp-object.cpp @@ -26,7 +26,7 @@ * 5/5/1997 */ -#include +#include "sexpp/sexp.h" namespace sexp { diff --git a/src/sexp-output.cpp b/src/sexp-output.cpp index f1acd13..07b476c 100644 --- a/src/sexp-output.cpp +++ b/src/sexp-output.cpp @@ -26,7 +26,7 @@ * 5/5/1997 */ -#include +#include "sexpp/sexp.h" namespace sexp { diff --git a/src/sexp-simple-string.cpp b/src/sexp-simple-string.cpp index ad585f0..0e4c869 100644 --- a/src/sexp-simple-string.cpp +++ b/src/sexp-simple-string.cpp @@ -26,7 +26,7 @@ * 5/5/1997 */ -#include +#include "sexpp/sexp.h" namespace sexp { /* From d100d6ce8402678730daf9a646276b99c905c9d9 Mon Sep 17 00:00:00 2001 From: maxirmx Date: Mon, 26 Jun 2023 10:47:42 +0300 Subject: [PATCH 4/4] Coverity scan using action --- .github/workflows/coverity.yml | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index ad9c668..5c74eeb 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -38,7 +38,7 @@ jobs: CC: gcc CXX: g++ MAKEFLAGS: j4 - TOKEN: qjcM1CWLcq9PJB3yL0ZXIw + COVERITY_TOKEN: qjcM1CWLcq9PJB3yL0ZXIw steps: - name: Checkout uses: actions/checkout@v3 @@ -55,26 +55,9 @@ jobs: - name: Configure run: cmake -Bbuild -DDOWNLOAD_GTEST=OFF - - name: Download Coverity - run: | - wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=$GITHUB_REPOSITORY" -O cov-analysis-linux64.tar.gz - mkdir cov-analysis-linux64 - tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 - - - name: Build - run: | - set -x - export PATH="$PWD/cov-analysis-linux64/bin:$PATH" - cov-build --dir cov-int cmake --build build - - - name: Submit - run: | - tar czvf results.tgz cov-int - curl \ - --form project=$GITHUB_REPOSITORY \ - --form token=$TOKEN \ - --form email=m.samsonov@computer.org \ - --form file=@results.tgz \ - --form version=$GITHUB_REF \ - --form description=$GITHUB_SHA \ - https://scan.coverity.com/builds?project=$GITHUB_REPOSITORY + - name: Coverity Scan + uses: vapier/coverity-scan-action@v1 + with: + email: maxirmx@sw.consulting + token: ${{ env.COVERITY_TOKEN }} + command: cmake --build build