From 3589fa98a617bcc78a3ad1c2d1d18dbf43d11ff7 Mon Sep 17 00:00:00 2001 From: Akira Kawata Date: Sat, 14 Oct 2023 09:15:00 +0900 Subject: [PATCH] Use absolute path of python3 --- tests/CMakeLists.txt | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2b90d38..c429c1c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -159,7 +159,7 @@ add_test(NAME test_tmux add_test(NAME test_python3 COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/compare_stdout.py - ${CMAKE_BINARY_DIR}/sloader python3 --help) + ${CMAKE_BINARY_DIR}/sloader /usr/bin/python3 --help) add_test(NAME test_gcc COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/compare_stdout.py @@ -181,20 +181,25 @@ add_test( NAME test_python3_hello COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/compare_stdout.py - ${CMAKE_BINARY_DIR}/sloader python3 ${CMAKE_CURRENT_SOURCE_DIR}/hello.py) + ${CMAKE_BINARY_DIR}/sloader /usr/bin/python3 ${CMAKE_CURRENT_SOURCE_DIR}/hello.py) add_test( NAME test_python3_ctypes COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/compare_stdout.py - ${CMAKE_BINARY_DIR}/sloader python3 ${CMAKE_CURRENT_SOURCE_DIR}/ctypes.py) - -add_test( - NAME test_python3_torch_ones - COMMAND - python3 ${CMAKE_CURRENT_SOURCE_DIR}/compare_stdout.py - ${CMAKE_BINARY_DIR}/sloader python3 - ${CMAKE_CURRENT_SOURCE_DIR}/torch_ones.py) + ${CMAKE_BINARY_DIR}/sloader /usr/bin/python3 ${CMAKE_CURRENT_SOURCE_DIR}/ctypes.py) + +# Installing additional packages is required but not supported yet. +# +# Just `python3` may be a bash script because of pyenv. So, we must use +# `/usr/bin/python3` instead. Then, we must install torch system-wide. But, I +# don't want to install torch system-wide just for testing. +# add_test( +# NAME test_python3_torch_ones +# COMMAND +# python3 ${CMAKE_CURRENT_SOURCE_DIR}/compare_stdout.py +# ${CMAKE_BINARY_DIR}/sloader /usr/bin/python3 +# ${CMAKE_CURRENT_SOURCE_DIR}/torch_ones.py) add_test( NAME test_bash_plus