-
Notifications
You must be signed in to change notification settings - Fork 2
cleanup tests #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
cleanup tests #71
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
af3fbc1
cleanup tests
nbassler 83d5bc3
fix
nbassler 412b3cd
clang format
nbassler 2c0b6d8
Merge branch 'main' into 64-modernize-repository
nbassler 586c556
fix copilot
nbassler 77d1370
one more commit
nbassler cecec43
fix smoketest
nbassler c5d8cab
add codecov
nbassler 20776ca
fix cov
nbassler 4c9fd18
fix2
nbassler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: Coverage | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| coverage: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install lcov | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y lcov | ||
|
|
||
| - name: Configure | ||
| run: cmake --preset coverage | ||
|
|
||
| - name: Build | ||
| run: cmake --build --preset coverage --parallel | ||
|
|
||
| - name: Run tests | ||
| run: ctest --preset coverage | ||
|
|
||
| - name: Collect coverage | ||
| run: | | ||
| lcov --capture --directory build-coverage --output-file coverage.info | ||
| lcov --ignore-errors unused --remove coverage.info '/usr/*' '*/tests/*' --output-file coverage.info | ||
| lcov --list coverage.info | ||
|
|
||
| - name: Upload to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| files: coverage.info | ||
| fail_ci_if_error: true | ||
| token: ${{ secrets.CODECOV_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| { | ||
| "recommendations": [ | ||
| "llvm-vs-code-extensions.vscode-clangd", // C language server (clangd) | ||
| "ms-vscode.cmake-tools", // CMake integration + CTest | ||
| "twxs.cmake" // CMake syntax highlighting | ||
| "llvm-vs-code-extensions.vscode-clangd", | ||
| "ms-vscode.cmake-tools", | ||
| "twxs.cmake" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #include <dedx.h> | ||
| #include <dedx_tools.h> | ||
| #include <dedx_wrappers.h> | ||
| #include <stdio.h> | ||
|
|
||
| int main(void) { | ||
| int err = 0; | ||
| int major = 0; | ||
| int minor = 0; | ||
| int patch = 0; | ||
| float stp; | ||
|
|
||
| dedx_get_version(&major, &minor, &patch); | ||
| stp = dedx_get_simple_stp(DEDX_PROTON, DEDX_WATER, 100.0f, &err); | ||
| if (err != 0) { | ||
| fprintf(stderr, "dedx_get_simple_stp failed: err=%d\n", err); | ||
| return 1; | ||
| } | ||
| if (stp <= 0.0f) { | ||
| fprintf(stderr, "unexpected stopping power: %f\n", stp); | ||
| return 1; | ||
| } | ||
|
|
||
| printf("libdedx %d.%d.%d OK, stp=%f\n", major, minor, patch, stp); | ||
| return 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| set(smoke_root "${TEST_BINARY_DIR}/install-smoke") | ||
| set(smoke_build "${smoke_root}/build") | ||
| set(smoke_prefix "${smoke_root}/prefix") | ||
| set(smoke_consumer "${smoke_root}/install_consumer") | ||
|
|
||
| file(REMOVE_RECURSE "${smoke_root}") | ||
| file(MAKE_DIRECTORY "${smoke_root}") | ||
|
|
||
| set(configure_args | ||
| -S "${SOURCE_DIR}" | ||
| -B "${smoke_build}" | ||
| -DCMAKE_INSTALL_PREFIX=${smoke_prefix} | ||
| -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
| -DDEDX_DATA_PATH_LOCAL= # force use of installed data, not source tree | ||
| -DDEDX_BUILD_BINARY_TABLE=OFF # tables are already built; don't delete and fail to rebuild them | ||
| ) | ||
| if(DEFINED CMAKE_GENERATOR AND NOT CMAKE_GENERATOR STREQUAL "") | ||
| list(PREPEND configure_args -G "${CMAKE_GENERATOR}") | ||
| endif() | ||
|
|
||
| execute_process(COMMAND "${CMAKE_COMMAND}" ${configure_args} | ||
| RESULT_VARIABLE rc) | ||
| if(NOT rc EQUAL 0) | ||
| message(FATAL_ERROR "install smoke configure failed: ${rc}") | ||
| endif() | ||
|
|
||
| execute_process(COMMAND "${CMAKE_COMMAND}" --build "${smoke_build}" --parallel | ||
| RESULT_VARIABLE rc) | ||
| if(NOT rc EQUAL 0) | ||
| message(FATAL_ERROR "install smoke build failed: ${rc}") | ||
| endif() | ||
|
|
||
| execute_process(COMMAND "${CMAKE_COMMAND}" --install "${smoke_build}" | ||
| RESULT_VARIABLE rc) | ||
| if(NOT rc EQUAL 0) | ||
| message(FATAL_ERROR "install smoke install failed: ${rc}") | ||
| endif() | ||
|
|
||
| execute_process( | ||
| COMMAND "${CMAKE_C_COMPILER}" | ||
| "-I${smoke_prefix}/include" | ||
| "-L${smoke_prefix}/lib" | ||
| "${SOURCE_DIR}/tests/install_consumer.c" | ||
| -o "${smoke_consumer}" | ||
| -ldedx | ||
| -lm | ||
| RESULT_VARIABLE rc) | ||
| if(NOT rc EQUAL 0) | ||
| message(FATAL_ERROR "install smoke consumer compile failed: ${rc}") | ||
| endif() | ||
|
|
||
| execute_process(COMMAND "${smoke_consumer}" | ||
| RESULT_VARIABLE rc) | ||
| if(NOT rc EQUAL 0) | ||
| message(FATAL_ERROR "install smoke consumer run failed: ${rc}") | ||
| endif() | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.