Skip to content

Commit

Permalink
Merge pull request #45 from akawashiro/fix-python3-test
Browse files Browse the repository at this point in the history
Use absolute path of python3
  • Loading branch information
akawashiro authored Oct 14, 2023
2 parents 82ec62a + 3589fa9 commit 0fd7fc5
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0fd7fc5

Please sign in to comment.