summaryrefslogtreecommitdiff
path: root/src/LispExecutionContext.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/LispExecutionContext.kt')
-rw-r--r--src/LispExecutionContext.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/LispExecutionContext.kt b/src/LispExecutionContext.kt
index ed5c091..9c2d9f8 100644
--- a/src/LispExecutionContext.kt
+++ b/src/LispExecutionContext.kt
@@ -20,6 +20,7 @@ class LispExecutionContext() {
fun setupStandardBindings() {
CoreBindings.offerAllTo(rootStackFrame)
registerModule("builtins", Builtins.builtinProgram)
+ registerModule("test", Builtins.testProgram)
modules["ntest"] = TestFramework.realizedTestModule
importModule("builtins", rootStackFrame, object : HasLispPosition {
override val position: LispPosition
@@ -29,12 +30,14 @@ class LispExecutionContext() {
fun runTests(
program: LispAst.Program,
+ name: String,
stackFrame: StackFrame = genBindings(),
testList: List<String> = emptyList(),
isWhitelist: Boolean = false
): TestFramework.TestSuite {
- val testSuite = TestFramework.setup(stackFrame, testList, isWhitelist)
+ val testSuite = TestFramework.setup(stackFrame, name, testList, isWhitelist)
executeProgram(stackFrame, program)
+ testSuite.isTesting = false
return testSuite
}
@@ -64,7 +67,7 @@ class LispExecutionContext() {
modules[moduleName] = map
val module = unloadedModules.remove(moduleName) ?: error("Could not find module $moduleName")
val stackFrame = genBindings()
- stackFrame.setValueLocal("export", LispData.externalRawCall { context, callsite, stackFrame, args ->
+ stackFrame.setValueLocal("export", LispData.externalRawCall("export") { context, callsite, stackFrame, args ->
args.forEach { name ->
if (name !is LispAst.Reference) {
context.reportError("Invalid export", name)