From 4c65791784813d00cb976da9ad7b4215f0ad03db Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 23 Mar 2026 22:59:53 +0100 Subject: [CHORE] Cleanup examples and tests directories. Signed-off-by: Amlal El Mahrouss --- example/allocator_op_example/CMakeLists.txt | 4 ++++ example/asio_example/CMakeLists.txt | 4 ++++ example/asio_example_2/CMakeLists.txt | 5 ++++- example/asio_example_2/example.cpp | 1 - test/Jamfile.v2 | 19 ------------------- test/allocator_op.test.cpp | 25 ------------------------- test/option.test.cpp | 25 ------------------------- test/standard_tests/Jamfile.v2 | 19 +++++++++++++++++++ test/standard_tests/allocator_op.test.cpp | 25 +++++++++++++++++++++++++ test/standard_tests/option.test.cpp | 25 +++++++++++++++++++++++++ 10 files changed, 81 insertions(+), 71 deletions(-) delete mode 100644 test/Jamfile.v2 delete mode 100644 test/allocator_op.test.cpp delete mode 100644 test/option.test.cpp create mode 100644 test/standard_tests/Jamfile.v2 create mode 100644 test/standard_tests/allocator_op.test.cpp create mode 100644 test/standard_tests/option.test.cpp diff --git a/example/allocator_op_example/CMakeLists.txt b/example/allocator_op_example/CMakeLists.txt index 544ee2f..c546575 100644 --- a/example/allocator_op_example/CMakeLists.txt +++ b/example/allocator_op_example/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +# Official repository: https://git.ocl.nekernel.org/core cmake_minimum_required(VERSION 3.15...3.31) diff --git a/example/asio_example/CMakeLists.txt b/example/asio_example/CMakeLists.txt index 64494b9..2e1113b 100644 --- a/example/asio_example/CMakeLists.txt +++ b/example/asio_example/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +# Official repository: https://git.ocl.nekernel.org/core cmake_minimum_required(VERSION 3.15...3.31) diff --git a/example/asio_example_2/CMakeLists.txt b/example/asio_example_2/CMakeLists.txt index a26fbfc..09025b5 100644 --- a/example/asio_example_2/CMakeLists.txt +++ b/example/asio_example_2/CMakeLists.txt @@ -1,4 +1,7 @@ -# (C) 2026 Amlal El Mahrouss +# Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +# Official repository: https://git.ocl.nekernel.org/core cmake_minimum_required(VERSION 3.15...3.31) diff --git a/example/asio_example_2/example.cpp b/example/asio_example_2/example.cpp index 42410d7..951d222 100644 --- a/example/asio_example_2/example.cpp +++ b/example/asio_example_2/example.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include namespace asio = ::boost::asio; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 deleted file mode 100644 index bf37293..0000000 --- a/test/Jamfile.v2 +++ /dev/null @@ -1,19 +0,0 @@ -# -# File: Jamfile.v2 -# Author: Amlal El Mahrouss, -# Copyright 2025, Amlal El Mahrouss, Licensed under the Boost Software License -# - -project tests -: default-build debug -; - -exe option.test.o - : option.test.cpp - : 20 ; - -exe allocator_op.test.o - : allocator_op.test.cpp - : 20 ; - - diff --git a/test/allocator_op.test.cpp b/test/allocator_op.test.cpp deleted file mode 100644 index 0982dcd..0000000 --- a/test/allocator_op.test.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: BSL-1.0 -// Copyright 2025-2026, Amlal El Mahrouss (amlal@nekernel.org) -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// Official repository: https://github.com/ocl-foss-org/core - -/// @author Amlal El Mahrouss - -#include - -#define BOOST_TEST_MODULE allocator_op -#include - -BOOST_AUTO_TEST_CASE(allocator_should_succeed) -{ - auto ptr = ocl::allocator{}.construct_array<10>(); - int* arr = ptr.get(); - BOOST_TEST(arr != nullptr); - - for (auto i{0ul}; i < 10; ++i) - { - *(arr + i) = 10; - BOOST_TEST(*(arr + i) == 10); - } -} diff --git a/test/option.test.cpp b/test/option.test.cpp deleted file mode 100644 index 18e8cbb..0000000 --- a/test/option.test.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: BSL-1.0 -// Copyright 2025-2026, Amlal El Mahrouss (amlal@nekernel.org) -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// Official repository: https://github.com/ocl-foss-org/core - -/// @brief Checks if the test fails with the expected value. -/// @author Amlal El Mahrouss - -#include - -#define BOOST_TEST_MODULE option -#include - -BOOST_AUTO_TEST_CASE(option_should_fail) -{ - ocl::option opt(ocl::eval_false()); - BOOST_CHECK_THROW(opt.expect(""), std::exception); -} - -BOOST_AUTO_TEST_CASE(option_should_succeed) -{ - ocl::option opt(ocl::eval_true()); - BOOST_CHECK_NO_THROW(opt.expect("")); -} diff --git a/test/standard_tests/Jamfile.v2 b/test/standard_tests/Jamfile.v2 new file mode 100644 index 0000000..bf37293 --- /dev/null +++ b/test/standard_tests/Jamfile.v2 @@ -0,0 +1,19 @@ +# +# File: Jamfile.v2 +# Author: Amlal El Mahrouss, +# Copyright 2025, Amlal El Mahrouss, Licensed under the Boost Software License +# + +project tests +: default-build debug +; + +exe option.test.o + : option.test.cpp + : 20 ; + +exe allocator_op.test.o + : allocator_op.test.cpp + : 20 ; + + diff --git a/test/standard_tests/allocator_op.test.cpp b/test/standard_tests/allocator_op.test.cpp new file mode 100644 index 0000000..0982dcd --- /dev/null +++ b/test/standard_tests/allocator_op.test.cpp @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: BSL-1.0 +// Copyright 2025-2026, Amlal El Mahrouss (amlal@nekernel.org) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// Official repository: https://github.com/ocl-foss-org/core + +/// @author Amlal El Mahrouss + +#include + +#define BOOST_TEST_MODULE allocator_op +#include + +BOOST_AUTO_TEST_CASE(allocator_should_succeed) +{ + auto ptr = ocl::allocator{}.construct_array<10>(); + int* arr = ptr.get(); + BOOST_TEST(arr != nullptr); + + for (auto i{0ul}; i < 10; ++i) + { + *(arr + i) = 10; + BOOST_TEST(*(arr + i) == 10); + } +} diff --git a/test/standard_tests/option.test.cpp b/test/standard_tests/option.test.cpp new file mode 100644 index 0000000..18e8cbb --- /dev/null +++ b/test/standard_tests/option.test.cpp @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: BSL-1.0 +// Copyright 2025-2026, Amlal El Mahrouss (amlal@nekernel.org) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// Official repository: https://github.com/ocl-foss-org/core + +/// @brief Checks if the test fails with the expected value. +/// @author Amlal El Mahrouss + +#include + +#define BOOST_TEST_MODULE option +#include + +BOOST_AUTO_TEST_CASE(option_should_fail) +{ + ocl::option opt(ocl::eval_false()); + BOOST_CHECK_THROW(opt.expect(""), std::exception); +} + +BOOST_AUTO_TEST_CASE(option_should_succeed) +{ + ocl::option opt(ocl::eval_true()); + BOOST_CHECK_NO_THROW(opt.expect("")); +} -- cgit v1.2.3