blob: 0722825db537ca6e9913bf02e984cd093fd2df99 [file] [log] [blame]
Brian Silverman4e662aa2022-05-11 23:10:19 -07001#!/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
11set -e
12
13PROBLEM="$1"
14SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
15TEST_CASE_DIR=$(pwd)
16
17if [ !-n "$PROBLEM" ]; then
18 echo "Specify a compile error as an argument"
19 exit -1
20fi
21
22echo "About to minimize stress test. Problem is '$PROBLEM' and script dir is '$SCRIPT_DIR'. Test case dir is $TEST_CASE_DIR"
23
24REPRO_CASE="$TEST_CASE_DIR/repro.json"
25
26pushd $SCRIPT_DIR
27touch src/main.rs
28echo Building with repro case
29AUTOCXX_REPRO_CASE=$REPRO_CASE cargo build --release || true
30echo Built.
31popd
32
33echo Building autocxx-reduce and friends
34pushd $SCRIPT_DIR/../..
35cargo build --all --release
36popd
37
38echo Starting reduction
39nohup $SCRIPT_DIR/../../target/release/autocxx-reduce --problem "$PROBLEM" -k --clang-arg=-std=c++17 --creduce-arg=--n --creduce-arg=192 repro -r "$REPRO_CASE" &
40echo Reduction underway. Consider using tail -f nohup.out.
41