diff options
| author | Michael Williamson <mike@zwobble.org> | 2024-03-24 14:52:59 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2024-03-24 14:52:59 +0000 |
| commit | 85f9578fb680ab4ee959469133714acd908a7c10 (patch) | |
| tree | 49e87c6e15d590d0dba9aa2e9832fef9d88e6540 /src/test/java | |
| parent | c5b7107068537447a93982ead0217ac17070231c (diff) | |
Support custom runtimes when compiling
Diffstat (limited to 'src/test/java')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/backends/llvm/PatioToLlvmTests.java | 12 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/backends/wasm/PatioToWasmTests.java | 4 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/test/java/org/shedlang/compiler/backends/llvm/PatioToLlvmTests.java b/src/test/java/org/shedlang/compiler/backends/llvm/PatioToLlvmTests.java index fc5ee94e..3b8a5405 100644 --- a/src/test/java/org/shedlang/compiler/backends/llvm/PatioToLlvmTests.java +++ b/src/test/java/org/shedlang/compiler/backends/llvm/PatioToLlvmTests.java @@ -10,10 +10,9 @@ import org.shedlang.compiler.backends.llvm.ir.ast.operands.LlvmOperandInt; import org.shedlang.compiler.backends.llvm.ir.ast.operands.LlvmVariableGlobal; import org.shedlang.compiler.backends.llvm.ir.ast.types.LlvmTypes; import org.shedlang.compiler.backends.paths.PartialTargetPath; -import org.shedlang.compiler.config.GcConfig; -import org.shedlang.compiler.filesystem.ShedCompilerFiles; import org.shedlang.compiler.patio.PatioCompilationUnit; import org.shedlang.compiler.patio.PatioExampleTests; +import org.shedlang.compiler.runtime.ShedRuntime; import org.shedlang.compiler.testing.ExecutionResult; import org.shedlang.compiler.testing.TestProcessRunner; @@ -63,17 +62,14 @@ public abstract class PatioToLlvmTests extends PatioExampleTests { var executablePath = workingDirectory.resolve("main"); - var gcConfig = GcConfig.DEFAULT; + var runtime = ShedRuntime.defaultRuntime(llvmTarget().targetName()); LlvmBackend.forTarget(this.llvmTarget()).link( List.of( objectFilePath, - ShedCompilerFiles.runtimeTargetDir( - this.llvmTarget().targetName(), - gcConfig - ).resolve("libpatio_test.a") + runtime.dir().resolve("libpatio_test.a") ), executablePath, - gcConfig + runtime ); return TestProcessRunner.runCaptureOutput(List.of(executablePath.toString())); diff --git a/src/test/java/org/shedlang/compiler/backends/wasm/PatioToWasmTests.java b/src/test/java/org/shedlang/compiler/backends/wasm/PatioToWasmTests.java index 829c69e6..8ba247c8 100644 --- a/src/test/java/org/shedlang/compiler/backends/wasm/PatioToWasmTests.java +++ b/src/test/java/org/shedlang/compiler/backends/wasm/PatioToWasmTests.java @@ -7,9 +7,9 @@ import org.shedlang.compiler.backends.wasm.structure.ast.instructions.WasmInstru import org.shedlang.compiler.backends.wasm.structure.ast.modules.WasmFuncName; import org.shedlang.compiler.backends.wasm.structure.ast.modules.WasmFunction; import org.shedlang.compiler.backends.wasm.structure.binary.WasmBinaryFormatTesting; -import org.shedlang.compiler.config.GcConfig; import org.shedlang.compiler.patio.PatioCompilationUnit; import org.shedlang.compiler.patio.PatioExampleTests; +import org.shedlang.compiler.runtime.ShedRuntime; import org.shedlang.compiler.testing.ExecutionResult; import org.shedlang.compiler.testing.TestProcessRunner; import org.shedlang.compiler.util.Lists; @@ -50,7 +50,7 @@ public abstract class PatioToWasmTests extends PatioExampleTests { WasmBackend.forTarget(wasmTarget()).link( List.of(objectPath), executablePath, - GcConfig.DEFAULT + ShedRuntime.defaultRuntime(wasmTarget().targetName()) ); WasmBinaryFormatTesting.validate(executablePath, wasmTarget()); |
