Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
]
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"postCreateCommand": "rustup show"
}
24 changes: 2 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions tests/thrust-pcsat-wrapper
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion tests/ui/fail/annot_exists.rs
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/pass/annot_exists.rs
Original file line number Diff line number Diff line change
@@ -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]
Expand Down