forked from pytorch/executorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements to OSS Test CMake generation and add tests (pytorch#3649)
Summary: * Fix the bash script looping through exectubales * For the generator, add a way to add additional libs in generated CMakeLists.txt * Build extension/data_loader in main target as an example for the fix Pull Request resolved: pytorch#3649 Test Plan: `sh test/run_oss_cpp_tests.sh` Reviewed By: larryliu0820 Differential Revision: D57467885 Pulled By: kirklandsign fbshipit-source-id: 49f9b8dac9f091aca05a122aaf0cb9020d192b68
- Loading branch information
1 parent
0364d45
commit 6efe44c
Showing
5 changed files
with
76 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
# @generated by test/utils/generate_gtest_cmakelists.py | ||
# | ||
# This file should be formatted with | ||
# ~~~ | ||
# cmake-format -i CMakeLists.txt | ||
# ~~~ | ||
# It should also be cmake-lint clean. | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.19) | ||
project(extension_data_loader_test) | ||
|
||
# Use C++14 for test. | ||
set(CMAKE_CXX_STANDARD 14) | ||
|
||
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..) | ||
|
||
include(${EXECUTORCH_ROOT}/build/Utils.cmake) | ||
|
||
# Find prebuilt executorch library | ||
find_package(executorch CONFIG REQUIRED) | ||
|
||
enable_testing() | ||
find_package(GTest CONFIG REQUIRED) | ||
|
||
# Let files say "include <executorch/path/to/header.h>". | ||
set(_common_include_directories ${EXECUTORCH_ROOT}/..) | ||
target_include_directories(executorch INTERFACE ${_common_include_directories}) | ||
|
||
set(_test_srcs buffer_data_loader_test.cpp shared_ptr_data_loader_test.cpp | ||
file_data_loader_test.cpp mmap_data_loader_test.cpp | ||
) | ||
|
||
add_executable(extension_data_loader_test ${_test_srcs}) | ||
target_link_libraries( | ||
extension_data_loader_test GTest::gtest GTest::gtest_main GTest::gmock | ||
executorch extension_data_loader | ||
) | ||
add_test(ExecuTorchTest extension_data_loader_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters