diff --git a/build/build-junit.xml b/build/build-junit.xml index 1247edc759..991e9a8a3c 100644 --- a/build/build-junit.xml +++ b/build/build-junit.xml @@ -46,21 +46,21 @@ SPDX-License-Identifier: Apache-2.0 + - - + + - - - - + + + @@ -69,6 +69,41 @@ SPDX-License-Identifier: Apache-2.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,7 +113,6 @@ SPDX-License-Identifier: Apache-2.0 - diff --git a/build/gitlab-ci.Dockerfile.jdk-11 b/build/gitlab-ci.Dockerfile.jdk-11 index a53d827b72..b32cdf6d95 100644 --- a/build/gitlab-ci.Dockerfile.jdk-11 +++ b/build/gitlab-ci.Dockerfile.jdk-11 @@ -2,7 +2,7 @@ # an API wrapper for a collection of SMT solvers: # https://github.com/sosy-lab/java-smt # -# SPDX-FileCopyrightText: 2020 Dirk Beyer +# SPDX-FileCopyrightText: 2025 Dirk Beyer # # SPDX-License-Identifier: Apache-2.0 @@ -14,6 +14,22 @@ # docker build --pull -t registry.gitlab.com/sosy-lab/software/java-smt/test:jdk-11 - < build/gitlab-ci.Dockerfile.jdk-11 # docker push registry.gitlab.com/sosy-lab/software/java-smt/test:jdk-11 -FROM registry.gitlab.com/sosy-lab/software/java-project-template/test:jdk-11 +FROM ubuntu:20.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ=UTC + +RUN apt-get update && apt-get install -y --no-install-recommends \ + ant \ + curl \ + git \ + jq \ + openjdk-11-jre-headless \ + openjdk-11-jdk-headless \ + wget \ + && rm -rf /var/lib/apt/lists/* + +ENV LANG C.UTF-8 + RUN apt-get update && apt-get install -y \ libgomp1 diff --git a/build/gitlab-ci.Dockerfile.jdk-17 b/build/gitlab-ci.Dockerfile.jdk-17 index 96c5d12277..12a98e9530 100644 --- a/build/gitlab-ci.Dockerfile.jdk-17 +++ b/build/gitlab-ci.Dockerfile.jdk-17 @@ -2,7 +2,7 @@ # an API wrapper for a collection of SMT solvers: # https://github.com/sosy-lab/java-smt # -# SPDX-FileCopyrightText: 2022 Dirk Beyer +# SPDX-FileCopyrightText: 2025 Dirk Beyer # # SPDX-License-Identifier: Apache-2.0 @@ -14,6 +14,22 @@ # docker build --pull -t registry.gitlab.com/sosy-lab/software/java-smt/test:jdk-17 - < build/gitlab-ci.Dockerfile.jdk-17 # docker push registry.gitlab.com/sosy-lab/software/java-smt/test:jdk-17 -FROM registry.gitlab.com/sosy-lab/software/java-project-template/test:jdk-17 +FROM ubuntu:20.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ=UTC + +RUN apt-get update && apt-get install -y --no-install-recommends \ + ant \ + curl \ + git \ + jq \ + openjdk-17-jre-headless \ + openjdk-17-jdk-headless \ + wget \ + && rm -rf /var/lib/apt/lists/* + +ENV LANG C.UTF-8 + RUN apt-get update && apt-get install -y \ libgomp1 diff --git a/build/gitlab-ci.Dockerfile.jdk-21 b/build/gitlab-ci.Dockerfile.jdk-21 index 6b30b7fbe9..8b65b101a6 100644 --- a/build/gitlab-ci.Dockerfile.jdk-21 +++ b/build/gitlab-ci.Dockerfile.jdk-21 @@ -2,7 +2,7 @@ # an API wrapper for a collection of SMT solvers: # https://github.com/sosy-lab/java-smt # -# SPDX-FileCopyrightText: 2024 Dirk Beyer +# SPDX-FileCopyrightText: 2025 Dirk Beyer # # SPDX-License-Identifier: Apache-2.0 @@ -14,6 +14,21 @@ # docker build --pull -t registry.gitlab.com/sosy-lab/software/java-smt/test:jdk-21 - < build/gitlab-ci.Dockerfile.jdk-21 # docker push registry.gitlab.com/sosy-lab/software/java-smt/test:jdk-21 -FROM registry.gitlab.com/sosy-lab/software/java-project-template/test:jdk-21 +FROM ubuntu:20.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ=UTC + +RUN apt-get update && apt-get install -y --no-install-recommends \ + ant \ + curl \ + git \ + jq \ + openjdk-21-jdk-headless \ + wget \ + && rm -rf /var/lib/apt/lists/* + +ENV LANG C.UTF-8 + RUN apt-get update && apt-get install -y \ libgomp1 diff --git a/build/gitlab-ci.Dockerfile.jdk-23 b/build/gitlab-ci.Dockerfile.jdk-23 index 873def09ff..bbac2aac50 100644 --- a/build/gitlab-ci.Dockerfile.jdk-23 +++ b/build/gitlab-ci.Dockerfile.jdk-23 @@ -14,6 +14,20 @@ # docker build --pull -t registry.gitlab.com/sosy-lab/software/java-smt/test:jdk-23 - < build/gitlab-ci.Dockerfile.jdk-23 # docker push registry.gitlab.com/sosy-lab/software/java-smt/test:jdk-23 -FROM registry.gitlab.com/sosy-lab/software/java-project-template/test:jdk-23 +# Older Ubuntu versions currently do not have GLIC_2.34 and Java 23 +FROM ubuntu:24.10 + +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ=UTC + +RUN apt-get update && apt-get install -y --no-install-recommends \ + ant \ + curl \ + git \ + jq \ + openjdk-23-jdk-headless \ + wget \ + && rm -rf /var/lib/apt/lists/* + RUN apt-get update && apt-get install -y \ libgomp1 diff --git a/build/gitlab-ci.yml b/build/gitlab-ci.yml index 0fe50ac438..292167666f 100644 --- a/build/gitlab-ci.yml +++ b/build/gitlab-ci.yml @@ -29,7 +29,6 @@ variables: # Download dependencies and provide them to later stages build-dependencies: stage: dependencies - dependencies: [] script: "ant build-dependencies" interruptible: true cache: @@ -44,7 +43,7 @@ build-dependencies: # Build binaries and provide them to later stages -.build: &build +.build: stage: build script: "ant $ANT_PROPS_BUILD jar" interruptible: true @@ -55,61 +54,38 @@ build-dependencies: - "hs_err_pid*.log" - "core.*" -build:jdk-11: - <<: *build - image: ${CI_REGISTRY_IMAGE}/test:jdk-11 - -build:jdk-17: - <<: *build - image: ${CI_REGISTRY_IMAGE}/test:jdk-17 - -build:jdk-21: - <<: *build - image: ${CI_REGISTRY_IMAGE}/test:jdk-21 - -build:jdk-23: - <<: *build - image: ${CI_REGISTRY_IMAGE}/test:jdk-23 - +build:jdk-11: { extends: .build, image: "${CI_REGISTRY_IMAGE}/test:jdk-11" } +build:jdk-17: { extends: .build, image: "${CI_REGISTRY_IMAGE}/test:jdk-17" } +build:jdk-21: { extends: .build, image: "${CI_REGISTRY_IMAGE}/test:jdk-21" } +build:jdk-23: { extends: .build, image: "${CI_REGISTRY_IMAGE}/test:jdk-23" } # For checks that need the binaries -.binary_check: &binary_check +.binary_check: stage: checks interruptible: true # For checks that only need the source code, not the binaries -.source_check: &source_check +.source_check: stage: checks - dependencies: - - build-dependencies needs: - build-dependencies interruptible: true -.build-project-ecj: &build-project-ecj - <<: *source_check +.build-project-ecj: + extends: .source_check script: "ant $ANT_PROPS_BUILD build-project-ecj" -build-project-ecj:jdk-17: - <<: *build-project-ecj - image: ${CI_REGISTRY_IMAGE}/test:jdk-17 - -build-project-ecj:jdk-21: - <<: *build-project-ecj - image: ${CI_REGISTRY_IMAGE}/test:jdk-21 - -build-project-ecj:jdk-23: - <<: *build-project-ecj - image: ${CI_REGISTRY_IMAGE}/test:jdk-23 - +build-project-ecj:jdk-17: {extends: .build-project-ecj, image: "${CI_REGISTRY_IMAGE}/test:jdk-17" } +build-project-ecj:jdk-21: {extends: .build-project-ecj, image: "${CI_REGISTRY_IMAGE}/test:jdk-21" } +build-project-ecj:jdk-23: {extends: .build-project-ecj, image: "${CI_REGISTRY_IMAGE}/test:jdk-23" } check-format: - <<: *source_check + extends: .source_check script: "ant $ANT_PROPS_CHECKS format-source && git diff -s --exit-code" checkstyle: - <<: *source_check + extends: .source_check script: - "ant $ANT_PROPS_CHECKS checkstyle" - "ant $ANT_PROPS_CHECKS run-checkstyle -Dcheckstyle.output=plain && cat Checkstyle*.xml && test $(cat Checkstyle*xml | grep -vic audit) -eq 0" @@ -119,11 +95,8 @@ checkstyle: when: on_failure javadoc: - <<: *binary_check + extends: .binary_check script: "ant $ANT_PROPS_CHECKS javadoc" - dependencies: - - build-dependencies - - build:jdk-11 needs: - build-dependencies - build:jdk-11 @@ -132,13 +105,10 @@ javadoc: - "Javadoc/" spotbugs: - <<: *binary_check + extends: .binary_check script: - 'ant $ANT_PROPS_CHECKS spotbugs' - 'test \! -f SpotBugs.html' - dependencies: - - build-dependencies - - build:jdk-11 needs: - build-dependencies - build:jdk-11 @@ -147,9 +117,14 @@ spotbugs: - "SpotBugs.html" when: on_failure -.unit-tests: &unit-tests - <<: *binary_check - script: "ant $ANT_PROPS_CHECKS unit-tests-coverage" +.unit-tests: + extends: .binary_check + before_script: + - "uname -a" + - "ldd --version" + - "java -version" + script: + - "ant $ANT_PROPS_CHECKS unit-tests-coverage" artifacts: paths: - "JUnit.html" @@ -159,49 +134,50 @@ spotbugs: reports: junit: "junit/TESTS-TestSuites.xml" -unit-tests:jdk-11: - <<: *unit-tests - dependencies: - - build-dependencies - - build:jdk-11 - needs: - - build-dependencies - - build:jdk-11 - image: ${CI_REGISTRY_IMAGE}/test:jdk-11 - -unit-tests:jdk-17: - <<: *unit-tests - dependencies: - - build-dependencies - - build:jdk-17 - needs: - - build-dependencies - - build:jdk-17 - image: ${CI_REGISTRY_IMAGE}/test:jdk-17 - -unit-tests:jdk-21: - <<: *unit-tests - dependencies: - - build-dependencies - - build:jdk-21 - needs: - - build-dependencies - - build:jdk-21 - image: ${CI_REGISTRY_IMAGE}/test:jdk-21 - -unit-tests:jdk-23: - <<: *unit-tests - dependencies: - - build-dependencies - - build:jdk-23 - needs: - - build-dependencies - - build:jdk-23 - image: ${CI_REGISTRY_IMAGE}/test:jdk-23 - +.unit-tests-quick: + extends: [ .binary_check, .unit-tests ] + script: + - "ant $ANT_PROPS_CHECKS unit-tests-quick" + artifacts: + paths: + - "JUnit.html" # no coverage files available + +unit-tests:x86_64:jdk-11: + extends: .unit-tests + needs: [ build-dependencies, build:jdk-11 ] + image: "${CI_REGISTRY_IMAGE}/test:jdk-11" +unit-tests:x86_64:jdk-17: + extends: .unit-tests + needs: [ build-dependencies, build:jdk-17 ] + image: "${CI_REGISTRY_IMAGE}/test:jdk-17" +unit-tests:x86_64:jdk-21: + extends: .unit-tests + needs: [ build-dependencies, build:jdk-21 ] + image: "${CI_REGISTRY_IMAGE}/test:jdk-21" +unit-tests:x86_64:jdk-23: + extends: .unit-tests + needs: [ build-dependencies, build:jdk-23 ] + image: "${CI_REGISTRY_IMAGE}/test:jdk-23" + +unit-tests:arm64:jdk-11: + extends: .unit-tests-quick + needs: [ build-dependencies, build:jdk-11 ] + image: { name: "${CI_REGISTRY_IMAGE}/test:jdk-11-arm64", docker: { platform: linux/arm64 } } +unit-tests:arm64:jdk-17: + extends: .unit-tests-quick + needs: [ build-dependencies, build:jdk-17 ] + image: { name: "${CI_REGISTRY_IMAGE}/test:jdk-17-arm64", docker: { platform: linux/arm64 } } +unit-tests:arm64:jdk-21: + extends: .unit-tests-quick + needs: [ build-dependencies, build:jdk-21 ] + image: { name: "${CI_REGISTRY_IMAGE}/test:jdk-21-arm64", docker: { platform: linux/arm64 } } +unit-tests:arm64:jdk-23: + extends: .unit-tests-quick + needs: [ build-dependencies, build:jdk-23 ] + image: { name: "${CI_REGISTRY_IMAGE}/test:jdk-23-arm64", docker: { platform: linux/arm64 } } refaster: - <<: *source_check + extends: .source_check image: ${CI_REGISTRY_IMAGE}/test:jdk-11 before_script: - 'test -d refaster || git clone https://gitlab.com/sosy-lab/software/refaster.git' @@ -232,7 +208,6 @@ refaster: # check license declarations etc. reuse: stage: checks - dependencies: [] needs: [] image: name: fsfe/reuse:3 @@ -244,9 +219,6 @@ reuse: deploy-gh-pages: stage: deploy script: "build/deploy-gh-pages.sh" - dependencies: - - build:jdk-11 - - javadoc needs: - build:jdk-11 - javadoc @@ -264,39 +236,35 @@ deploy-gh-pages: # following this guideline: https://docs.gitlab.com/ee/ci/docker/using_kaniko.html .build-docker: stage: images - image: - name: gcr.io/kaniko-project/executor:debug - entrypoint: [""] variables: EXTRA_ARGS: "" + DOCKERFILE: "build/gitlab-ci.Dockerfile.$JDK_VERSION" + IMAGE: "test:$JDK_VERSION" # no architecture suffix for backwards compatibility + image: + name: "gcr.io/kaniko-project/executor:debug" + entrypoint: [""] script: - mkdir -p /root/.docker - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - - /kaniko/executor --dockerfile $CI_PROJECT_DIR/$DOCKERFILE --destination $CI_REGISTRY_IMAGE$IMAGE $EXTRA_ARGS + - /kaniko/executor --dockerfile $CI_PROJECT_DIR/$DOCKERFILE --destination $CI_REGISTRY_IMAGE/$IMAGE $EXTRA_ARGS only: - schedules - web -build-docker:test:jdk-11: - extends: .build-docker - variables: - DOCKERFILE: build/gitlab-ci.Dockerfile.jdk-11 - IMAGE: /test:jdk-11 - -build-docker:test:jdk-17: +.build-docker:arm64: extends: .build-docker + image: + docker: + platform: linux/arm64 variables: - DOCKERFILE: build/gitlab-ci.Dockerfile.jdk-17 - IMAGE: /test:jdk-17 + IMAGE: "test:$JDK_VERSION-arm64" # override image name for arm64 -build-docker:test:jdk-21: - extends: .build-docker - variables: - DOCKERFILE: build/gitlab-ci.Dockerfile.jdk-21 - IMAGE: /test:jdk-21 +build-docker:x86_64:jdk-11: { extends: .build-docker, variables: { JDK_VERSION: jdk-11 } } +build-docker:x86_64:jdk-17: { extends: .build-docker, variables: { JDK_VERSION: jdk-17 } } +build-docker:x86_64:jdk-21: { extends: .build-docker, variables: { JDK_VERSION: jdk-21 } } +build-docker:x86_64:jdk-23: { extends: .build-docker, variables: { JDK_VERSION: jdk-23 } } -build-docker:test:jdk-23: - extends: .build-docker - variables: - DOCKERFILE: build/gitlab-ci.Dockerfile.jdk-23 - IMAGE: /test:jdk-23 +build-docker:arm64:jdk-11: { extends: .build-docker:arm64, variables: { JDK_VERSION: jdk-11 } } +build-docker:arm64:jdk-17: { extends: .build-docker:arm64, variables: { JDK_VERSION: jdk-17 } } +build-docker:arm64:jdk-21: { extends: .build-docker:arm64, variables: { JDK_VERSION: jdk-21 } } +build-docker:arm64:jdk-23: { extends: .build-docker:arm64, variables: { JDK_VERSION: jdk-23 } } diff --git a/src/org/sosy_lab/java_smt/test/SolverContextFactoryTest.java b/src/org/sosy_lab/java_smt/test/SolverContextFactoryTest.java index c858e366e9..3e869f43d1 100644 --- a/src/org/sosy_lab/java_smt/test/SolverContextFactoryTest.java +++ b/src/org/sosy_lab/java_smt/test/SolverContextFactoryTest.java @@ -2,7 +2,7 @@ // an API wrapper for a collection of SMT solvers: // https://github.com/sosy-lab/java-smt // -// SPDX-FileCopyrightText: 2021 Dirk Beyer +// SPDX-FileCopyrightText: 2025 Dirk Beyer // // SPDX-License-Identifier: Apache-2.0 @@ -13,7 +13,6 @@ import static org.junit.Assert.assertThrows; import com.google.common.base.StandardSystemProperty; -import com.google.common.truth.StandardSubjectBuilder; import java.util.Locale; import org.junit.Before; import org.junit.Test; @@ -41,10 +40,15 @@ public class SolverContextFactoryTest { private static final String OS = StandardSystemProperty.OS_NAME.value().toLowerCase(Locale.getDefault()).replace(" ", ""); + private static final String ARCH = + StandardSystemProperty.OS_ARCH.value().toLowerCase(Locale.getDefault()).replace(" ", ""); + protected static final boolean IS_WINDOWS = OS.startsWith("windows"); private static final boolean IS_MAC = OS.startsWith("macos"); private static final boolean IS_LINUX = OS.startsWith("linux"); + private static final boolean IS_ARCH_ARM64 = ARCH.equals("aarch64"); + protected Configuration config; protected final LogManager logger = LogManager.createTestLogManager(); protected ShutdownManager shutdownManager = ShutdownManager.create(); @@ -81,47 +85,52 @@ private void requireNativeLibrary() { * *

We update this list, whenever a new solver or operating system is added. */ - private void requireSupportedOperatingSystem() { - StandardSubjectBuilder assume = - assume() - .withMessage( - "Solver %s is not yet supported in the operating system %s", solverToUse(), OS); + private void requirePlatformSupported() { + assume() + .withMessage( + "Solver %s is not yet supported in the operating system %s with architecture %s", + solverToUse(), OS, ARCH) + .that(isSupportedOperatingSystemAndArchitecture()) + .isTrue(); + } + + private void requirePlatformNotSupported() { + assume() + .withMessage( + "Solver %s is not yet supported in the operating system %s with architecture %s", + solverToUse(), OS, ARCH) + .that(isSupportedOperatingSystemAndArchitecture()) + .isFalse(); + } + + /** + * This method represents the matrix of supported operating systems and architectures, which can + * be tested in our CI. It might be possible that JavaSMT runs on more systems than listed here, + * but we do not explicitly test them in our CI. + */ + private boolean isSupportedOperatingSystemAndArchitecture() { switch (solverToUse()) { case SMTINTERPOL: case PRINCESS: - // any operating system is allowed, Java is already available. - return; + // Any operating system and any architecture is allowed, Java is sufficient + return true; case BOOLECTOR: case CVC4: case YICES2: - assume.that(IS_LINUX).isTrue(); - return; + return IS_LINUX && !IS_ARCH_ARM64; case CVC5: - assume.that(IS_LINUX || IS_WINDOWS).isTrue(); - if (IS_LINUX) { - assume.that(isSufficientVersionOfLibcxx("cvc5jni")).isTrue(); - } - return; + return (IS_LINUX && isSufficientVersionOfLibcxx("cvc5jni")) + || (IS_WINDOWS && !IS_ARCH_ARM64); case OPENSMT: - assume.that(IS_LINUX).isTrue(); - assume.that(isSufficientVersionOfLibcxx("opensmtj")).isTrue(); - return; + return IS_LINUX && isSufficientVersionOfLibcxx("opensmtj"); case BITWUZLA: - assume.that(IS_LINUX).isTrue(); - assume.that(isSufficientVersionOfLibcxx("bitwuzlaj")).isTrue(); - return; + return (IS_LINUX && isSufficientVersionOfLibcxx("bitwuzlaj")) + || (IS_WINDOWS && !IS_ARCH_ARM64); case MATHSAT5: - assume.that(IS_LINUX || IS_WINDOWS).isTrue(); - if (IS_LINUX) { - assume.that(isSufficientVersionOfLibcxx("mathsat5j")).isTrue(); - } - return; + return (IS_LINUX && isSufficientVersionOfLibcxx("mathsat5j")) + || (IS_WINDOWS && !IS_ARCH_ARM64); case Z3: - assume.that(IS_LINUX || IS_WINDOWS || IS_MAC).isTrue(); - if (IS_LINUX) { - assume.that(isSufficientVersionOfLibcxx("z3")).isTrue(); - } - return; + return (IS_LINUX && isSufficientVersionOfLibcxx("z3")) || IS_WINDOWS || IS_MAC; default: throw new AssertionError("unexpected solver: " + solverToUse()); } @@ -149,7 +158,7 @@ private String[] getRequiredLibcxx(String library) { case "z3": return new String[] {"GLIBC_2.34", "GLIBCXX_3.4.26", "GLIBCXX_3.4.29"}; case "bitwuzlaj": - return new String[] {"GLIBCXX_3.4.26", "GLIBCXX_3.4.29"}; + return new String[] {"GLIBC_2.33", "GLIBCXX_3.4.26", "GLIBCXX_3.4.29"}; case "opensmtj": return new String[] {"GLIBC_2.33", "GLIBCXX_3.4.26", "GLIBCXX_3.4.29"}; case "mathsat5j": @@ -168,7 +177,7 @@ public final void initSolver() throws InvalidConfigurationException { @Test public void createSolverContextFactoryWithDefaultLoader() throws InvalidConfigurationException { - requireSupportedOperatingSystem(); + requirePlatformSupported(); SolverContextFactory factory = new SolverContextFactory(config, logger, shutdownManager.getNotifier()); @@ -181,14 +190,14 @@ public void createSolverContextFactoryWithDefaultLoader() throws InvalidConfigur @Test public void createSolverContextFactoryWithSystemLoader() throws InvalidConfigurationException { requireNativeLibrary(); - requireSupportedOperatingSystem(); + requirePlatformSupported(); // we assume that no native solvers are installed on the testing machine by default. SolverContextFactory factory = new SolverContextFactory( config, logger, shutdownManager.getNotifier(), System::loadLibrary); assert_() - .that(assertThrows(InvalidConfigurationException.class, () -> factory.generateContext())) + .that(assertThrows(InvalidConfigurationException.class, factory::generateContext)) .hasCauseThat() .isInstanceOf(UnsatisfiedLinkError.class); } @@ -197,7 +206,7 @@ public void createSolverContextFactoryWithSystemLoader() throws InvalidConfigura public void createSolverContextFactoryWithSystemLoaderForJavaSolver() throws InvalidConfigurationException { requireNoNativeLibrary(); - requireSupportedOperatingSystem(); + requirePlatformSupported(); SolverContextFactory factory = new SolverContextFactory( @@ -207,4 +216,30 @@ public void createSolverContextFactoryWithSystemLoaderForJavaSolver() FormulaManager mgr = context.getFormulaManager(); } } + + /** Negative test for failing to load native library. */ + @Test + public void testFailToLoadNativeLibraryWithInvalidOperatingSystem() + throws InvalidConfigurationException { + requireNativeLibrary(); + requirePlatformNotSupported(); + + SolverContextFactory factory = + new SolverContextFactory(config, logger, shutdownManager.getNotifier()); + + // Verify that creating the context fails with UnsatisfiedLinkError + InvalidConfigurationException thrown = + assertThrows( + "Expected InvalidConfigurationException due to failure in loading native library", + InvalidConfigurationException.class, + factory::generateContext); + assert_().that(thrown).hasCauseThat().isInstanceOf(UnsatisfiedLinkError.class); + assert_() + .that(thrown) + .hasMessageThat() + .startsWith( + String.format( + "The SMT solver %s is not available on this machine because of missing libraries ", + solverToUse())); + } } diff --git a/src/org/sosy_lab/java_smt/test/SolverContextTest.java b/src/org/sosy_lab/java_smt/test/SolverContextTest.java index ae43a00463..bef2574fb3 100644 --- a/src/org/sosy_lab/java_smt/test/SolverContextTest.java +++ b/src/org/sosy_lab/java_smt/test/SolverContextTest.java @@ -144,7 +144,7 @@ public void testCVC5WithValidOptions() throws InvalidConfigurationException { } } - @Test(timeout = 1000) + @Test(timeout = 5000) @SuppressWarnings({"try", "CheckReturnValue"}) public void testCVC5WithValidOptionsTimeLimit() throws InvalidConfigurationException, InterruptedException {