1
0
mirror of https://github.com/square/okhttp.git synced 2025-08-10 11:03:02 +03:00
Files
okhttp/fuzzing/fuzzingserver-test.sh
Jesse Wilson 9837fea768 Move tests from okhttp-tests/src/test/java to okhttp/src/test/java
The previous module structure was necessary because Maven wouldn't allow
mockwebserver to depend on okhttp/src and for okhttp/test to depend on
mockwebserver. With Gradle this constraint is lifted and we can fold
everything into a single module.

I'm in a rush to do this now because it's necessary for Kotlin 'internal'
tests to be in the same module.
2019-03-25 21:01:32 -05:00

29 lines
673 B
Bash
Executable File

#!/usr/bin/env bash
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
cd "$SCRIPT_DIR"
which wstest
if [ $? != 0 ]; then
echo "Run 'pip install autobahntestsuite', maybe with 'sudo'."
exit 1
fi
which jq
if [ $? != 0 ]; then
echo "Run 'brew install jq'"
exit 1
fi
trap 'kill $(jobs -pr)' SIGINT SIGTERM EXIT
set -ex
wstest -m fuzzingserver -s fuzzingserver-config.json &
sleep 2 # wait for wstest to start
java -jar target/okhttp-tests-*-jar-with-dependencies.jar
jq '.[] as $in | $in | keys[] | . + " " + $in[.].behavior' target/fuzzingserver-report/index.json > target/fuzzingserver-actual.txt
diff fuzzingserver-expected.txt target/fuzzingserver-actual.txt