-
Notifications
You must be signed in to change notification settings - Fork 260
/
Copy pathrun-test.sh
executable file
·31 lines (29 loc) · 1.03 KB
/
run-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
set -e
export nightly=nightly-2017-11-20
triple=unknown
unamestr=`uname`
if [ "$unamestr" = 'Linux' ]; then
triple='x86_64-unknown-linux-gnu'
elif [ "$unamestr" = 'Darwin' ]; then
triple='x86_64-apple-darwin'
fi
rust_dir=$(rustc --print sysroot)
rustfmt=$rust_dir/bin/rustfmt
export LD_LIBRARY_PATH=$rust_dir/lib
# System Integrity Protection on macOS ignores previous export statement
# so export the library path under another name and set it in the child.
export not_LD_LIBRARY_PATH=$rust_dir/lib
export RUST_LOG=c2rust_refactor=info
export RUST_BACKTRACE=1
# PL: I removed the plugin-related arguments since its not clear that
# they are necessary to correctly run the regression test suite.
# export refactor='../../target/debug/c2rust-refactor -P ../.. -p plugin_stub -r alongside'
export refactor_bin='../../../target/debug/c2rust-refactor'
export refactor="$refactor_bin -r alongside"
export rustflags="--edition 2018"
( cd $1; ./run.sh; )
if ! [ -f $1/no-rustfmt ]; then
$rustfmt $1/old.new
fi
diff -wB $1/new.rs $1/old.new