Skip to content

Commit 1e0c2cf

Browse files
committed
[ET][Testing] Build test_backend_compiler_lib when testing is on
ghstack-source-id: 288fff2 ghstack-comment-id: 2784895427 Pull Request resolved: #9953
1 parent 1f5ca0c commit 1e0c2cf

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,10 @@ if(EXECUTORCH_BUILD_PYBIND)
810810
torch
811811
)
812812

813+
if(EXECUTORCH_BUILD_TESTS)
814+
list(APPEND _dep_libs test_backend_compiler_lib)
815+
endif()
816+
813817
if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
814818
list(APPEND _dep_libs optimized_native_cpu_ops_lib)
815819
else()

pytest.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ addopts =
6363
--ignore=exir/backend/test/demos
6464
--ignore=exir/backend/test/test_backends.py
6565
--ignore=exir/backend/test/test_backends_lifted.py
66-
--ignore=exir/backend/test/test_compatibility.py
67-
--ignore=exir/backend/test/test_lowered_backend_module.py
6866
--ignore=exir/backend/test/test_partitioner.py
6967
--ignore=exir/tests/test_common.py
7068
--ignore=exir/tests/test_memory_format_ops_pass_aten.py

runtime/executor/test/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,23 @@ target_include_directories(
152152
PRIVATE "${CMAKE_INSTALL_PREFIX}/schema/include"
153153
"${EXECUTORCH_ROOT}/third-party/flatbuffers/include"
154154
)
155+
156+
list(TRANSFORM _test_backend_compiler_lib__srcs PREPEND "${EXECUTORCH_ROOT}/")
157+
add_library(
158+
test_backend_compiler_lib
159+
STATIC
160+
${_test_backend_compiler_lib__srcs}
161+
)
162+
163+
target_link_libraries(
164+
test_backend_compiler_lib
165+
PUBLIC
166+
executorch_core
167+
)
168+
169+
target_link_options_shared_lib(test_backend_compiler_lib)
170+
171+
install(
172+
TARGETS test_backend_compiler_lib
173+
DESTINATION lib
174+
)

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ def run(self):
718718
# enabled. TODO(dbort): Remove this override once this option is
719719
# managed by cmake itself.
720720
"-DEXECUTORCH_SEPARATE_FLATCC_HOST_PROJECT=OFF",
721+
"-DEXECUTORCH_BUILD_TESTS=ON",
721722
]
722723

723724
build_args = [f"-j{self.parallel}"]

tools/cmake/cmake_deps.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,20 @@ deps = [
150150
"optimized_cpublas",
151151
"portable_kernels",
152152
]
153+
154+
[targets.test_backend_compiler_lib]
155+
buck_targets = [
156+
"//runtime/executor/test:test_backend_compiler_lib",
157+
]
158+
filters = [
159+
".cpp$",
160+
]
161+
excludes = [
162+
]
163+
deps = [
164+
"executorch",
165+
"executorch_core",
166+
]
153167
# ---------------------------------- core end ----------------------------------
154168
# ---------------------------------- extension start ----------------------------------
155169
[targets.extension_data_loader]

0 commit comments

Comments
 (0)