Skip to content

Commit 844375f

Browse files
ryanmeiera-maurice
authored andcommitted
Enable Database OSS Tests (Desktop)
Moved files into tests/ folder and added CMakeLists.txt folder. Updated some includes, etc to make the tests run on the OSS build. PiperOrigin-RevId: 259786183
1 parent 52d002a commit 844375f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cmake/test_rules.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ include(CMakeParseArguments)
2323
# Defines a new test executable target with the given target name, sources, and
2424
# dependencies. Implicitly adds DEPENDS on gtest and gtest_main.
2525
function(cc_test name)
26-
set(multi DEPENDS SOURCES)
26+
set(multi DEPENDS SOURCES INCLUDES DEFINES)
2727
# Parse the arguments into cc_test_SOURCES and cc_test_DEPENDS.
2828
cmake_parse_arguments(cc_test "" "" "${multi}" ${ARGN})
2929

@@ -34,10 +34,12 @@ function(cc_test name)
3434
target_include_directories(${name}
3535
PRIVATE
3636
${FIREBASE_SOURCE_DIR}
37+
${cc_test_INCLUDES}
3738
)
3839
target_link_libraries(${name} PRIVATE ${cc_test_DEPENDS})
3940
target_compile_definitions(${name}
4041
PRIVATE
4142
-DINTERNAL_EXPERIMENTAL=1
43+
${cc_test_DEFINES}
4244
)
4345
endfunction()

database/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,8 @@ if(IOS)
219219
# Add a dependency to downloading the headers onto database.
220220
add_dependencies(firebase_database ${pod_target_name})
221221
endif()
222+
223+
if(FIREBASE_CPP_BUILD_TESTS)
224+
# Add the tests subdirectory
225+
add_subdirectory(tests)
226+
endif()

0 commit comments

Comments
 (0)