-
Notifications
You must be signed in to change notification settings - Fork 756
add AI-generated unit cases for constant value #4789
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
Draft
kylo5aby
wants to merge
1
commit into
bytecodealliance:main
Choose a base branch
from
kylo5aby:unit-test-enhance-const
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,978
−0
Draft
Changes from all commits
Commits
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,119 @@ | ||
| # Copyright (C) 2019 Intel Corporation. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
|
||
| cmake_minimum_required(VERSION 3.14) | ||
|
|
||
| project(enhanced_constants_test) | ||
|
|
||
| # Platform-specific definitions | ||
| add_definitions(-DRUN_ON_LINUX) | ||
|
|
||
| set(WAMR_BUILD_INTERP 1) | ||
| set(WAMR_BUILD_AOT 1) | ||
| set(WAMR_BUILD_JIT 1) | ||
| set(WAMR_BUILD_FAST_JIT 0) | ||
| set(WAMR_BUILD_LIBC_WASI 1) | ||
| set(WAMR_BUILD_APP_FRAMEWORK 0) | ||
| set(WAMR_BUILD_MEMORY_PROFILING 0) | ||
|
|
||
| # Include shared unit test configuration | ||
| include(../../unit_common.cmake) | ||
|
|
||
| find_package(LLVM REQUIRED CONFIG) | ||
| include_directories(${LLVM_INCLUDE_DIRS}) | ||
| add_definitions(${LLVM_DEFINITIONS}) | ||
|
|
||
| include(${IWASM_DIR}/compilation/iwasm_compl.cmake) | ||
|
|
||
| include_directories(${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| set(i32_const_test_sources | ||
| enhanced_i32_const_test.cc | ||
| ${WAMR_RUNTIME_LIB_SOURCE} | ||
| ${IWASM_COMPL_SOURCE} | ||
| ${UNCOMMON_SHARED_SOURCE} | ||
| ) | ||
|
|
||
| # Prepare unit test sources for i64.const test | ||
| # set(i64_const_test_sources | ||
| # enhanced_i64_const_test.cc | ||
| # ${WAMR_RUNTIME_LIB_SOURCE} | ||
| # ${IWASM_COMPL_SOURCE} | ||
| # ${UNCOMMON_SHARED_SOURCE} | ||
| # ) | ||
|
|
||
| # Prepare unit test sources for f32.const test | ||
| set(f32_const_test_sources | ||
| enhanced_f32_const_test.cc | ||
| ${WAMR_RUNTIME_LIB_SOURCE} | ||
| ${IWASM_COMPL_SOURCE} | ||
| ${UNCOMMON_SHARED_SOURCE} | ||
| ) | ||
|
|
||
| # Prepare unit test sources for f64.const test | ||
| # set(f64_const_test_sources | ||
| # enhanced_f64_const_test.cc | ||
| # ${WAMR_RUNTIME_LIB_SOURCE} | ||
| # ${IWASM_COMPL_SOURCE} | ||
| # ${UNCOMMON_SHARED_SOURCE} | ||
| # ) | ||
|
|
||
| # Create test executables | ||
| add_executable(enhanced_i32_const_test ${i32_const_test_sources}) | ||
| # add_executable(enhanced_i64_const_test ${i64_const_test_sources}) | ||
| add_executable(enhanced_f32_const_test ${f32_const_test_sources}) | ||
| # add_executable(enhanced_f64_const_test ${f64_const_test_sources}) | ||
|
|
||
|
|
||
| # Link required libraries | ||
| target_link_libraries(enhanced_i32_const_test ${LLVM_AVAILABLE_LIBS} gtest_main) | ||
| # target_link_libraries(enhanced_i64_const_test ${LLVM_AVAILABLE_LIBS} gtest_main) | ||
| target_link_libraries(enhanced_f32_const_test ${LLVM_AVAILABLE_LIBS} gtest_main) | ||
| # target_link_libraries(enhanced_f64_const_test ${LLVM_AVAILABLE_LIBS} gtest_main) | ||
|
|
||
| # Post-build: Copy WASM test files to build directory for all tests | ||
| add_custom_command(TARGET enhanced_i32_const_test POST_BUILD | ||
| COMMAND ${CMAKE_COMMAND} -E copy_directory | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/wasm-apps | ||
| $<TARGET_FILE_DIR:enhanced_i32_const_test>/wasm-apps | ||
| COMMENT "Copying WASM test files to i32_const test build directory" | ||
| ) | ||
|
|
||
| # add_custom_command(TARGET enhanced_i64_const_test POST_BUILD | ||
| # COMMAND ${CMAKE_COMMAND} -E copy_directory | ||
| # ${CMAKE_CURRENT_SOURCE_DIR}/wasm-apps | ||
| # $<TARGET_FILE_DIR:enhanced_i64_const_test>/wasm-apps | ||
| # COMMENT "Copying WASM test files to i64_const test build directory" | ||
| # ) | ||
|
|
||
| add_custom_command(TARGET enhanced_f32_const_test POST_BUILD | ||
| COMMAND ${CMAKE_COMMAND} -E copy_directory | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/wasm-apps | ||
| $<TARGET_FILE_DIR:enhanced_f32_const_test>/wasm-apps | ||
| COMMENT "Copying WASM test files to f32_const test build directory" | ||
| ) | ||
|
|
||
| # add_custom_command(TARGET enhanced_f64_const_test POST_BUILD | ||
| # COMMAND ${CMAKE_COMMAND} -E copy_directory | ||
| # ${CMAKE_CURRENT_SOURCE_DIR}/wasm-apps | ||
| # $<TARGET_FILE_DIR:enhanced_f64_const_test>/wasm-apps | ||
| # COMMENT "Copying WASM test files to f64_const test build directory" | ||
| # ) | ||
|
|
||
| include(GoogleTest) | ||
|
|
||
| gtest_discover_tests(enhanced_i32_const_test | ||
| PROPERTIES RUN_SERIAL TRUE | ||
| WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| # gtest_discover_tests(enhanced_i64_const_test | ||
| # PROPERTIES RUN_SERIAL TRUE | ||
| # WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| gtest_discover_tests(enhanced_f32_const_test | ||
| PROPERTIES RUN_SERIAL TRUE | ||
| WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| # gtest_discover_tests(enhanced_f64_const_test | ||
| # PROPERTIES RUN_SERIAL TRUE | ||
| # WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) |
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.
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.
might need to reconsider. If all AI-generation cases are planned to adapt to x86-64 only, adding the
if (WAMR_BUILD_TARGET STREQUAL "X86_64")control in tests/unit/CMakeLists.txt would be better.