From 8fc58e0bcf36b1a4bda20531268c339f6a9c53a7 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Wed, 22 Feb 2023 18:41:45 -0500 Subject: [PATCH] Start work on c++ test data generator --- .gitignore | 1 + test-data/generator/CMakeLists.txt | 17 +++++++++++++++++ test-data/generator/Dockerfile | 10 ++++++++++ test-data/generator/generate.cpp | 19 +++++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 test-data/generator/CMakeLists.txt create mode 100644 test-data/generator/Dockerfile create mode 100644 test-data/generator/generate.cpp diff --git a/.gitignore b/.gitignore index eaf6216..d32d3f8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /docs/venv **/.ipynb_checkpoints /target +/test-data/generator/build/ diff --git a/test-data/generator/CMakeLists.txt b/test-data/generator/CMakeLists.txt new file mode 100644 index 0000000..ccd223a --- /dev/null +++ b/test-data/generator/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.10) + +project(my_project) + +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +# Abseil requires C++14 +set(CMAKE_CXX_STANDARD 14) + +# Process Abseil's CMake build system +add_subdirectory(/Source/abseil-cpp /Source/abseil-cpp/build) +add_subdirectory(/Source/s2geometry /Source/s2geometry/build) + +add_executable(generate generate.cpp) + +# Declare dependency on the absl::strings library +target_link_libraries(generate absl::strings s2) diff --git a/test-data/generator/Dockerfile b/test-data/generator/Dockerfile new file mode 100644 index 0000000..d47c4f1 --- /dev/null +++ b/test-data/generator/Dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu:latest +RUN apt-get update +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libgflags-dev libgoogle-glog-dev libgtest-dev libssl-dev cmake git g++ + +RUN mkdir Source + +RUN git clone https://github.com/google/s2geometry.git /Source/s2geometry +RUN git clone https://github.com/abseil/abseil-cpp.git /Source/abseil-cpp + +WORKDIR /Source/src diff --git a/test-data/generator/generate.cpp b/test-data/generator/generate.cpp new file mode 100644 index 0000000..f7bfe4e --- /dev/null +++ b/test-data/generator/generate.cpp @@ -0,0 +1,19 @@ +#include + +#include "s2/s2earth.h" +#include "s2/s1angle.h" + +int main(int argc, char **argv) { + S1Angle lat = S1Angle::Degrees(10.0); + S1Angle lon = S1Angle::Degrees(15.0); + S2LatLng s = S2LatLng(lat, lon); + S2LatLng g = s.Normalized(); + + std::cout << "hi\n"; + + return 0; +} + +S2LatLng randomLatLon() { + +}