#!/usr/bin/env bash # Regenerates every file under output/ : the tests write 01-05, the compiler writes 06. set -euo pipefail cd "$(dirname "$0")/.." rm -f output/*.txt mvn -B -q test javac --release 25 -d /tmp/q18-broken src/broken/Q18Broken.java 2> output/06-q18-compile-error.txt || true # keep only the compiler's own diagnostic, not the JAVA_TOOL_OPTIONS banner or the file path prefix sed -i -e '/^Picked up JAVA_TOOL_OPTIONS/d' -e 's#^src/broken/##' output/06-q18-compile-error.txt { java -version 2>&1 | grep -v '^Picked up' | head -1 echo "tests: $(grep -h -o 'tests="[0-9]*"' target/surefire-reports/TEST-*.xml | tr -dc '0-9\n' | paste -sd+ | bc)" } > output/00-environment.txt ls output