JNI for test coverage #3965
This commit is contained in:
parent
2955f66f66
commit
6cbb602c08
|
@ -0,0 +1,16 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="JniSandbox" type="Application" factoryName="Application" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.rusefi.native_.JniSandbox" />
|
||||
<module name="io" />
|
||||
<option name="VM_PARAMETERS" value="-Djava.library.path=../unit_tests/build" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.rusefi.native_.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
|
@ -0,0 +1,13 @@
|
|||
package com.rusefi.native_;
|
||||
|
||||
/**
|
||||
* Following VM option is needed to launch:
|
||||
* -Djava.library.path=../unit_tests/build
|
||||
*/
|
||||
public class JniSandbox {
|
||||
public static void main(String[] args) {
|
||||
System.loadLibrary("lib_rusefi_test");
|
||||
EngineLogic engineLogic = new EngineLogic();
|
||||
System.out.println(engineLogic.getVersion());
|
||||
}
|
||||
}
|
|
@ -5,6 +5,13 @@
|
|||
* @author Andrey Belomutskiy, (c) 2012-2022
|
||||
*/
|
||||
|
||||
#include "pch.h"
|
||||
#include "com_rusefi_native__EngineLogic.h"
|
||||
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_com_rusefi_native_1_EngineLogic_getVersion(JNIEnv * env, jobject) {
|
||||
const char msg[60] = "Hello from unit tests";
|
||||
const char* fileName = msg;
|
||||
jstring result = env->NewStringUTF(msg);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue