Brian Silverman | 4e662aa | 2022-05-11 23:10:19 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Using this stress test |
| 4 | # 1. cargo build |
| 5 | # 2. Spot what error message appears (because something will) |
| 6 | # 3. Create a new directory and cd into it |
| 7 | # 4. Run this script passing the error message as an argument |
| 8 | # 5. Wait (consider running tail -f nohup.out) |
| 9 | # 6. Several days later, a minimized test case should appear in nohup.out. |
| 10 | |
| 11 | set -e |
| 12 | |
| 13 | PROBLEM="$1" |
| 14 | SCRIPT_DIR=$(dirname "$(readlink -f "$0")") |
| 15 | TEST_CASE_DIR=$(pwd) |
| 16 | |
| 17 | if [ !-n "$PROBLEM" ]; then |
| 18 | echo "Specify a compile error as an argument" |
| 19 | exit -1 |
| 20 | fi |
| 21 | |
| 22 | echo "About to minimize stress test. Problem is '$PROBLEM' and script dir is '$SCRIPT_DIR'. Test case dir is $TEST_CASE_DIR" |
| 23 | |
| 24 | REPRO_CASE="$TEST_CASE_DIR/repro.json" |
| 25 | |
| 26 | pushd $SCRIPT_DIR |
| 27 | touch src/main.rs |
| 28 | echo Building with repro case |
| 29 | AUTOCXX_REPRO_CASE=$REPRO_CASE cargo build --release || true |
| 30 | echo Built. |
| 31 | popd |
| 32 | |
| 33 | echo Building autocxx-reduce and friends |
| 34 | pushd $SCRIPT_DIR/../.. |
| 35 | cargo build --all --release |
| 36 | popd |
| 37 | |
| 38 | echo Starting reduction |
| 39 | nohup $SCRIPT_DIR/../../target/release/autocxx-reduce --problem "$PROBLEM" -k --clang-arg=-std=c++17 --creduce-arg=--n --creduce-arg=192 repro -r "$REPRO_CASE" & |
| 40 | echo Reduction underway. Consider using tail -f nohup.out. |
| 41 | |