Skip to content

Commit a144c67

Browse files
committed
TEST: Define and use llvm_py as backend
1 parent 2a159ff commit a144c67

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

integration_tests/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,23 @@ macro(RUN_UTIL RUN_FAIL RUN_NAME RUN_FILE_NAME RUN_LABELS RUN_EXTRAFILES RUN_EXT
106106
if (${fail})
107107
set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE)
108108
endif()
109+
elseif (KIND STREQUAL "llvm_py")
110+
add_custom_command(
111+
OUTPUT ${name}.o
112+
COMMAND ${LPYTHON} -c ${extra_args} ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.py -o ${name}.o
113+
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file_name}.py
114+
VERBATIM)
115+
add_executable(${name} ${name}.o ${extra_files})
116+
target_include_directories(${name} PRIVATE ${CMAKE_SOURCE_DIR} ${NUMPY_INCLUDE_DIR})
117+
set_target_properties(${name} PROPERTIES LINKER_LANGUAGE C)
118+
target_link_libraries(${name} lpython_rtlib Python::Python)
119+
add_test(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name})
120+
if (labels)
121+
set_tests_properties(${name} PROPERTIES LABELS "${labels}")
122+
endif()
123+
if (${fail})
124+
set_tests_properties(${name} PROPERTIES WILL_FAIL TRUE)
125+
endif()
109126
elseif(KIND STREQUAL "llvm_sym")
110127
add_custom_command(
111128
OUTPUT ${name}.o

integration_tests/run_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Initialization
88
DEFAULT_THREADS_TO_USE = 8 # default no of threads is 8
9-
SUPPORTED_BACKENDS = ['llvm', 'c', 'wasm', 'cpython', 'x86', 'wasm_x86', 'wasm_x64', 'c_py', 'c_sym', 'cpython_sym', 'llvm_sym']
9+
SUPPORTED_BACKENDS = ['llvm', 'c', 'wasm', 'cpython', 'x86', 'wasm_x86', 'wasm_x64', 'c_py', 'c_sym', 'cpython_sym', 'llvm_sym', 'llvm_py']
1010
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
1111
LPYTHON_PATH = f"{BASE_DIR}/../src/bin"
1212

@@ -62,7 +62,7 @@ def main():
6262
DEFAULT_THREADS_TO_USE = args.no_of_threads or DEFAULT_THREADS_TO_USE
6363
fast_tests = "yes" if args.fast else "no"
6464
for backend in args.backends:
65-
python_libs_req = "yes" if backend in ["c_py", "c_sym", "llvm_sym"] else "no"
65+
python_libs_req = "yes" if backend in ["c_py", "c_sym", "llvm_sym", 'llvm_py'] else "no"
6666
test_backend(backend)
6767

6868

0 commit comments

Comments
 (0)