From f16dd00f05e47f7ecf2024c7ade543e924d69aa7 Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Wed, 6 Nov 2024 11:26:51 +0000 Subject: [PATCH] exprtk: simplify test package (#25856) --- .../exprtk/all/test_package/test_package.cpp | 75 +------------------ .../exprtk/all/test_v1_package/CMakeLists.txt | 8 -- .../exprtk/all/test_v1_package/conanfile.py | 18 ----- 3 files changed, 3 insertions(+), 98 deletions(-) delete mode 100644 recipes/exprtk/all/test_v1_package/CMakeLists.txt delete mode 100644 recipes/exprtk/all/test_v1_package/conanfile.py diff --git a/recipes/exprtk/all/test_package/test_package.cpp b/recipes/exprtk/all/test_package/test_package.cpp index 8ae4a2288e7ce..f668e5bbe9c03 100755 --- a/recipes/exprtk/all/test_package/test_package.cpp +++ b/recipes/exprtk/all/test_package/test_package.cpp @@ -1,78 +1,9 @@ -/* - ************************************************************** - * C++ Mathematical Expression Toolkit Library * - * * - * Exprtk Test Package * - * Author: Arash Partow (1999-2022) * - * URL: https://www.partow.net/programming/exprtk/index.html * - * * - * Copyright notice: * - * Free use of the Mathematical Expression Toolkit Library is * - * permitted under the guidelines and in accordance with the * - * most current version of the MIT License. * - * http://www.opensource.org/licenses/MIT * - * * - ************************************************************** -*/ - - -#include -#include - #include - - -template -void test_function() -{ - typedef exprtk::symbol_table symbol_table_t; - typedef exprtk::expression expression_t; - typedef exprtk::parser parser_t; - typedef exprtk::parser_error::type error_t; - - symbol_table_t symbol_table; - expression_t expression; - parser_t parser; - - T x = 1; - T y = 2; - - const std::string expression_string = "x * y + 3"; - - symbol_table.add_variable("x",x); - symbol_table.add_variable("y",y); - - expression.register_symbol_table(symbol_table); - - if (!parser.compile(expression_string,expression)) - { - printf("Error: %s\tExpression: %s\n", - parser.error().c_str(), - expression_string.c_str()); - - for (std::size_t i = 0; i < parser.error_count(); ++i) - { - const error_t error = parser.get_error(i); - - printf("Error: %02d Position: %02d " - "Type: [%s] " - "Message: %s " - "Expression: %s\n", - static_cast(i), - static_cast(error.token.position), - exprtk::parser_error::to_str(error.mode).c_str(), - error.diagnostic.c_str(), - expression_string.c_str()); - } - - return; - } - - expression.value(); -} +#include int main() { - test_function(); + std::cout << exprtk::information::library << std::endl; + std::cout << "Test package successful\n"; return 0; } diff --git a/recipes/exprtk/all/test_v1_package/CMakeLists.txt b/recipes/exprtk/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/exprtk/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/exprtk/all/test_v1_package/conanfile.py b/recipes/exprtk/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/exprtk/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -import os - - -class TestPackageV1Conan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True)