Skip to content

Commit

Permalink
fixed tests for mac and win
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Jul 8, 2024
1 parent 515cd4a commit a28db70
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import hu.bme.mit.theta.core.type.inttype.IntExprs.Int
import hu.bme.mit.theta.core.type.inttype.IntType
import hu.bme.mit.theta.solver.SolverFactory
import hu.bme.mit.theta.solver.smtlib.solver.installer.SmtLibSolverInstallerException
import org.junit.Assume
import org.junit.jupiter.api.*
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
Expand All @@ -51,7 +52,7 @@ class SmtLibHornSolverTest {

@JvmStatic
fun solvers(): List<Arguments> {
return solverFactories.map { Arguments.of(it.key, it.value) }
return SOLVERS.map { Arguments.of(it) }
}

@BeforeAll
Expand Down Expand Up @@ -94,7 +95,8 @@ class SmtLibHornSolverTest {

@ParameterizedTest(name = "[{index}] {0}")
@MethodSource("solvers")
fun testSolvable(name: Pair<String, String>, solverFactory: SolverFactory) {
fun testSolvable(name: Pair<String, String>) {
val solverFactory = solverFactories[name]!!
val solver = solverFactory.createHornSolver()
solver.use { hornSolver ->
val p = ParamHolder(Int())
Expand Down Expand Up @@ -137,7 +139,8 @@ class SmtLibHornSolverTest {

@ParameterizedTest(name = "[{index}] {0}")
@MethodSource("solvers")
fun testUnsolvable(name: Pair<String, String>, solverFactory: SolverFactory) {
fun testUnsolvable(name: Pair<String, String>) {
val solverFactory = solverFactories[name]!!
val solver = solverFactory.createHornSolver()

solver.use { hornSolver ->
Expand Down Expand Up @@ -165,7 +168,8 @@ class SmtLibHornSolverTest {

@ParameterizedTest(name = "[{index}] {0}")
@MethodSource("solvers")
fun testNonlinearUnsolvable(name: Pair<String, String>, solverFactory: SolverFactory) {
fun testNonlinearUnsolvable(name: Pair<String, String>) {
val solverFactory = solverFactories[name]!!
val solver = solverFactory.createHornSolver()

solver.use { hornSolver ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ import hu.bme.mit.theta.solver.SolverFactory
import hu.bme.mit.theta.solver.SolverStatus
import hu.bme.mit.theta.solver.smtlib.SmtLibSolverManager
import hu.bme.mit.theta.solver.smtlib.solver.installer.SmtLibSolverInstallerException
import org.junit.jupiter.api.*
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
Expand All @@ -56,8 +58,8 @@ class TestChcUtils {
)

@JvmStatic
fun solvers(): List<Arguments> {
return solverFactories.map { Arguments.of(it.key, it.value) }
fun solvers(): List<Arguments?> {
return SOLVERS.map { Arguments.of(it) }
}

@BeforeAll
Expand Down Expand Up @@ -93,14 +95,10 @@ class TestChcUtils {
}
}

@BeforeEach
fun before() {
Assumptions.assumeTrue(OsHelper.getOs() == OsHelper.OperatingSystem.LINUX)
}

@ParameterizedTest(name = "[{index}] {0}")
@MethodSource("solvers")
fun testPetersonManualCounting(name: Pair<String, String>, solverFactory: SolverFactory) {
fun testPetersonManualCounting(name: Pair<String, String>) {
val solverFactory = solverFactories[name]!!
val i2i = ArrayType.of(Int(), Int())

val pI = ParamHolder(Int())
Expand Down Expand Up @@ -400,7 +398,8 @@ class TestChcUtils {

@ParameterizedTest(name = "[{index}] {0}")
@MethodSource("solvers")
fun testPetersonNoCounting(name: Pair<String, String>, solverFactory: SolverFactory) {
fun testPetersonNoCounting(name: Pair<String, String>) {
val solverFactory = solverFactories[name]!!
val i2i = ArrayType.of(Int(), Int())

val pI = ParamHolder(Int())
Expand Down

0 comments on commit a28db70

Please sign in to comment.