JNI for test coverage #3965

This commit is contained in:
rusefillc 2022-02-26 12:51:50 -05:00
parent fe6aca79b2
commit abca5dca2f
4 changed files with 25 additions and 0 deletions

View File

@ -88,6 +88,10 @@
</javac>
</target>
<target name="native_header">
<javah classpath="io/src/main/java" destdir="../unit_tests/native" class="com.rusefi.native_.EngineLogic"/>
</target>
<target name="test" depends="compile, copy_c_sources">
<junit fork="no"
maxmemory="512m"

View File

@ -0,0 +1,10 @@
package com.rusefi.native_;
/**
* Native interface allowing java to invoke rusEFI unit_tests library
*/
public class EngineLogic {
public native String getVersion();
public native void setSensor(String sensorTypeName, double value);
}

View File

@ -31,6 +31,7 @@ CPPSRC += $(ALLCPPSRC) \
$(PROJECT_DIR)/console/binary_log/log_field.cpp \
$(PROJECT_DIR)/config/boards/hellen/hellen_board_id.cpp \
$(PROJECT_DIR)/../unit_tests/logicdata.cpp \
$(PROJECT_DIR)/../unit_tests/native/native_impl.cpp \
$(PROJECT_DIR)/../unit_tests/main.cpp \
$(PROJECT_DIR)/../unit_tests/global_mocks.cpp \
$(PROJECT_DIR)/../unit_tests/mocks.cpp \

View File

@ -0,0 +1,10 @@
/*
* native_impl.cpp
*
* @date Feb 26, 2022
* @author Andrey Belomutskiy, (c) 2012-2022
*/