aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/scripts/test_ports/vcpkg-ci-ryu
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/scripts/test_ports/vcpkg-ci-ryu')
-rw-r--r--vcpkg/scripts/test_ports/vcpkg-ci-ryu/CMakeLists.txt6
-rw-r--r--vcpkg/scripts/test_ports/vcpkg-ci-ryu/portfile.cmake9
-rw-r--r--vcpkg/scripts/test_ports/vcpkg-ci-ryu/test.c21
-rw-r--r--vcpkg/scripts/test_ports/vcpkg-ci-ryu/vcpkg.json11
4 files changed, 47 insertions, 0 deletions
diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-ryu/CMakeLists.txt b/vcpkg/scripts/test_ports/vcpkg-ci-ryu/CMakeLists.txt
new file mode 100644
index 0000000..c69040d
--- /dev/null
+++ b/vcpkg/scripts/test_ports/vcpkg-ci-ryu/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.30)
+project(vcpkg-ci-ryu LANGUAGES C)
+find_package(ryu CONFIG REQUIRED)
+add_executable(test test.c)
+target_link_libraries(test PUBLIC RYU::ryu RYU::ryu_printf)
+install(TARGETS test RUNTIME DESTINATION bin/vcpkg-ci-ryu) \ No newline at end of file
diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-ryu/portfile.cmake b/vcpkg/scripts/test_ports/vcpkg-ci-ryu/portfile.cmake
new file mode 100644
index 0000000..a5327e0
--- /dev/null
+++ b/vcpkg/scripts/test_ports/vcpkg-ci-ryu/portfile.cmake
@@ -0,0 +1,9 @@
+set(VCPKG_POLICY_SKIP_ALL_POST_BUILD_CHECKS enabled)
+vcpkg_cmake_configure(SOURCE_PATH "${CURRENT_PORT_DIR}")
+vcpkg_cmake_install()
+if(NOT VCPKG_CROSSCOMPILING)
+ vcpkg_execute_required_process(COMMAND "${CURRENT_PACKAGES_DIR}/bin/vcpkg-ci-ryu/test" WORKING_DIRECTORY "." LOGNAME release-test)
+ if(NOT VCPKG_BUILD_TYPE)
+ vcpkg_execute_required_process(COMMAND "${CURRENT_PACKAGES_DIR}/debug/bin/vcpkg-ci-ryu/test" WORKING_DIRECTORY "." LOGNAME debug-test)
+ endif()
+endif()
diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-ryu/test.c b/vcpkg/scripts/test_ports/vcpkg-ci-ryu/test.c
new file mode 100644
index 0000000..b5fbd1f
--- /dev/null
+++ b/vcpkg/scripts/test_ports/vcpkg-ci-ryu/test.c
@@ -0,0 +1,21 @@
+#include <string.h>
+#include <stdio.h>
+
+#include <ryu/ryu.h>
+#include <ryu/ryu2.h>
+
+int main() {
+ char* result = d2s(3.14);
+ if (strcmp(result, "3.14E0") != 0) {
+ printf("Unexpected ryu: %s\n", result);
+ return 1;
+ }
+
+ result = d2fixed(3.14159, 1);
+ if (strcmp(result, "3.1") != 0) {
+ printf("Unexpected ryu_printf: %s\n", result);
+ return 2;
+ }
+
+ return 0;
+}
diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-ryu/vcpkg.json b/vcpkg/scripts/test_ports/vcpkg-ci-ryu/vcpkg.json
new file mode 100644
index 0000000..4a937cd
--- /dev/null
+++ b/vcpkg/scripts/test_ports/vcpkg-ci-ryu/vcpkg.json
@@ -0,0 +1,11 @@
+{
+ "name": "vcpkg-ci-ryu",
+ "version-date": "2024-12-17",
+ "dependencies": [
+ "ryu",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ]
+}