From ca26e1a0e3390fed7e7788c57b3df8c74b724e97 Mon Sep 17 00:00:00 2001 From: Mateusz Pietryga Date: Thu, 9 Nov 2023 23:16:09 +0100 Subject: [PATCH] Make sure tests are executed against newly compiled native binaries --- CMakeLists.txt | 1 + src/test/java/jssc/SerialNativeInterfaceTest.java | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce202316f..b2f637786 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,6 +194,7 @@ endif() # Copy native library back to source tree add_custom_command(TARGET jssc POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/natives/ ${CMAKE_CURRENT_SOURCE_DIR}/src/main/resources-precompiled/natives/ + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/natives/ ${CMAKE_CURRENT_SOURCE_DIR}/src/test/resources/natives/ ) # Handle compiler warnings diff --git a/src/test/java/jssc/SerialNativeInterfaceTest.java b/src/test/java/jssc/SerialNativeInterfaceTest.java index bffbe094f..c6ecb6b0d 100644 --- a/src/test/java/jssc/SerialNativeInterfaceTest.java +++ b/src/test/java/jssc/SerialNativeInterfaceTest.java @@ -41,15 +41,10 @@ public void testPrintVersion() { } - @Before - public void runNext() { - // Skip in CI - Assume.assumeTrue(System.getenv("CI") == null); - // Skip on Windows - Assume.assumeFalse(SerialNativeInterface.getOsType() == SerialNativeInterface.OS_WINDOWS); - } @Test(expected = java.io.IOException.class) public void reportsWriteErrorsAsIOException() throws Exception { + Assume.assumeFalse(SerialNativeInterface.getOsType() == SerialNativeInterface.OS_WINDOWS); + long fd = -1; /*bad file by intent*/ byte[] buf = new byte[]{ 0x6A, 0x73, 0x73, 0x63, 0x0A }; SerialNativeInterface testTarget = new SerialNativeInterface();