Skip to content

Commit d4a9373

Browse files
authored
Merge pull request #27 from coord-e/coord-e/include-pcsat-in-devcontainer
Enable to run all specs in DevContainer
2 parents af9b33c + 59f4cfc commit d4a9373

File tree

5 files changed

+21
-24
lines changed

5 files changed

+21
-24
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@
99
]
1010
}
1111
},
12+
"features": {
13+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
14+
},
1215
"postCreateCommand": "rustup show"
1316
}

.github/workflows/ci.yml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,12 @@ jobs:
2626
permissions:
2727
contents: read
2828
env:
29+
# see tests/thrust-pcsat-wrapper
2930
COAR_IMAGE: ghcr.io/hiroshi-unno/coar@sha256:73144ed27a02b163d1a71b41b58f3b5414f12e91326015600cfdca64ff19f011
3031
steps:
3132
- uses: actions/checkout@v4
3233
- uses: ./.github/actions/setup-z3
33-
- name: Setup thrust-pcsat-wrapper
34-
run: |
35-
docker pull "$COAR_IMAGE"
36-
37-
cat <<"EOF" > thrust-pcsat-wrapper
38-
#!/bin/bash
39-
40-
smt2=$(mktemp -p . --suffix .smt2)
41-
trap "rm -f $smt2" EXIT
42-
cp "$1" "$smt2"
43-
out=$(
44-
docker run --rm -v "$PWD:/mnt" -w /root/coar "$COAR_IMAGE" \
45-
main.exe -c ./config/solver/pcsat_tbq_ar.json -p pcsp "/mnt/$smt2"
46-
)
47-
exit_code=$?
48-
echo "${out%,*}"
49-
exit "$exit_code"
50-
EOF
51-
chmod +x thrust-pcsat-wrapper
52-
53-
mkdir -p ~/.local/bin
54-
mv thrust-pcsat-wrapper ~/.local/bin/thrust-pcsat-wrapper
34+
- run: docker pull "$COAR_IMAGE"
5535
- run: rustup show
5636
- uses: Swatinem/rust-cache@v2
5737
- run: cargo test

tests/thrust-pcsat-wrapper

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
COAR_IMAGE=${COAR_IMAGE:-ghcr.io/hiroshi-unno/coar:main}
4+
5+
smt2=$(mktemp -p . --suffix .smt2)
6+
trap "rm -f $smt2" EXIT
7+
cp "$1" "$smt2"
8+
out=$(
9+
docker run --rm -v "$PWD:/mnt" -w /root/coar "$COAR_IMAGE" \
10+
main.exe -c ./config/solver/pcsat_tbq_ar.json -p pcsp "/mnt/$smt2"
11+
)
12+
exit_code=$?
13+
echo "${out%,*}"
14+
exit "$exit_code"

tests/ui/fail/annot_exists.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@error-in-other-file: Unsat
22
//@compile-flags: -C debug-assertions=off
3-
//@rustc-env: THRUST_SOLVER=thrust-pcsat-wrapper
3+
//@rustc-env: THRUST_SOLVER=tests/thrust-pcsat-wrapper
44

55
#[thrust::trusted]
66
#[thrust::callable]

tests/ui/pass/annot_exists.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@check-pass
22
//@compile-flags: -C debug-assertions=off
3-
//@rustc-env: THRUST_SOLVER=thrust-pcsat-wrapper
3+
//@rustc-env: THRUST_SOLVER=tests/thrust-pcsat-wrapper
44

55
#[thrust::trusted]
66
#[thrust::callable]

0 commit comments

Comments
 (0)