Skip to content

Commit 7d06fd6

Browse files
Move platform check to @beforeeach block in project examples
1 parent 034aaa3 commit 7d06fd6

5 files changed

Lines changed: 13 additions & 9 deletions

File tree

  • doc
    • Example-Gradle-Project-Kotlin/src/test/kotlin/org/sosy_lab/java_smt_example
    • Example-Gradle-Project/src/test/java/org/sosy_lab/java_smt_example
    • Example-Ivy-Project/src/test/org/sosy_lab/java_smt_example
    • Example-Maven-Project/src/test/java/org/sosy_lab/java_smt_example
    • Example-Maven-Web-Project/src/test/java/org/sosy_lab/java_smt_web_example

doc/Example-Gradle-Project-Kotlin/src/test/kotlin/org/sosy_lab/java_smt_example/AppTest.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import com.google.common.base.StandardSystemProperty
1414
import org.junit.jupiter.api.Assertions.assertEquals
1515
import org.junit.jupiter.api.Assertions.assertNotNull
1616
import org.junit.jupiter.api.Assumptions.assumeTrue
17+
import org.junit.jupiter.api.BeforeEach
1718
import org.junit.jupiter.params.Parameter
1819
import org.junit.jupiter.params.ParameterizedClass
1920
import org.junit.jupiter.params.provider.MethodSource
@@ -84,9 +85,13 @@ class AppTest {
8485
val logger = BasicLogManager.create(config)
8586
val notifier = ShutdownNotifier.createDummy()
8687

88+
@BeforeEach
89+
fun init() {
90+
assumeTrue(isSupportedOperatingSystemAndArchitecture(solver))
91+
}
92+
8793
@Test
8894
fun checkSudoku() {
89-
assumeTrue(isSupportedOperatingSystemAndArchitecture(solver))
9095
logger.log(Level.INFO, "Executing " + solver + "...")
9196

9297
SolverContextFactory.createSolverContext(config, logger, notifier, solver).use {

doc/Example-Gradle-Project/src/test/java/org/sosy_lab/java_smt_example/SudokuTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ public static List<Solvers> getAllSolvers() {
132132

133133
@BeforeEach
134134
public void init() throws InvalidConfigurationException {
135+
assumeTrue(isSupportedOperatingSystemAndArchitecture(solver));
136+
135137
config = Configuration.defaultConfiguration();
136138
logger = BasicLogManager.create(config);
137139
notifier = ShutdownNotifier.createDummy();
@@ -192,8 +194,6 @@ private boolean isSupportedOperatingSystemAndArchitecture(Solvers solver) {
192194
@Test
193195
public void checkSudoku()
194196
throws InvalidConfigurationException, InterruptedException, SolverException {
195-
assumeTrue(isSupportedOperatingSystemAndArchitecture(solver));
196-
197197
logger.log(Level.INFO, "Executing " + solver + "...");
198198

199199
context = SolverContextFactory.createSolverContext(config, logger, notifier, solver);

doc/Example-Ivy-Project/src/test/org/sosy_lab/java_smt_example/SudokuTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public static List<Solvers> getAllSolvers() {
132132

133133
@BeforeEach
134134
public void init() throws InvalidConfigurationException {
135+
assumeTrue(isSupportedOperatingSystemAndArchitecture(solver));
135136
config = Configuration.defaultConfiguration();
136137
logger = BasicLogManager.create(config);
137138
notifier = ShutdownNotifier.createDummy();
@@ -192,8 +193,6 @@ private boolean isSupportedOperatingSystemAndArchitecture(Solvers solver) {
192193
@Test
193194
public void checkSudoku()
194195
throws InvalidConfigurationException, InterruptedException, SolverException {
195-
assumeTrue(isSupportedOperatingSystemAndArchitecture(solver));
196-
197196
logger.log(Level.INFO, "Executing " + solver + "...");
198197

199198
context = SolverContextFactory.createSolverContext(config, logger, notifier, solver);

doc/Example-Maven-Project/src/test/java/org/sosy_lab/java_smt_example/SudokuTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ public static List<Solvers> getAllSolvers() {
132132

133133
@BeforeEach
134134
public void init() throws InvalidConfigurationException {
135+
assumeTrue(isSupportedOperatingSystemAndArchitecture(solver));
136+
135137
config = Configuration.defaultConfiguration();
136138
logger = BasicLogManager.create(config);
137139
notifier = ShutdownNotifier.createDummy();
@@ -192,8 +194,6 @@ private boolean isSupportedOperatingSystemAndArchitecture(Solvers solver) {
192194
@Test
193195
public void checkSudoku()
194196
throws InvalidConfigurationException, InterruptedException, SolverException {
195-
assumeTrue(isSupportedOperatingSystemAndArchitecture(solver));
196-
197197
logger.log(Level.INFO, "Executing " + solver + "...");
198198

199199
context = SolverContextFactory.createSolverContext(config, logger, notifier, solver);

doc/Example-Maven-Web-Project/src/test/java/org/sosy_lab/java_smt_web_example/SudokuTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ public static List<Solvers> getAllSolvers() {
132132

133133
@BeforeEach
134134
public void init() throws InvalidConfigurationException {
135+
assumeTrue(isSupportedOperatingSystemAndArchitecture(solver));
136+
135137
config = Configuration.defaultConfiguration();
136138
logger = BasicLogManager.create(config);
137139
notifier = ShutdownNotifier.createDummy();
@@ -192,8 +194,6 @@ private boolean isSupportedOperatingSystemAndArchitecture(Solvers solver) {
192194
@Test
193195
public void checkSudoku()
194196
throws InvalidConfigurationException, InterruptedException, SolverException {
195-
assumeTrue(isSupportedOperatingSystemAndArchitecture(solver));
196-
197197
logger.log(Level.INFO, "Executing " + solver + "...");
198198

199199
context = SolverContextFactory.createSolverContext(config, logger, notifier, solver);

0 commit comments

Comments
 (0)