Skip to content

Commit

Permalink
Make sure tests are executed against newly compiled native binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
pietrygamat committed Nov 9, 2023
1 parent 1b619ca commit ca26e1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions src/test/java/jssc/SerialNativeInterfaceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ca26e1a

Please sign in to comment.