aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-12-25 12:16:43 +0000
committerMichael Williamson <mike@zwobble.org>2023-12-25 12:16:43 +0000
commit086a2d0df252dc55e8ee6607a60e2b754bc785cd (patch)
treeeb2b4bb87ff718fc67d1ba5e02dd7fd2e1e651b2 /src/test/java/org
parent74df9e0559c20f4aed570f80f7584a36b5c5f39a (diff)
Add support for running WIP example tests
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/shedlang/compiler/backends/ExampleTests.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/test/java/org/shedlang/compiler/backends/ExampleTests.java b/src/test/java/org/shedlang/compiler/backends/ExampleTests.java
index 60c047da..149e30e4 100644
--- a/src/test/java/org/shedlang/compiler/backends/ExampleTests.java
+++ b/src/test/java/org/shedlang/compiler/backends/ExampleTests.java
@@ -1,5 +1,6 @@
package org.shedlang.compiler.backends;
+import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.TestFactory;
@@ -33,7 +34,10 @@ public abstract class ExampleTests {
}
private void runTest(File exampleDirectory) throws IOException, InterruptedException {
- Assumptions.assumeFalse(isDisabled(exampleDirectory.getName()));
+ var isWipTest = isDisabled(exampleDirectory.getName());
+ var includeWipTests = System.getenv("INCLUDE_WIP_TESTS") != null;
+ Assumptions.assumeFalse(isWipTest && !includeWipTests);
+
var backend = backend();
var compiler = new ShedCompiler();
@@ -55,6 +59,10 @@ public abstract class ExampleTests {
var result = runExampleBinary(binPath).throwOnError();
assertThat(result.stdout(), equalTo(example.expectedOutput().orElseThrow()));
}
+
+ if (isWipTest) {
+ Assertions.fail("WIP test succeeded");
+ }
}
private ExecutionResult runExampleBinary(String binary) throws IOException, InterruptedException {