Changed LookupUtil to use stub indexes instead of iterating over global labels and symbol definitions. Added basic test for Structure View.
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
package de.platon42.intellij.plugins.m68k.structureview
|
||||
|
||||
import com.intellij.testFramework.PlatformTestUtil
|
||||
import com.intellij.testFramework.fixtures.CodeInsightTestFixture
|
||||
import de.platon42.intellij.jupiter.LightCodeInsightExtension
|
||||
import de.platon42.intellij.jupiter.MyFixture
|
||||
import de.platon42.intellij.jupiter.TestDataPath
|
||||
import de.platon42.intellij.plugins.m68k.AbstractM68kTest
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.extension.ExtendWith
|
||||
|
||||
@TestDataPath("src/test/resources/structureview")
|
||||
@ExtendWith(LightCodeInsightExtension::class)
|
||||
internal class M68kStructureViewTest : AbstractM68kTest() {
|
||||
|
||||
@Test
|
||||
internal fun do_basic_verification_of_resulting_structure_view(@MyFixture myFixture: CodeInsightTestFixture) {
|
||||
myFixture.configureByFile("basic_example.asm")
|
||||
myFixture.testStructureView {
|
||||
val tree = it.tree
|
||||
PlatformTestUtil.waitWhileBusy(tree)
|
||||
PlatformTestUtil.assertTreeEqual(
|
||||
tree, """-basic_example.asm
|
||||
PIC_WIDTH
|
||||
PIC_HEIGHT
|
||||
DEBUG_LEVEL
|
||||
entry
|
||||
-init
|
||||
.looph
|
||||
.loopw
|
||||
main
|
||||
exit
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
PIC_WIDTH = 320
|
||||
PIC_HEIGHT equ 256
|
||||
DEBUG_LEVEL set 10
|
||||
|
||||
entry:
|
||||
bsr init
|
||||
bsr main
|
||||
bsr exit
|
||||
rts
|
||||
|
||||
init
|
||||
move.w #PIC_HEIGHT,d1
|
||||
.looph move.w #PIC_WIDTH,d0
|
||||
.loopw clr.b (a0)+
|
||||
subq.w #1,d0
|
||||
bne.s .loopw
|
||||
subq.w #1,d1
|
||||
bne.s .looph
|
||||
rts
|
||||
|
||||
main moveq.l #0,d0
|
||||
rts
|
||||
|
||||
exit illegal
|
||||
rts
|
||||
Reference in New Issue
Block a user