diff --git a/projects/github.com/libkml/libkml/package.yml b/projects/github.com/libkml/libkml/package.yml new file mode 100644 index 00000000..d5d4b527 --- /dev/null +++ b/projects/github.com/libkml/libkml/package.yml @@ -0,0 +1,40 @@ +distributable: + url: git+https://github.com/libkml/libkml.git + ref: ${{version.tag}} + +versions: + github: libkml/libkml + +dependencies: + zlib.net/minizip: ^1.3 + uriparser.github.io: ^0.9 + curl.se: ^8 + libexpat.github.io: ^2.5 + boost.org: '>=1.81' + +build: + dependencies: + cmake.org: '*' + script: + - cmake -S . -B build $ARGS + - cmake --build build + - cmake --install build + env: + ARGS: + - -DCMAKE_INSTALL_PREFIX={{prefix}} + - -DCMAKE_INSTALL_LIBDIR=lib + - -DCMAKE_BUILD_TYPE=Release + - -DCMAKE_FIND_FRAMEWORK=LAST + - -DCMAKE_VERBOSE_MAKEFILE=ON + - -Wno-dev + - -DBUILD_TESTING=OFF + +test: + dependencies: + google.com/googletest: '*' + freedesktop.org/pkg-config: '*' + script: + - COMPILE_FLAGS=$(pkg-config --cflags --libs libkml gtest) + - c++ test.cpp $COMPILE_FLAGS -std=c++14 -o test + - ./test | grep 'PASSED' + - pkg-config --modversion libkml | grep {{version}} \ No newline at end of file diff --git a/projects/github.com/libkml/libkml/test.cpp b/projects/github.com/libkml/libkml/test.cpp new file mode 100644 index 00000000..ad1e2cd7 --- /dev/null +++ b/projects/github.com/libkml/libkml/test.cpp @@ -0,0 +1,25 @@ +#include "kml/regionator/regionator_qid.h" +#include "gtest/gtest.h" + +namespace kmlregionator { + // This class is the unit test fixture for the KmlHandler class. + class RegionatorQidTest : public testing::Test { + protected: + virtual void SetUp() { + root_ = Qid::CreateRoot(); + } + + Qid root_; + }; + + // This tests the CreateRoot(), depth(), and str() methods of class Qid. + TEST_F(RegionatorQidTest, TestRoot) { + ASSERT_EQ(static_cast(1), root_.depth()); + ASSERT_EQ(string("q0"), root_.str()); + } +} + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file