Merge "Move test_runner.py so it can be used for softrvv."
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8839d2..bcd46a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,14 +22,17 @@
set(LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/springbok/matcha.ld" CACHE PATH "Linker script for springbok")
+set(TEST_RUNNER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/scripts/test_runner.py)
+
+file(COPY ${TEST_RUNNER_SRC}
+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+
include(vec_cc_binary)
include(vec_cc_test)
add_subdirectory(springbok)
add_subdirectory(hello_vec)
-add_subdirectory(softrvv)
-
add_subdirectory(vector_tests)
add_subdirectory(vector_load_store_tests)
add_subdirectory(vector_vadd_vsub_tests)
@@ -39,7 +42,7 @@
add_subdirectory(pw_unit_test_demo)
enable_testing()
-
+add_subdirectory(softrvv)
add_subdirectory(tests)
add_custom_target(AllTests
diff --git a/cmake/vec_cc_test.cmake b/cmake/vec_cc_test.cmake
index 7c36331..d7d5951 100644
--- a/cmake/vec_cc_test.cmake
+++ b/cmake/vec_cc_test.cmake
@@ -33,25 +33,26 @@
set(_TIMEOUT ${_RULE_TIMEOUT})
endif()
+find_file(TEST_RUNNER test_runner.py HINTS ${CMAKE_BINARY_DIR})
find_program(QEMU_RV32 qemu-system-riscv32 HINTS $ENV{OUT}/host/qemu)
-if(QEMU_RV32)
+if(QEMU_RV32 AND TEST_RUNNER)
add_test(
NAME
"qemu_${_RULE_NAME}"
COMMAND
- test_runner.py qemu $<TARGET_FILE:${_RULE_NAME}.elf> --qemu-path ${QEMU_RV32} --timeout=${_TIMEOUT}
+ ${TEST_RUNNER} qemu $<TARGET_FILE:${_RULE_NAME}.elf> --qemu-path ${QEMU_RV32} --timeout=${_TIMEOUT}
)
set_tests_properties("qemu_${_RULE_NAME}" PROPERTIES TIMEOUT ${_TIMEOUT})
else()
message(WARNING "qemu-system-riscv32 doesn't exist. Make sure you build qemu first and start a clean build to enable the qemu test")
endif()
find_program(RENODE_EXE Renode.exe HINTS $ENV{OUT}/host/renode)
-if(RENODE_EXE)
+if(RENODE_EXE AND TEST_RUNNER)
add_test(
NAME
"renode_${_RULE_NAME}"
COMMAND
- test_runner.py renode $<TARGET_FILE:${_RULE_NAME}.elf> --renode-path ${RENODE_EXE}
+ ${TEST_RUNNER} renode $<TARGET_FILE:${_RULE_NAME}.elf> --renode-path ${RENODE_EXE}
)
set_tests_properties("renode_${_RULE_NAME}" PROPERTIES TIMEOUT ${_TIMEOUT})
else()
diff --git a/tests/test_runner.py b/scripts/test_runner.py
similarity index 100%
rename from tests/test_runner.py
rename to scripts/test_runner.py
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 73fbeef..61f87aa 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -2,9 +2,6 @@
include(vec_cc_generated_test.cmake)
enable_language(ASM)
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test_runner.py
- DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-
add_library(test_v_helpers
test_v_helpers.cpp)