Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add test toweak-node-api#321

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
kraenhansen wants to merge6 commits intokh/weak-node-api-headers
base:kh/weak-node-api-headers
Choose a base branch
Loading
fromkh/weak-node-api-tests

Conversation

@kraenhansen
Copy link
Collaborator

Stacked on#320.

Merging this PR will:

  • Add a tests directory in the weak-node-api package with two trivial tests usingcatch2.

@kraenhansenkraenhansen self-assigned thisNov 5, 2025
@kraenhansenkraenhansen added CIContinuous integration weak-node-api labelsNov 5, 2025
@kraenhansenkraenhansenforce-pushed thekh/weak-node-api-tests branch 2 times, most recently from5f097f4 toec5d060CompareNovember 5, 2025 21:34
@kraenhansenkraenhansen marked this pull request as ready for reviewNovember 5, 2025 21:57
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull Request Overview

This PR adds C++ unit tests to theweak-node-api package using the Catch2 testing framework. The tests verify the weak API injection mechanism and function call propagation.

Key changes:

  • Introduces Catch2-based C++ tests for the weak Node-API host injection functionality
  • Updates code generation to use C++20 features and improve cross-platform compatibility
  • Adds CI workflow for running C++ tests across multiple platforms

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
packages/weak-node-api/tests/test_inject.cppAdds two test cases verifyinginject_weak_node_api_host functionality
packages/weak-node-api/tests/CMakeLists.txtConfigures Catch2 test executable with CTest integration
packages/weak-node-api/scripts/generate-weak-node-api.tsUpdates code generation for C++20 compatibility and adds unreachable macro
packages/weak-node-api/CMakeLists.txtUpgrades to C++20 and adds optional test building
packages/weak-node-api/.gitignoreAdds clang cache directory to ignore list
.github/workflows/check.ymlAdds cross-platform CI job for running weak-node-api tests

-uses:actions/checkout@v4
-uses:actions/setup-node@v4
with:
node-version:lts/jod
Copy link

CopilotAINov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Corrected spelling of 'jod' to 'jodium'.

kraenhansen reacted with laugh emoji
Copilot uses AI. Check for mistakes.
Comment on lines +72 to 78
returnType==="void" ?"" :"return ",
`g_host.${name}`,
"(",
argumentTypes.map((_,index)=>`arg${index}`).join(", "),
");",
noReturn ?"WEAK_NODE_API_UNREACHABLE" :"",
"};",
Copy link

CopilotAINov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The generated code will produce invalid C++ syntax. WhennoReturn is true, the unreachable macro appears after the semicolon and before the closing brace, creating); WEAK_NODE_API_UNREACHABLE };. The macro should be placed before the semicolon or on its own line. Consider using].filter(Boolean).join(" ") and including the semicolon with the return statement, or conditionally building the return line.

Copilot uses AI. Check for mistakes.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

Assignees

@kraenhansenkraenhansen

Labels

CIContinuous integrationweak-node-api

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@kraenhansen

[8]ページ先頭

©2009-2025 Movatter.jp