Skip to content

Commit d0b751e

Browse files
feat(jni): add non android tests
tests checks for now that usage on non andorid device is safe. Does now work in terms of communication with android, but is valid and doesn't crash.
1 parent 40f6e11 commit d0b751e

File tree

6 files changed

+571
-2
lines changed

6 files changed

+571
-2
lines changed

rules.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,3 +518,20 @@ features:
518518
target: "Public/{{Camel .Module.Name}}/Generated/Jni/{{Camel .Module.Name}}{{Camel .Interface.Name}}JniClient.h"
519519
- source: "module/Source/modulejni/Private/Generated/jni/jniclient.cpp.tpl"
520520
target: "Private/Generated/Jni/{{Camel .Module.Name}}{{Camel .Interface.Name}}JniClient.cpp"
521+
- name: jni_tests
522+
requires:
523+
- jni
524+
- stubs
525+
scopes:
526+
- match: interface
527+
prefix: "Plugins/{{Camel .Module.Name}}/Source/{{Camel .Module.Name}}Jni/"
528+
documents:
529+
- source: "module/Source/modulejni/Private/Tests/jni.spec.cpp.tpl"
530+
target: "Private/Tests/{{Camel .Module.Name}}{{Camel .Interface.Name}}Jni.spec.cpp"
531+
preserve: true
532+
- source: "module/Source/modulejni/Private/Tests/jnifixture.h.tpl"
533+
target: "Private/Tests/{{Camel .Module.Name}}{{Camel .Interface.Name}}JniFixture.h"
534+
preserve: true
535+
- source: "module/Source/modulejni/Private/Tests/jnifixture.cpp.tpl"
536+
target: "Private/Tests/{{Camel .Module.Name}}{{Camel .Interface.Name}}JniFixture.cpp"
537+
preserve: true

templates/buildTestPlugins.bat.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
7474
{{ end }}
7575

7676
@REM run build and tests
77-
call :buildTestPlugins "%ProjectTarget_path%/TP_Blank.uproject" %script_path% ".Impl.{{ if .Features.olink -}}+.OLink.{{ end }}{{ if .Features.msgbus_tests -}}+.MsgBus.{{ end }}"
77+
call :buildTestPlugins "%ProjectTarget_path%/TP_Blank.uproject" %script_path% ".Impl.{{ if .Features.olink -}}+.OLink.{{ end }}{{ if .Features.msgbus_tests -}}+.MsgBus.{{ end }}{{ if .Features.jni_tests -}}+.Jni.{{ end }}"
7878
exit /b 0
7979

8080
@REM function implementations

templates/buildTestPlugins.sh.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@ mkdir -p "$ProjectTarget_path/Plugins/{{Camel .Name}}" && cp -rf "$script_path/P
7575
if [ $? -ne 0 ]; then exit 1; fi;
7676
{{ end }}
7777

78-
buildTestPlugins "$ProjectTarget_path/TP_Blank.uproject" "$script_path" ".Impl.{{ if .Features.olink -}}+.OLink.{{ end }}{{ if .Features.msgbus_tests -}}+.MsgBus.{{ end }}"
78+
buildTestPlugins "$ProjectTarget_path/TP_Blank.uproject" "$script_path" ".Impl.{{ if .Features.olink -}}+.OLink.{{ end }}{{ if .Features.msgbus_tests -}}+.MsgBus.{{ end }}{{ if .Features.jni_tests -}}+.Jni.{{ end }}"
7979
if [ $buildresult -ne 0 ]; then exit 1; fi;

0 commit comments

Comments
 (0)