From 72e78267b9358027e7ab28f5778dc232ece71db1 Mon Sep 17 00:00:00 2001 From: Andrei Maiboroda Date: Thu, 6 May 2021 14:56:13 +0200 Subject: [PATCH] cmake: Split WASI unit tests into a separate executable --- test/CMakeLists.txt | 1 + test/unittests/CMakeLists.txt | 3 +-- test/unittests_wasi/CMakeLists.txt | 19 +++++++++++++++++++ .../wasi_test.cpp | 0 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 test/unittests_wasi/CMakeLists.txt rename test/{unittests => unittests_wasi}/wasi_test.cpp (100%) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3025f313c..57355f843 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -31,6 +31,7 @@ add_subdirectory(smoketests) add_subdirectory(spectests) add_subdirectory(testfloat) add_subdirectory(unittests) +add_subdirectory(unittests_wasi) if(FIZZY_FUZZING) add_subdirectory(fuzzer) diff --git a/test/unittests/CMakeLists.txt b/test/unittests/CMakeLists.txt index 7d5a56125..6c30353db 100644 --- a/test/unittests/CMakeLists.txt +++ b/test/unittests/CMakeLists.txt @@ -5,7 +5,7 @@ include(GoogleTest) add_executable(fizzy-unittests) -target_link_libraries(fizzy-unittests PRIVATE fizzy::fizzy-internal fizzy::wasi fizzy::test-utils GTest::gtest_main GTest::gmock) +target_link_libraries(fizzy-unittests PRIVATE fizzy::fizzy-internal fizzy::test-utils GTest::gtest_main GTest::gmock) target_sources( fizzy-unittests PRIVATE @@ -42,7 +42,6 @@ target_sources( validation_stack_type_test.cpp validation_test.cpp value_test.cpp - wasi_test.cpp wasm_engine_test.cpp ) diff --git a/test/unittests_wasi/CMakeLists.txt b/test/unittests_wasi/CMakeLists.txt new file mode 100644 index 000000000..9af388249 --- /dev/null +++ b/test/unittests_wasi/CMakeLists.txt @@ -0,0 +1,19 @@ +# Fizzy: A fast WebAssembly interpreter +# Copyright 2019-2021 The Fizzy Authors. +# SPDX-License-Identifier: Apache-2.0 + +include(GoogleTest) + +add_executable(fizzy-unittests-wasi) +target_link_libraries(fizzy-unittests-wasi PRIVATE fizzy::fizzy-internal fizzy::wasi fizzy::test-utils GTest::gtest_main GTest::gmock) + +target_sources( + fizzy-unittests-wasi PRIVATE + wasi_test.cpp +) + +gtest_discover_tests( + fizzy-unittests-wasi + TEST_PREFIX ${PROJECT_NAME}/unittests_wasi/ + PROPERTIES ENVIRONMENT LLVM_PROFILE_FILE=${CMAKE_BINARY_DIR}/unittests-wasi-%p.profraw +) diff --git a/test/unittests/wasi_test.cpp b/test/unittests_wasi/wasi_test.cpp similarity index 100% rename from test/unittests/wasi_test.cpp rename to test/unittests_wasi/wasi_test.cpp