mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-01 17:15:52 +00:00
test: Run undefined sanitizer without ignoring errors (#2134)
This commit is contained in:
17
.github/workflows/test_impl.yml
vendored
17
.github/workflows/test_impl.yml
vendored
@@ -46,6 +46,10 @@ jobs:
|
|||||||
|
|
||||||
if: inputs.run_unit_tests
|
if: inputs.run_unit_tests
|
||||||
|
|
||||||
|
env:
|
||||||
|
# TODO: remove when we have fixed all currently existing issues from sanitizers
|
||||||
|
SANITIZER_IGNORE_ERRORS: ${{ inputs.sanitizer != 'false' && inputs.sanitizer != 'ubsan' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clean workdir
|
- name: Clean workdir
|
||||||
if: ${{ runner.os == 'macOS' }}
|
if: ${{ runner.os == 'macOS' }}
|
||||||
@@ -64,15 +68,15 @@ jobs:
|
|||||||
run: chmod +x ./clio_tests
|
run: chmod +x ./clio_tests
|
||||||
|
|
||||||
- name: Run clio_tests (regular)
|
- name: Run clio_tests (regular)
|
||||||
if: inputs.sanitizer == 'false'
|
if: env.SANITIZER_IGNORE_ERRORS == 'false'
|
||||||
run: ./clio_tests
|
run: ./clio_tests
|
||||||
|
|
||||||
- name: Run clio_tests (sanitizer)
|
- name: Run clio_tests (sanitizer errors ignored)
|
||||||
if: inputs.sanitizer != 'false'
|
if: env.SANITIZER_IGNORE_ERRORS == 'true'
|
||||||
run: ./.github/scripts/execute-tests-under-sanitizer ./clio_tests
|
run: ./.github/scripts/execute-tests-under-sanitizer ./clio_tests
|
||||||
|
|
||||||
- name: Check for sanitizer report
|
- name: Check for sanitizer report
|
||||||
if: inputs.sanitizer != 'false'
|
if: env.SANITIZER_IGNORE_ERRORS == 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
id: check_report
|
id: check_report
|
||||||
run: |
|
run: |
|
||||||
@@ -83,16 +87,15 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Upload sanitizer report
|
- name: Upload sanitizer report
|
||||||
if: inputs.sanitizer != 'false' && steps.check_report.outputs.found_report == 'true'
|
if: env.SANITIZER_IGNORE_ERRORS == 'true' && steps.check_report.outputs.found_report == 'true'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.conan_profile }}_report
|
name: ${{ inputs.conan_profile }}_report
|
||||||
path: .sanitizer-report/*
|
path: .sanitizer-report/*
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
|
|
||||||
# TODO: enable when we have fixed all currently existing issues from sanitizers
|
|
||||||
- name: Create an issue
|
- name: Create an issue
|
||||||
if: false && inputs.sanitizer != 'false' && steps.check_report.outputs.found_report == 'true'
|
if: false && env.SANITIZER_IGNORE_ERRORS == 'true' && steps.check_report.outputs.found_report == 'true'
|
||||||
uses: ./.github/actions/create_issue
|
uses: ./.github/actions/create_issue
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|||||||
@@ -184,5 +184,8 @@ TEST_P(WarningCodeTest, WarningToJSON)
|
|||||||
|
|
||||||
TEST(RPCErrorsTest, InvalidWarningToJSON)
|
TEST(RPCErrorsTest, InvalidWarningToJSON)
|
||||||
{
|
{
|
||||||
EXPECT_ANY_THROW((void)makeWarning(static_cast<WarningCode>(999999)));
|
auto notSanitizedMakeWarning = []() __attribute__((no_sanitize("undefined"))) {
|
||||||
|
return makeWarning(static_cast<WarningCode>(999999));
|
||||||
|
};
|
||||||
|
EXPECT_ANY_THROW((void)notSanitizedMakeWarning());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user