mirror of
https://github.com/irmen/prog8.git
synced 2024-12-25 08:29:25 +00:00
enabled test
This commit is contained in:
parent
85b244df2f
commit
d790878af6
@ -14,6 +14,7 @@ import prog8.compiler.target.cbm.AssemblyProgram
|
||||
import prog8.compiler.target.cpu6502.codegen.assignment.AsmAssignment
|
||||
import prog8.compiler.target.cpu6502.codegen.assignment.AssignmentAsmGen
|
||||
import prog8.optimizer.CallGraph
|
||||
import prog8.parser.SourceCode
|
||||
import java.nio.file.Path
|
||||
import java.time.LocalDate
|
||||
import java.time.LocalDateTime
|
||||
@ -1325,7 +1326,9 @@ $repeatLabel lda $counterVar
|
||||
"%asminclude" -> {
|
||||
// TODO: handle %asminclude with SourceCode
|
||||
val includedName = stmt.args[0].str!!
|
||||
val sourcePath = Path(stmt.definingModule.source.pathString()) // FIXME: %asminclude inside non-library, non-filesystem module
|
||||
if(stmt.definingModule.source is SourceCode.Generated)
|
||||
TODO("%asminclude inside non-library, non-filesystem module")
|
||||
val sourcePath = Path(stmt.definingModule.source.pathString())
|
||||
loadAsmIncludeFile(includedName, sourcePath).fold(
|
||||
success = { assemblyLines.add(it.trimEnd().trimStart('\n')) },
|
||||
failure = { errors.err(it.toString(), stmt.position) }
|
||||
@ -1335,7 +1338,9 @@ $repeatLabel lda $counterVar
|
||||
val includedName = stmt.args[0].str!!
|
||||
val offset = if(stmt.args.size>1) ", ${stmt.args[1].int}" else ""
|
||||
val length = if(stmt.args.size>2) ", ${stmt.args[2].int}" else ""
|
||||
val sourcePath = Path(stmt.definingModule.source.pathString()) // FIXME: %asmbinary inside non-library, non-filesystem module
|
||||
if(stmt.definingModule.source is SourceCode.Generated)
|
||||
TODO("%asmbinary inside non-library, non-filesystem module")
|
||||
val sourcePath = Path(stmt.definingModule.source.pathString())
|
||||
val includedPath = sourcePath.resolveSibling(includedName)
|
||||
val pathForAssembler = outputDir // #54: 64tass needs the path *relative to the .asm file*
|
||||
.absolute() // avoid IllegalArgumentExc due to non-absolute path .relativize(absolute path)
|
||||
|
@ -303,6 +303,7 @@ class TestModuleImporter {
|
||||
assertThat("endCol; should be 0-based", it.position.endCol, equalTo(6))
|
||||
}
|
||||
assertThat(program.modules.size, equalTo(2))
|
||||
importer.errors.report()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package prog8tests
|
||||
|
||||
import org.junit.jupiter.api.Disabled
|
||||
import org.junit.jupiter.api.DynamicTest
|
||||
import org.junit.jupiter.api.DynamicTest.dynamicTest
|
||||
import org.junit.jupiter.api.TestFactory
|
||||
|
@ -344,10 +344,10 @@ class TestProg8Parser {
|
||||
* TODO: this test is testing way too much at once
|
||||
*/
|
||||
@Test
|
||||
@Disabled("TODO: fix .position of nodes below Module - step 8, 'refactor AST gen'")
|
||||
//@Disabled("TODO: fix .position of nodes below Module - step 8, 'refactor AST gen'")
|
||||
fun `of non-root Nodes parsed from a string`() {
|
||||
val srcText = """
|
||||
%target 16, "abc" ; DirectiveArg directly inherits from Node - neither an Expression nor a Statement..?
|
||||
%zeropage basicsafe ; DirectiveArg directly inherits from Node - neither an Expression nor a Statement..?
|
||||
main {
|
||||
sub start() {
|
||||
ubyte foo = 42
|
||||
|
@ -138,13 +138,4 @@ class TestSourceCode {
|
||||
|
||||
assertFailsWith<NoSuchFileException> { SourceCode.Resource(pathString) }
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled("TODO: inside resources: cannot tell apart a folder from a file")
|
||||
fun testFromResourcesWithDirectory() {
|
||||
val pathString = "/prog8lib"
|
||||
assumeDirectory(resourcesDir, pathString.substring(1))
|
||||
assertFailsWith<AccessDeniedException> { SourceCode.Resource(pathString) }
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,9 @@ TODO
|
||||
|
||||
For next compiler release
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
- can we derive module.name from module.source (taking just the filename base)?
|
||||
- fix "unknown" reported in resulting .asm as source file of included library modules/resources
|
||||
unittest: "of non-root Nodes parsed from a string"
|
||||
|
||||
|
||||
|
||||
Blocked by Commander-x16 v39 release
|
||||
@ -14,6 +16,7 @@ Blocked by Commander-x16 v39 release
|
||||
|
||||
Future
|
||||
^^^^^^
|
||||
- derive module.name from module.source (taking just the filename base)?
|
||||
- get rid of all TODO's and FIXME's in the code
|
||||
- improve testability further, add more tests, address more questions/issues from the testability discussions.
|
||||
- can we get rid of pieces of asmgen.AssignmentAsmGen by just reusing the AugmentableAssignment ? generated code should not suffer
|
||||
|
Loading…
Reference in New Issue
Block a user