From 59f4cfc25c40eef612958f905424b054372cf041 Mon Sep 17 00:00:00 2001 From: coord_e Date: Mon, 2 Feb 2026 15:42:04 +0000 Subject: [PATCH] Enable to run all specs in DevContainer --- .devcontainer/devcontainer.json | 3 +++ .github/workflows/ci.yml | 24 ++---------------------- tests/thrust-pcsat-wrapper | 14 ++++++++++++++ tests/ui/fail/annot_exists.rs | 2 +- tests/ui/pass/annot_exists.rs | 2 +- 5 files changed, 21 insertions(+), 24 deletions(-) create mode 100755 tests/thrust-pcsat-wrapper diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a051952a..86664722 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,5 +9,8 @@ ] } }, + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {} + }, "postCreateCommand": "rustup show" } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0af98b5e..5c8ef498 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,32 +26,12 @@ jobs: permissions: contents: read env: + # see tests/thrust-pcsat-wrapper COAR_IMAGE: ghcr.io/hiroshi-unno/coar@sha256:73144ed27a02b163d1a71b41b58f3b5414f12e91326015600cfdca64ff19f011 steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-z3 - - name: Setup thrust-pcsat-wrapper - run: | - docker pull "$COAR_IMAGE" - - cat <<"EOF" > thrust-pcsat-wrapper - #!/bin/bash - - smt2=$(mktemp -p . --suffix .smt2) - trap "rm -f $smt2" EXIT - cp "$1" "$smt2" - out=$( - docker run --rm -v "$PWD:/mnt" -w /root/coar "$COAR_IMAGE" \ - main.exe -c ./config/solver/pcsat_tbq_ar.json -p pcsp "/mnt/$smt2" - ) - exit_code=$? - echo "${out%,*}" - exit "$exit_code" - EOF - chmod +x thrust-pcsat-wrapper - - mkdir -p ~/.local/bin - mv thrust-pcsat-wrapper ~/.local/bin/thrust-pcsat-wrapper + - run: docker pull "$COAR_IMAGE" - run: rustup show - uses: Swatinem/rust-cache@v2 - run: cargo test diff --git a/tests/thrust-pcsat-wrapper b/tests/thrust-pcsat-wrapper new file mode 100755 index 00000000..448b0ea5 --- /dev/null +++ b/tests/thrust-pcsat-wrapper @@ -0,0 +1,14 @@ +#!/bin/bash + +COAR_IMAGE=${COAR_IMAGE:-ghcr.io/hiroshi-unno/coar:main} + +smt2=$(mktemp -p . --suffix .smt2) +trap "rm -f $smt2" EXIT +cp "$1" "$smt2" +out=$( +docker run --rm -v "$PWD:/mnt" -w /root/coar "$COAR_IMAGE" \ + main.exe -c ./config/solver/pcsat_tbq_ar.json -p pcsp "/mnt/$smt2" +) +exit_code=$? +echo "${out%,*}" +exit "$exit_code" diff --git a/tests/ui/fail/annot_exists.rs b/tests/ui/fail/annot_exists.rs index 888b2ece..2558b595 100644 --- a/tests/ui/fail/annot_exists.rs +++ b/tests/ui/fail/annot_exists.rs @@ -1,6 +1,6 @@ //@error-in-other-file: Unsat //@compile-flags: -C debug-assertions=off -//@rustc-env: THRUST_SOLVER=thrust-pcsat-wrapper +//@rustc-env: THRUST_SOLVER=tests/thrust-pcsat-wrapper #[thrust::trusted] #[thrust::callable] diff --git a/tests/ui/pass/annot_exists.rs b/tests/ui/pass/annot_exists.rs index 95151e96..1496c7f9 100644 --- a/tests/ui/pass/annot_exists.rs +++ b/tests/ui/pass/annot_exists.rs @@ -1,6 +1,6 @@ //@check-pass //@compile-flags: -C debug-assertions=off -//@rustc-env: THRUST_SOLVER=thrust-pcsat-wrapper +//@rustc-env: THRUST_SOLVER=tests/thrust-pcsat-wrapper #[thrust::trusted] #[thrust::callable]