mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 15:01:40 +00:00
[test-android] Tests are now runnable as ./gradlew connectedCheck
This commit is contained in:
parent
f176cd8e7b
commit
7dd8f0118c
4 changed files with 19 additions and 22 deletions
|
@ -2,6 +2,7 @@ package org.fluidsynth.fluidsynth_tests
|
|||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import org.fluidsynth.fluidsynthtests.TestRunner
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
@ -20,5 +21,7 @@ class ExampleInstrumentedTest {
|
|||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("org.fluidsynth.fluidsynth_tests", appContext.packageName)
|
||||
|
||||
TestRunner.runTests()
|
||||
}
|
||||
}
|
|
@ -1,14 +1,9 @@
|
|||
#include <jni.h>
|
||||
#include <string>
|
||||
#include <jni.h>
|
||||
|
||||
extern "C" int run_all_fluidsynth_tests();
|
||||
|
||||
extern "C" JNIEXPORT jstring JNICALL
|
||||
Java_org_fluidsynth_fluidsynthtests_MainActivity_stringFromJNI(
|
||||
JNIEnv* env,
|
||||
jobject /* this */) {
|
||||
extern "C" JNIEXPORT void JNICALL Java_org_fluidsynth_fluidsynthtests_TestRunner_00024Companion_runTests(JNIEnv* env, jobject thiz) {
|
||||
run_all_fluidsynth_tests();
|
||||
|
||||
std::string hello = "Hello from C++";
|
||||
return env->NewStringUTF(hello.c_str());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,20 +14,9 @@ class MainActivity : AppCompatActivity() {
|
|||
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
TestRunner.runTests()
|
||||
|
||||
// Example of a call to a native method
|
||||
binding.sampleText.text = stringFromJNI()
|
||||
}
|
||||
|
||||
/**
|
||||
* A native method that is implemented by the 'native-lib' native library,
|
||||
* which is packaged with this application.
|
||||
*/
|
||||
external fun stringFromJNI(): String
|
||||
|
||||
companion object {
|
||||
// Used to load the 'native-lib' library on application startup.
|
||||
init {
|
||||
System.loadLibrary("native-lib")
|
||||
}
|
||||
binding.sampleText.text = "If this shows up then there was no reported test failure!"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package org.fluidsynth.fluidsynthtests
|
||||
|
||||
class TestRunner {
|
||||
companion object {
|
||||
external fun runTests()
|
||||
init {
|
||||
System.loadLibrary("native-lib")
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue