File tree Expand file tree Collapse file tree 6 files changed +84
-1
lines changed Expand file tree Collapse file tree 6 files changed +84
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ include(BuildUtils)
4343include (ExternalProject)
4444include (FindPackageHandleStandardArgs)
4545include (GNUInstallDirs)
46+ include (FetchContent)
4647
4748set (ICEBERG_API_DIR "${CMAKE_SOURCE_DIR} /api" )
4849set (ICEBERG_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR} " )
Original file line number Diff line number Diff line change @@ -28,13 +28,14 @@ C++ implementation of [Apache Iceberg™](https://iceberg.apache.org/).
2828
2929## Build
3030
31- ### Build and Install Core Libraries
31+ ### Build, Run Test and Install Core Libraries
3232
3333``` bash
3434cd iceberg-cpp
3535mkdir build && cd build
3636cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/iceberg -DICEBERG_BUILD_STATIC=ON -DICEBERG_BUILD_SHARED=ON
3737cmake --build .
38+ ctest --build .
3839cmake --install .
3940```
4041
Original file line number Diff line number Diff line change 1+ # Licensed to the Apache Software Foundation (ASF) under one
2+ # or more contributor license agreements. See the NOTICE file
3+ # distributed with this work for additional information
4+ # regarding copyright ownership. The ASF licenses this file
5+ # to you under the Apache License, Version 2.0 (the
6+ # "License"); you may not use this file except in compliance
7+ # with the License. You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing,
12+ # software distributed under the License is distributed on an
13+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ # KIND, either express or implied. See the License for the
15+ # specific language governing permissions and limitations
16+ # under the License.
17+
18+ find_package (GTest)
19+
20+ if (GTest_FOUND)
21+ return ()
22+ endif ()
23+
24+ fetchcontent_declare(googletest
25+ GIT_REPOSITORY https://github.com/google/googletest.git
26+ GIT_TAG b514bdc898e2951020cbdca1304b75f5950d1f59 # release-1.15.2
27+ )
28+ fetchcontent_makeavailable(googletest)
Original file line number Diff line number Diff line change 1414# KIND, either express or implied. See the License for the
1515# specific language governing permissions and limitations
1616# under the License.
17+
18+ include (FindGTestAlt)
19+
20+ add_subdirectory (core)
Original file line number Diff line number Diff line change 1+ # Licensed to the Apache Software Foundation (ASF) under one
2+ # or more contributor license agreements. See the NOTICE file
3+ # distributed with this work for additional information
4+ # regarding copyright ownership. The ASF licenses this file
5+ # to you under the Apache License, Version 2.0 (the
6+ # "License"); you may not use this file except in compliance
7+ # with the License. You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing,
12+ # software distributed under the License is distributed on an
13+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ # KIND, either express or implied. See the License for the
15+ # specific language governing permissions and limitations
16+ # under the License.
17+
18+ add_executable (core_gtest)
19+ target_sources (core_gtest PRIVATE core_gtest.cc)
20+ target_link_libraries (core_gtest PRIVATE iceberg_core_static GTest::gtest_main)
21+ target_include_directories (core_gtest PRIVATE "${ICEBERG_API_DIR} " )
22+ add_test (NAME core_gtest COMMAND core_gtest)
Original file line number Diff line number Diff line change 1+ /*
2+ * Licensed to the Apache Software Foundation (ASF) under one
3+ * or more contributor license agreements. See the NOTICE file
4+ * distributed with this work for additional information
5+ * regarding copyright ownership. The ASF licenses this file
6+ * to you under the Apache License, Version 2.0 (the
7+ * "License"); you may not use this file except in compliance
8+ * with the License. You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing,
13+ * software distributed under the License is distributed on an
14+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+ * KIND, either express or implied. See the License for the
16+ * specific language governing permissions and limitations
17+ * under the License.
18+ */
19+
20+ #include < gtest/gtest.h>
21+
22+ #include " iceberg/table.h"
23+
24+ TEST (TableTest, TestTableCons) {
25+ auto table = iceberg::Table::create ();
26+ EXPECT_EQ (table->print (), " DemoTable" );
27+ }
You can’t perform that action at this time.
0 commit comments