1
0
mirror of https://github.com/irmen/ksim65.git synced 2024-06-26 02:29:38 +00:00

optimized gradle and tests

This commit is contained in:
Irmen de Jong 2019-10-12 14:56:04 +02:00
parent 6c9fe7a26a
commit 9e8cde1056
4 changed files with 26 additions and 29 deletions

View File

@ -9,8 +9,8 @@ plugins {
kotlin("jvm") version "1.3.50"
`maven-publish`
application
id("org.jetbrains.dokka") version "0.9.18"
id("com.jfrog.bintray") version "1.7.3"
id("org.jetbrains.dokka") version "0.10.0"
id("com.jfrog.bintray") version "1.8.4"
}
allprojects {
@ -39,8 +39,8 @@ dependencies {
// Use the Kotlin JUnit5 integration.
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.1.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.1.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.4.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.4.0")
subprojects.forEach {
archives(it)
@ -49,11 +49,8 @@ dependencies {
tasks {
named<Test>("test") {
// Enable JUnit 5 (Gradle 4.6+).
useJUnitPlatform()
// Always run tests, even when nothing changed.
dependsOn("cleanTest")
// Show test results.
testLogging.events("failed")
// parallel tests.
@ -69,7 +66,9 @@ tasks {
named<DokkaTask>("dokka") {
outputFormat = "html"
outputDirectory = "$buildDir/kdoc"
skipEmptyPackages = true
configuration {
skipEmptyPackages = true
}
}
}

View File

@ -17,20 +17,6 @@ abstract class FunctionalTestsBase {
cpu.addBreakpoint(0xffe4) { cpu, pc -> kernalStubs.handleBreakpoint(cpu, pc) }
cpu.addBreakpoint(0xe16f) { cpu, pc -> kernalStubs.handleBreakpoint(cpu, pc) }
// create the system bus and add device to it.
// note that the order is relevant w.r.t. where reads and writes are going.
ram[0x02] = 0
ram[0xa002] = 0
ram[0xa003] = 0x80
ram[Cpu6502.IRQ_vector] = 0x48
ram[Cpu6502.IRQ_vector + 1] = 0xff
ram[Cpu6502.RESET_vector] = 0x01
ram[Cpu6502.RESET_vector + 1] = 0x08
ram[0x01fe] = 0xff
ram[0x01ff] = 0x7f
ram[0x8000] = 2
ram[0xa474] = 2
// setup the irq/brk routine
for(b in listOf(0x48, 0x8A, 0x48, 0x98, 0x48, 0xBA, 0xBD, 0x04,
0x01, 0x29, 0x10, 0xF0, 0x03, 0x6C, 0x16, 0x03,
@ -43,6 +29,17 @@ abstract class FunctionalTestsBase {
protected fun runTest(testprogram: String) {
ram.loadPrg("src/test/kotlin/6502testsuite/$testprogram", null)
ram[0x02] = 0
ram[0xa002] = 0
ram[0xa003] = 0x80
ram[Cpu6502.IRQ_vector] = 0x48
ram[Cpu6502.IRQ_vector + 1] = 0xff
ram[Cpu6502.RESET_vector] = 0x01
ram[Cpu6502.RESET_vector + 1] = 0x08
ram[0x01fe] = 0xff
ram[0x01ff] = 0x7f
ram[0x8000] = 2
ram[0xa474] = 2
bus.reset()
cpu.regSP = 0xfd
cpu.regP.fromInt(0b00100100)

View File

@ -1,10 +1,10 @@
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.TestInstance
import org.junit.jupiter.api.parallel.Execution
import org.junit.jupiter.api.parallel.ExecutionMode
import kotlin.test.*
@TestInstance(TestInstance.Lifecycle.PER_METHOD)
@Disabled("this test suite takes a long time to complete")
@Execution(ExecutionMode.CONCURRENT)
@Disabled("this test suite is quite intensive and for regular test runs, the other tests are sufficient")
class Test6502TestSuitePart1: FunctionalTestsBase() {
@Test

View File

@ -1,10 +1,11 @@
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.TestInstance
import org.junit.jupiter.api.parallel.Execution
import org.junit.jupiter.api.parallel.ExecutionMode
import kotlin.test.*
@TestInstance(TestInstance.Lifecycle.PER_METHOD)
@Disabled("this test suite takes a long time to complete")
@Execution(ExecutionMode.CONCURRENT)
@Disabled("this test suite is quite intensive and for regular test runs, the other tests are sufficient")
class Test6502TestSuitePart2: FunctionalTestsBase() {
@Test