diff --git a/build.gradle.kts b/build.gradle.kts index 26f9ce0..fdd709e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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") { - // 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("dokka") { outputFormat = "html" outputDirectory = "$buildDir/kdoc" - skipEmptyPackages = true + configuration { + skipEmptyPackages = true + } } } diff --git a/src/test/kotlin/FunctionalTestsBase.kt b/src/test/kotlin/FunctionalTestsBase.kt index 0a86d92..ff97e75 100644 --- a/src/test/kotlin/FunctionalTestsBase.kt +++ b/src/test/kotlin/FunctionalTestsBase.kt @@ -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) diff --git a/src/test/kotlin/Test6502TestSuitePart1.kt b/src/test/kotlin/Test6502TestSuitePart1.kt index 024e38a..d54aaae 100644 --- a/src/test/kotlin/Test6502TestSuitePart1.kt +++ b/src/test/kotlin/Test6502TestSuitePart1.kt @@ -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 diff --git a/src/test/kotlin/Test6502TestSuitePart2.kt b/src/test/kotlin/Test6502TestSuitePart2.kt index 08d23ec..bc52af3 100644 --- a/src/test/kotlin/Test6502TestSuitePart2.kt +++ b/src/test/kotlin/Test6502TestSuitePart2.kt @@ -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