From 0aaf65ac088cfc018688479d43ac38eaa0f245d7 Mon Sep 17 00:00:00 2001 From: Otto Link Date: Mon, 19 Aug 2024 18:14:36 +0200 Subject: [PATCH] Remove test folder and its content, clean-up cmake file (#192) --- CMakeLists.txt | 6 -- tests/CMakeLists.txt | 2 - tests/parameter_influence/CMakeLists.txt | 2 - tests/parameter_influence/main.cpp | 72 ------------------------ tests/sandbox/CMakeLists.txt | 2 - tests/sandbox/main.cpp | 15 ----- 6 files changed, 99 deletions(-) delete mode 100644 tests/CMakeLists.txt delete mode 100644 tests/parameter_influence/CMakeLists.txt delete mode 100644 tests/parameter_influence/main.cpp delete mode 100644 tests/sandbox/CMakeLists.txt delete mode 100644 tests/sandbox/main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 248d0e83..00ccd0bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,10 +3,8 @@ cmake_minimum_required(VERSION 3.22) project(highmap-root) option(HIGHMAP_ENABLE_OPENCL "" OFF) -option(HIGHMAP_ENABLE_OPENCV "" ON) option(HIGHMAP_ENABLE_DOCS "" ON) option(HIGHMAP_ENABLE_EXAMPLES "" ON) -option(HIGHMAP_ENABLE_TESTS "" ON) set(CMAKE_CXX_STANDARD 20) @@ -60,7 +58,3 @@ if(HIGHMAP_ENABLE_EXAMPLES) endif(HIGHMAP_ENABLE_OPENCL) add_subdirectory(${PROJECT_SOURCE_DIR}/examples) endif(HIGHMAP_ENABLE_EXAMPLES) - -if(HIGHMAP_ENABLE_TESTS) - add_subdirectory(${PROJECT_SOURCE_DIR}/tests) -endif(HIGHMAP_ENABLE_TESTS) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt deleted file mode 100644 index ebdcb74d..00000000 --- a/tests/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(${PROJECT_SOURCE_DIR}/tests/parameter_influence) -add_subdirectory(${PROJECT_SOURCE_DIR}/tests/sandbox) diff --git a/tests/parameter_influence/CMakeLists.txt b/tests/parameter_influence/CMakeLists.txt deleted file mode 100644 index 8b89b82e..00000000 --- a/tests/parameter_influence/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_executable(parameter_influence main.cpp) -target_link_libraries(parameter_influence highmap) diff --git a/tests/parameter_influence/main.cpp b/tests/parameter_influence/main.cpp deleted file mode 100644 index be93b37b..00000000 --- a/tests/parameter_influence/main.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include -#include -#include - -#include "highmap.hpp" - -template -void show_influence(std::string label, - hmap::Array &x, - std::vector params, - std::function unary_op) -{ - hmap::Array x_bckp = x; // bckp - - std::cout << "label: " << label.c_str() << "\n"; - for (auto &v : params) - { - std::cout << "- parameter value: " << v << "\n"; - hmap::Array x_tmp = x_bckp; - unary_op(x_tmp, v); - x_tmp.to_png(label + "-" + std::to_string(v) + ".png", hmap::Cmap::MAGMA); - } -} - -int main(void) -{ - const hmap::Vec2 shape = {512, 512}; - const hmap::Vec2 res = {4.f, 4.f}; - int seed = 1; - - hmap::Array z = hmap::noise(hmap::NoiseType::PERLIN, shape, res, seed); - hmap::remap(z); - - show_influence("gain-gain", - z, - {1.f, 2.f, 4.f, 8.f, 16.f}, - [](hmap::Array &x, float gain) - { return hmap::gain(x, gain); }); - - show_influence("gamma_correction-gamma", - z, - {0.1f, 0.5f, 1.f, 2.f, 4.f}, - [](hmap::Array &x, float gamma) - { return hmap::gamma_correction(x, gamma); }); - - show_influence( - "gamma_correction_local-gamma", - z, - {0.1f, 0.5f, 1.f, 2.f, 4.f}, - [](hmap::Array &x, float gamma) - { return hmap::gamma_correction_local(x, gamma, 16, 0.f); }); - - show_influence("gamma_correction_local-ir", - z, - {4, 8, 16, 32, 64}, - [](hmap::Array &x, int ir) { - return hmap::gamma_correction_local(x, 2.f, ir, 0.f); - }); - - show_influence("gamma_correction_local-k", - z, - {0.f, 0.1f, 0.2f, 0.4f, 0.8f}, - [](hmap::Array &x, float k) { - return hmap::gamma_correction_local(x, 2.f, 16, k); - }); - - show_influence("expand-ir", - z, - {8, 16, 32, 64, 128}, - [](hmap::Array &x, int ir) - { return hmap::expand(x, ir); }); -} diff --git a/tests/sandbox/CMakeLists.txt b/tests/sandbox/CMakeLists.txt deleted file mode 100644 index fa2d6f21..00000000 --- a/tests/sandbox/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_executable(sandbox main.cpp) -target_link_libraries(sandbox highmap) diff --git a/tests/sandbox/main.cpp b/tests/sandbox/main.cpp deleted file mode 100644 index 3dc333db..00000000 --- a/tests/sandbox/main.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "highmap.hpp" -#include "highmap/dbg/timer.hpp" - -int main(void) -{ - const hmap::Vec2 shape = {512, 512}; - const hmap::Vec2 res = {4.f, 4.f}; - int seed = 2; - - hmap::Timer::Start("fbm_perlin"); - hmap::Array z = hmap::noise(hmap::NoiseType::PERLIN, shape, res, seed); - hmap::Timer::Stop("fbm_perlin"); - - z.to_png("out.png", hmap::Cmap::INFERNO); -}