@@ -495,6 +495,7 @@ set (ONNXRUNTIME_GLOBAL_THREAD_POOLS_TEST_SRC_DIR "${TEST_SRC_DIR}/global_thread
495495set (ONNXRUNTIME_CUSTOM_OP_REGISTRATION_TEST_SRC_DIR "${TEST_SRC_DIR} /custom_op_registration" )
496496set (ONNXRUNTIME_LOGGING_APIS_TEST_SRC_DIR "${TEST_SRC_DIR} /logging_apis" )
497497set (ONNXRUNTIME_AUTOEP_TEST_SRC_DIR "${TEST_SRC_DIR} /autoep" )
498+ set (ONNXRUNTIME_EP_GRAPH_TEST_SRC_DIR "${TEST_SRC_DIR} /ep_graph" )
498499
499500set (onnxruntime_shared_lib_test_SRC
500501 ${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR} /test_fixture.h
@@ -1848,8 +1849,8 @@ if (WIN32 AND onnxruntime_BUILD_SHARED_LIB AND
18481849 ${ONNXRUNTIME_AUTOEP_LIB_LINK_FLAG} )
18491850
18501851 # test library
1851- file (GLOB_RECURSE onnxruntime_autoep_test_SRC "${ONNXRUNTIME_AUTOEP_TEST_SRC_DIR} /*.h"
1852- "${ONNXRUNTIME_AUTOEP_TEST_SRC_DIR} /*.cc" )
1852+ file (GLOB onnxruntime_autoep_test_SRC "${ONNXRUNTIME_AUTOEP_TEST_SRC_DIR} /*.h"
1853+ "${ONNXRUNTIME_AUTOEP_TEST_SRC_DIR} /*.cc" )
18531854
18541855 set (onnxruntime_autoep_test_LIBS onnxruntime_mocked_allocator ${ONNXRUNTIME_TEST_LIBS} onnxruntime_test_utils
18551856 onnx_proto onnx ${onnxruntime_EXTERNAL_LIBRARIES} )
@@ -1988,4 +1989,34 @@ if (onnxruntime_USE_WEBGPU AND WIN32 AND onnxruntime_BUILD_SHARED_LIB AND NOT CM
19881989 )
19891990endif ()
19901991
1992+ # onnxruntime_ep_graph_test tests the implementation of the public OrtGraph APIs for use in plugin EPs (OrtEp).
1993+ if (onnxruntime_BUILD_SHARED_LIB AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND NOT onnxruntime_MINIMAL_BUILD)
1994+ file (GLOB_RECURSE onnxruntime_ep_graph_test_SRC "${ONNXRUNTIME_EP_GRAPH_TEST_SRC_DIR} /*.h"
1995+ "${ONNXRUNTIME_EP_GRAPH_TEST_SRC_DIR} /*.cc" )
1996+
1997+ set (onnxruntime_ep_graph_test_LIBS ${ONNXRUNTIME_TEST_LIBS} onnxruntime_test_utils ${onnxruntime_EXTERNAL_LIBRARIES} )
1998+ if (CMAKE_SYSTEM_NAME MATCHES "AIX" )
1999+ list (APPEND onnxruntime_ep_graph_test_LIBS onnxruntime_session onnxruntime_util onnxruntime_lora onnxruntime_framework
2000+ onnxruntime_common onnxruntime_graph onnxruntime_providers onnxruntime_mlas
2001+ onnxruntime_optimizer onnxruntime_flatbuffers iconv re2
2002+ ${PROTOBUF_LIB} onnx onnx_proto)
2003+ endif ()
2004+
2005+ if (NOT WIN32 )
2006+ list (APPEND onnxruntime_ep_graph_test_LIBS ${CMAKE_DL_LIBS} )
2007+ endif ()
2008+
2009+ if (onnxruntime_USE_TENSORRT OR onnxruntime_USE_NV)
2010+ # Need this because unittest_main_src defines a global nvinfer1::IBuilder variable.
2011+ list (APPEND onnxruntime_ep_graph_test_LIBS ${TENSORRT_LIBRARY_INFER} )
2012+ endif ()
2013+
2014+ AddTest(DYN
2015+ TARGET onnxruntime_ep_graph_test
2016+ SOURCES ${onnxruntime_ep_graph_test_SRC} ${onnxruntime_unittest_main_src}
2017+ LIBS ${onnxruntime_ep_graph_test_LIBS}
2018+ DEPENDS ${all_dependencies}
2019+ )
2020+ endif ()
2021+
19912022include (onnxruntime_fuzz_test.cmake)
0 commit comments