Skip to content

Commit cac1a26

Browse files
committed
Added Miri tests on travis
1 parent c93bdef commit cac1a26

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ matrix:
99
env: DO_FUZZ=true DO_LINT=true
1010
- rust: beta
1111
- rust: nightly
12-
env: DO_BENCH=true
12+
env: DO_BENCH=true DO_MIRI=true
1313
- rust: 1.22.0
1414

1515
script:

contrib/test.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@ then
4343
)
4444
fi
4545

46+
# Miri Checks if told to
47+
# Only supported in nightly
48+
if [ "$DO_MIRI" = true ]
49+
then
50+
(
51+
MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)
52+
echo "Installing latest nightly with Miri: $MIRI_NIGHTLY"
53+
rustup set profile minimal
54+
rustup default "$MIRI_NIGHTLY"
55+
rustup component add miri
56+
cargo miri test -- -- miri_
57+
58+
# Change back to latest nightly possibly without Miri
59+
rustup default nightly
60+
)
61+
fi
62+
4663
# Bench if told to
4764
if [ "$DO_BENCH" = true ]
4865
then

src/miniscript/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ mod tests {
188188

189189
//miri test for unsafe code
190190
#[test]
191-
fn any_unsafe_transmute_miri_test() {
191+
fn miri_test_context_transform() {
192192
let segwit_ms = Segwitv0Script::from_str("andor(pk(),or_i(and_v(vc:pk_h(),hash160(1111111111111111111111111111111111111111)),older(1008)),pk())").unwrap();
193193
let legacy_ms = LegacyScript::from_str("andor(pk(),or_i(and_v(vc:pk_h(),hash160(1111111111111111111111111111111111111111)),older(1008)),pk())").unwrap();
194194

0 commit comments

Comments
 (0)