Skip to content

Commit

Permalink
[CMake] Add the info for downloading testing sources.
Browse files Browse the repository at this point in the history
Signed-off-by: YiYing He <[email protected]>
  • Loading branch information
q82419 committed Jul 18, 2022
1 parent d4d2433 commit c267227
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 26 deletions.
1 change: 0 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,4 @@ if(WASMEDGE_BUILD_COVERAGE)
"${PROJECT_SOURCE_DIR}/thirdparty/*"
"${PROJECT_SOURCE_DIR}/test/*"
)

endif()
43 changes: 18 additions & 25 deletions test/spec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
# SPDX-FileCopyrightText: 2019-2022 Second State INC

include(FetchContent)

message(STATUS "Downloading the WASM spec test suite")
FetchContent_Declare(
wasmedge_unit_test
GIT_REPOSITORY https://github.com/second-state/WasmEdge-unittest
GIT_TAG wasm-dev-0.10.1
)
FetchContent_MakeAvailable(wasmedge_unit_test)
message(STATUS "Downloading the WASM spec test suite -- done")

message(STATUS "Downloading rapidjson source")
FetchContent_Declare(
rapidjson
GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
Expand All @@ -35,34 +39,23 @@ set(RAPIDJSON_BUILD_TESTS OFF CACHE BOOL "Build rapidjson perftests and unittest
set(RAPIDJSON_BUILD_CXX11 OFF CACHE BOOL "Build rapidjson with C++11" FORCE)
set(RAPIDJSON_BUILD_CXX17 ON CACHE BOOL "Build rapidjson with C++17" FORCE)
FetchContent_MakeAvailable(rapidjson)
message(STATUS "Downloading rapidjson source -- done")
add_library(rapidjson INTERFACE)
target_include_directories(rapidjson INTERFACE ${rapidjson_SOURCE_DIR}/include)

file(COPY
${wasmedge_unit_test_SOURCE_DIR}/core
DESTINATION
${CMAKE_CURRENT_BINARY_DIR}/testSuites
)
file(COPY
${wasmedge_unit_test_SOURCE_DIR}/multi-memory
DESTINATION
${CMAKE_CURRENT_BINARY_DIR}/testSuites
)
file(COPY
${wasmedge_unit_test_SOURCE_DIR}/tail-call
DESTINATION
${CMAKE_CURRENT_BINARY_DIR}/testSuites
)
file(COPY
${wasmedge_unit_test_SOURCE_DIR}/extended-const
DESTINATION
${CMAKE_CURRENT_BINARY_DIR}/testSuites
)
file(COPY
${wasmedge_unit_test_SOURCE_DIR}/threads
DESTINATION
${CMAKE_CURRENT_BINARY_DIR}/testSuites
)
function(wasmedge_copy_spec_testsuite proposal)
message(STATUS "Copying test suite to ${CMAKE_CURRENT_BINARY_DIR}/testSuites/${proposal}")
file(COPY
${wasmedge_unit_test_SOURCE_DIR}/${proposal}
DESTINATION
${CMAKE_CURRENT_BINARY_DIR}/testSuites
)
message(STATUS "Copying test suite to ${CMAKE_CURRENT_BINARY_DIR}/testSuites/${proposal} -- done")
endfunction()

foreach(PROPOSAL core multi-memory tail-call extended-const threads)
wasmedge_copy_spec_testsuite(${PROPOSAL})
endforeach()

wasmedge_add_library(wasmedgeTestSpec
spectest.cpp
Expand Down

0 comments on commit c267227

Please sign in to comment.