mirror of
https://github.com/status-im/status-keycard.git
synced 2025-01-27 05:54:51 +00:00
add support to gradle to run tests on simulator
This commit is contained in:
parent
9003c35fcd
commit
f3f50b2e17
@ -15,12 +15,13 @@ installed on the system. The gradle.properties file must contain the following p
|
||||
* im.status.gradle.gpshell.enc_key = the ENC key for the ISD
|
||||
* im.status.gradle.gpshell.kek_key = the KEK key for the ISD
|
||||
* im.status.gradle.gpshell.kvn = the Key Version Number for the ISD
|
||||
* im.status.wallet.test.simulated = true if the test should run on the simulator, false (or anything else) otherwise
|
||||
|
||||
Testing is done with JUnit and performed either on a real card or on [jCardSim](https://github.com/status-im/jcardsim).
|
||||
Although the tests are comprehensive, debugging on the real card is not easy because raw APDUs are not shown in the test
|
||||
log and there is no way to set breakpoints in the applet.
|
||||
|
||||
In order to test with the simulator, you need to pass these additional parameters to the JVM
|
||||
In order to test with the simulator with an IDE, you need to pass these additional parameters to the JVM
|
||||
|
||||
```-noverify -Dim.status.wallet.test.simulated=true```
|
||||
|
||||
|
13
build.gradle
13
build.gradle
@ -73,10 +73,19 @@ task install(type: Exec) {
|
||||
standardInput new ByteArrayInputStream(gpShellScript.getBytes("UTF-8"))
|
||||
}
|
||||
|
||||
tasks.install.dependsOn(convertJavacard)
|
||||
tasks.test.dependsOn(install)
|
||||
if (project.properties['im.status.wallet.test.simulated'] != 'true') {
|
||||
tasks.install.dependsOn(convertJavacard)
|
||||
tasks.test.dependsOn(install)
|
||||
}
|
||||
|
||||
compileTestJava {
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
if (project.properties['im.status.wallet.test.simulated'] == 'true') {
|
||||
def junitPlatformTestTask = tasks.getByName('junitPlatformTest')
|
||||
junitPlatformTestTask.jvmArgs(['-noverify', '-Dim.status.wallet.test.simulated=true'])
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user