-
Notifications
You must be signed in to change notification settings - Fork 737
[UNIT]test: add unit test cases for interpreter to improve coverage #4716
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
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| target_link_libraries (interpreter_test gtest_main ) | ||
|
|
||
| # Copy WASM files to build directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preferably store all those test cases in a separate directory, such as smart-tests or digit-suite.
please co-sign with ai-assistant in the git comment. https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line
|
|
||
| // Complex calculation with overflow handling | ||
| // The exact result depends on implementation but should not crash | ||
| ASSERT_TRUE(true); // Test passes if no crash occurs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid assertion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd suggest that anyone who wants to submit an AI-generated thing should review it by himself extensively before making it be publicly reviewed.
reviewing AI-generated logic is tiresome.
Signed-off-by: zhenweijin <[email protected]> Co-authored-by: Gong, Pu <[email protected]> Co-authored-by: ai-assistant
|
The file and directory structure should be organized as follows: |
|
IMO, ideally, for a function, there should be one positive case, one negative case, and one corner case for testing. |
Summary
To quickly improve WAMR's software quality, this PR uses LLM to generate unit test cases for the interpreter module.
Changes
iwasm/interpretermoduleiwasm/interpretercoverage:Testing
All new test cases pass successfully.
Welcome any feedback or suggestions on these AI-generated test cases. Please let me know if you have ideas for improvement.