-
Notifications
You must be signed in to change notification settings - Fork 305
tests: integration: add libgit2
#1861
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8d3d850
tests: integration: add `libgit2` submodule
thedataking 369a894
tests: integration: add `libgit2` transpile support
thedataking 9334f26
tests: integration: enable `libgit2` in CI
thedataking db92390
tests: integration: add `libgit2` refactor support
thedataking cd83a91
tests: integration: add `libgit2` test support
thedataking 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
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,33 @@ | ||
| #!/bin/bash | ||
| set -e; set -o pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "$0" )" && pwd)" | ||
| LOG_FILE="$(basename "$0")".log | ||
| BUILD_DIR="$SCRIPT_DIR/repo/build" | ||
|
|
||
| rm -f compile_commands.json | ||
|
|
||
| cmake -S "$SCRIPT_DIR/repo" -B "$BUILD_DIR" \ | ||
| -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | ||
| -DBUILD_SHARED_LIBS=OFF \ | ||
| -DBUILD_TESTS=ON \ | ||
| -DBUILD_CLI=OFF \ | ||
| -DBUILD_EXAMPLES=OFF \ | ||
| -DBUILD_FUZZERS=OFF \ | ||
| -DUSE_HTTPS=OFF \ | ||
| -DUSE_SSH=OFF \ | ||
| -DUSE_SHA256=builtin \ | ||
| -DUSE_HTTP_PARSER=builtin \ | ||
| -DREGEX_BACKEND=builtin \ | ||
| -DUSE_BUNDLED_ZLIB=ON \ | ||
| -DUSE_NTLMCLIENT=OFF \ | ||
| -DUSE_ICONV=OFF \ | ||
| 2>&1 | tee "$LOG_FILE" | ||
|
|
||
| # The test runner expects compile_commands.json in the fixture directory. | ||
| ln -sf repo/build/compile_commands.json compile_commands.json | ||
|
|
||
| # clar generates `clar_suite.h` at build time, so the test sources can't be | ||
| # transpiled until the test target is built. | ||
| cmake --build "$BUILD_DIR" --target libgit2_tests --parallel "$(nproc)" \ | ||
| 2>&1 | tee -a "$LOG_FILE" | ||
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,34 @@ | ||
| requirements: | ||
| ubuntu: | ||
| apt: | ||
| packages: | ||
| - cmake | ||
| - pkg-config | ||
|
|
||
| transpile: | ||
| autogen: true | ||
| binary: main # clar test runner's `main()` lives in tests/clar/main.c | ||
| tflags: --reorganize-definitions --disable-refactoring | ||
|
thedataking marked this conversation as resolved.
|
||
| # libgit2 builds its tests with GIT_DEPRECATE_HARD but not the library | ||
| # itself (which implements the deprecated APIs), so the same struct has two | ||
| # incompatible declarations across TUs (e.g. git_remote_callbacks.update_tips | ||
| # vs .reserved_update_tips). That breaks the refactor stage's | ||
| # reorganize_definitions pass, which merges declarations by name. Undefine | ||
| # the macro during transpilation so every TU sees one consistent view; the | ||
| # structs are layout-identical and the tests don't use deprecated APIs. | ||
| cflags: -UGIT_DEPRECATE_HARD | ||
|
|
||
| cargo.transpile: | ||
| autogen: true | ||
|
|
||
| refactor: | ||
| autogen: true | ||
| transforms: | ||
| - rename_unnamed | ||
| - reorganize_definitions | ||
| - shorten_imported_paths | ||
| - remove_unused_labels | ||
| - remove_literal_suffixes | ||
|
|
||
| cargo.refactor: | ||
| autogen: true | ||
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,8 @@ | ||
| #!/bin/bash | ||
| set -e; set -o pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "$0" )" && pwd)" | ||
|
|
||
| (cd "$SCRIPT_DIR/repo" && \ | ||
| cargo run --release 2>&1 \ | ||
| | tee "$SCRIPT_DIR/$(basename "$0")".log) |
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.