From 93ab84c656830261db6561b70794c7343a008ff4 Mon Sep 17 00:00:00 2001 From: J08nY Date: Fri, 2 Aug 2024 15:50:10 +0200 Subject: Remove runTest from edge-cases suite. --- .../java/cz/crcs/ectester/common/test/CompoundTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'common/src') diff --git a/common/src/main/java/cz/crcs/ectester/common/test/CompoundTest.java b/common/src/main/java/cz/crcs/ectester/common/test/CompoundTest.java index ccb0f21..3681400 100644 --- a/common/src/main/java/cz/crcs/ectester/common/test/CompoundTest.java +++ b/common/src/main/java/cz/crcs/ectester/common/test/CompoundTest.java @@ -26,12 +26,25 @@ public class CompoundTest extends Test implements Cloneable { return new Result(Result.Value.SUCCESS, "All sub-tests had the expected result."); }; + public final static Function EXPECT_ALL_SUCCESS = tests -> EXPECT_ALL.apply(Result.ExpectedValue.SUCCESS, tests); + public final static Function EXPECT_ALL_FAILURE = tests -> EXPECT_ALL.apply(Result.ExpectedValue.FAILURE, tests); + public final static Function EXPECT_ALL_ANY = tests -> EXPECT_ALL.apply(Result.ExpectedValue.ANY, tests); + public final static Consumer RUN_ALL = tests -> { for (Test t : tests) { t.run(); } }; + public final static Consumer RUN_ALL_IF_FIRST = tests -> { + tests[0].run(); + if (tests[0].getResult().getValue().equals(Result.Value.SUCCESS)) { + for (int i = 1; i < tests.length; i++) { + tests[i].run(); + } + } + }; + public final static Consumer RUN_GREEDY_ALL = tests -> { for (Test t : tests) { t.run(); -- cgit v1.2.3-70-g09d2