diff --git a/.appveyor.yml b/.appveyor.yml index d5a1aeff293..4b0833aabc1 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -20,6 +20,7 @@ environment: APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 BUILD_DIR: build RUN_TESTS: false + TEST_INCLUDE_HEADERS_CPP: false # VS2022 64 - builder: vs2022_64 PYTHON: 'C:\\Python38-x64' @@ -27,6 +28,7 @@ environment: APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 BUILD_DIR: build RUN_TESTS: true + TEST_INCLUDE_HEADERS_CPP: true # VS2017 64 (Dynamic linking) - builder: vs2017_64_dyn PYTHON: 'C:\\Python37' @@ -34,6 +36,7 @@ environment: APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 BUILD_DIR: build RUN_TESTS: false + TEST_INCLUDE_HEADERS_CPP: false # Clang-cl 64 (Dynamic linking) - builder: clang_cl_64_dyn PYTHON: 'C:\\Python38' @@ -41,6 +44,7 @@ environment: APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 BUILD_DIR: build RUN_TESTS: true + TEST_INCLUDE_HEADERS_CPP: false only_commits: files: @@ -79,12 +83,11 @@ build_script: - cmd: if %builder% == clang_cl_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2019%" x64 && set CC=clang-cl && %PYTHON%\Scripts\meson setup --buildtype=release --prefix="%CD%\%DIST_FOLDER%" build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% ) -# Run tests only conditionally for: -- - matrix: - only: - - RUN_TESTS: true + # Run tests only conditionally + - matrix: + only: + - RUN_TESTS: true test_script: - if %builder% == vs2017_64 ( call "%VSVARSALLPATH2017%" x64 ) @@ -105,6 +108,25 @@ for: - rz-test -o results.json -L db - cd .. + # Include header files from C++ + - matrix: + only: + - TEST_INCLUDE_HEADERS_CPP: true + + test_script: + - if %builder% == vs2017_64 ( call "%VSVARSALLPATH2017%" x64 ) + - if %builder% == vs2022_64 ( call "%VSVARSALLPATH2022%" x64 ) + - if %builder% == vs2017_64_dyn ( call "%VSVARSALLPATH2017%" x64 ) + - if %builder% == clang_cl_64_dyn ( call "%VSVARSALLPATH2019%" x64 ) + - set PATH=%APPVEYOR_BUILD_FOLDER%\%DIST_FOLDER%\bin;C:\Python38-x64;C:\msys64\mingw64\bin;%PATH% + - echo %PATH% + - where rizin + - rizin -v + - copy C:\Python38-x64\python.exe C:\Python38-x64\python3.exe + - "%PYTHON%\\Scripts\\meson setup build-cpp-test ./test/unit/cpp" + - "%PYTHON%\\Scripts\\meson compile -C build-cpp-test" + - "%PYTHON%\\Scripts\\meson test -C build-cpp-test --print-errorlogs" + # Artifacts artifacts: # Binaries diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 606fba3e8c5..43ed7801513 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -739,8 +739,8 @@ jobs: name: rizin-android-${{ matrix.name }} path: /tmp/rizin-android-${{ matrix.name }}.tar.gz - build-cpp: - name: Include Rizin headers from C++ program + build-cpp-linux: + name: Include Rizin headers from C++ program (Linux) runs-on: ubuntu-22.04 if: contains(github.head_ref, 'dist') || contains(github.head_ref, 'cpp') || ((contains(github.ref, 'release-') || github.ref == 'refs/heads/stable') && github.event_name == 'push') || github.event_name == 'schedule' needs: [build-and-test] diff --git a/librz/include/rz_analysis.h b/librz/include/rz_analysis.h index 3a71b62c55a..66236344f05 100644 --- a/librz/include/rz_analysis.h +++ b/librz/include/rz_analysis.h @@ -713,6 +713,8 @@ typedef enum rz_analysis_var_kind_t { RZ_ANALYSIS_VAR_KIND_INVALID = 0, ///< Invalid or unspecified variable RZ_ANALYSIS_VAR_KIND_FORMAL_PARAMETER, ///< Variable is function formal parameter RZ_ANALYSIS_VAR_KIND_VARIABLE, ///< Variable is local variable + /* End enum */ + RZ_ANALYSIS_VAR_KIND_END ///< Number of RzAnalysisVarKind enums } RzAnalysisVarKind; typedef struct dwarf_variable_t { @@ -728,17 +730,19 @@ typedef struct dwarf_variable_t { typedef enum { RZ_ANALYSIS_VAR_ORIGIN_NONE = 0, ///< Variable was created from rizin RZ_ANALYSIS_VAR_ORIGIN_DWARF, ///< Variable was created from DWARF information + /* End enum */ + RZ_ANALYSIS_VAR_ORIGIN_END ///< Number of RzAnalysisVarOriginKind enums } RzAnalysisVarOriginKind; -static const char *RzAnalysisVarKind_strings[] = { - [RZ_ANALYSIS_VAR_KIND_INVALID] = "invalid", - [RZ_ANALYSIS_VAR_KIND_FORMAL_PARAMETER] = "formal_parameter", - [RZ_ANALYSIS_VAR_KIND_VARIABLE] = "variable", +static const char *RzAnalysisVarKind_strings[RZ_ANALYSIS_VAR_KIND_END] = { + "invalid", /* RZ_ANALYSIS_VAR_KIND_INVALID */ + "formal_parameter", /* RZ_ANALYSIS_VAR_KIND_FORMAL_PARAMETER */ + "variable", /* RZ_ANALYSIS_VAR_KIND_VARIABLE */ }; -static const char *RzAnalysisVarOriginKind_strings[] = { - [RZ_ANALYSIS_VAR_ORIGIN_NONE] = "none", - [RZ_ANALYSIS_VAR_ORIGIN_DWARF] = "DWARF", +static const char *RzAnalysisVarOriginKind_strings[RZ_ANALYSIS_VAR_ORIGIN_END] = { + "none", /* RZ_ANALYSIS_VAR_ORIGIN_NONE */ + "DWARF", /* RZ_ANALYSIS_VAR_ORIGIN_DWARF */ }; #define RZ_ANALYSIS_AS_STRING_IMPL(T, name, strings) \