From bb3b313641272c00b1e46cc848b042363ef2d9c9 Mon Sep 17 00:00:00 2001 From: yamacir-kit Date: Sun, 10 Dec 2023 16:50:06 +0900 Subject: [PATCH] Update to give LD_LIBRARY_PATH when testing example Signed-off-by: yamacir-kit --- README.md | 6 +++--- VERSION | 2 +- example/CMakeLists.txt | 10 +++++++--- example/example.ss | 13 ++++++++----- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0feb4077a..49d55d60d 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Procedures for each standard are provided by the following R7RS-style libraries: cmake -B build -DCMAKE_BUILD_TYPE=Release cd build make package -sudo apt install build/meevax_0.5.100_amd64.deb +sudo apt install build/meevax_0.5.101_amd64.deb ``` or @@ -123,9 +123,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.100.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.5.101.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.100_amd64.deb` +| `package` | Generate debian package `meevax_0.5.101_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index 9217c426b..cb68db49b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.100 +0.5.101 diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 7a01e62b8..89ab24b6b 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -14,9 +14,13 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Meevax::kernel) enable_testing() -add_test(NAME ${PROJECT_NAME} - COMMAND meevax ${PROJECT_NAME}.ss - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +add_test( + NAME ${PROJECT_NAME} + COMMAND meevax ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.ss) + +set_property( + TEST ${PROJECT_NAME} + PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_CURRENT_BINARY_DIR}") add_custom_target(develop COMMAND ${CMAKE_MAKE_PROGRAM} COMMAND ${CMAKE_CTEST_COMMAND}) diff --git a/example/example.ss b/example/example.ss index 863ece4b0..6cabc630b 100644 --- a/example/example.ss +++ b/example/example.ss @@ -4,10 +4,13 @@ (scheme write) (srfi 78)) +(display (get-environment-variable "LD_LIBRARY_PATH")) +(newline) + ; ------------------------------------------------------------------------------ (define dummy-procedure - (procedure "build/libexample.so" 'dummy_procedure)) + (procedure "libexample.so" 'dummy_procedure)) (check (procedure? dummy-procedure) => #t) @@ -16,7 +19,7 @@ ; ------------------------------------------------------------------------------ (define arity - (procedure "build/libexample.so" 'arity)) + (procedure "libexample.so" 'arity)) (check (procedure? arity) => #t) @@ -25,13 +28,13 @@ ; ------------------------------------------------------------------------------ (define make-hoge - (procedure "build/libexample.so" 'make_hoge)) + (procedure "libexample.so" 'make_hoge)) (define hoge? - (procedure "build/libexample.so" 'is_hoge)) + (procedure "libexample.so" 'is_hoge)) (define hoge-value - (procedure "build/libexample.so" 'hoge_value)) + (procedure "libexample.so" 'hoge_value)) (check (procedure? make-hoge) => #t)