forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a performance test suite and add s2n-quic as a test (rust-lang…
…#1267) * Add s2n-quic as a submodule * Add a script for running performance tests * Add a CI workflow for running performance tests
- Loading branch information
1 parent
217f45a
commit f711e7a
Showing
6 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
# Copyright Kani Contributors | ||
# SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
set -o pipefail | ||
set -o nounset | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
KANI_DIR=$SCRIPT_DIR/.. | ||
|
||
# Build all packages in the workspace | ||
cargo build --workspace | ||
|
||
PERF_DIR="${KANI_DIR}/tests/perf" | ||
|
||
# Copy expected files from overlay directories | ||
to_delete= | ||
for overlay_dir in ${PERF_DIR}/overlays/*/; do | ||
orig_dir=$(basename ${overlay_dir}) | ||
echo "Copying overlays for $orig_dir" | ||
copy_output=$(cp -r -v ${overlay_dir}* ${PERF_DIR}/${orig_dir}/) | ||
copied_files=$(echo ${copy_output} | rev | cut -d' ' -f 1 | rev | tr -d "'") | ||
# Add to the list of files to delete | ||
to_delete="${to_delete} ${copied_files}" | ||
done | ||
|
||
suite="perf" | ||
mode="cargo-kani" | ||
echo "Check compiletest suite=$suite mode=$mode" | ||
cargo run -p compiletest -- --suite $suite --mode $mode | ||
exit_code=$? | ||
|
||
echo "Cleaning up..." | ||
rm ${to_delete} | ||
|
||
echo | ||
if [ $exit_code -eq 0 ]; then | ||
echo "All Kani perf tests completed successfully." | ||
else | ||
echo "***Kani perf tests failed." | ||
fi | ||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright Kani Contributors | ||
# SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
This directory contains "overlay" files (e.g. expected files) that should be copied into directories under perf before running compiletest. | ||
|
||
Explanation: compiletest's cargo-kani mode (which is used for running the perf tests) looks for "<harness-name>.expected" files and runs `cargo kani --harness <harness-name>` for each. | ||
Some of the perf tests are external repositories that are integrated as git submodules, so we cannot commit files in their subtrees. | ||
Thus, we instead commit any files needed under the "overlays" directory, which then get copied over by `kani-perf.sh` before it calls compiletest. | ||
|
||
To create overlay files for `perf/foo`, place them in a `perf/overlays/foo` directory. | ||
They will get copied over following the same directory structure. |
22 changes: 22 additions & 0 deletions
22
tests/perf/overlays/s2n-quic/quic/s2n-quic-core/vectored_copy_fuzz_test.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Status: SUCCESS\ | ||
Description: "assertion failed: a == b" | ||
|
||
Status: SUCCESS\ | ||
Description: "assertion failed: from.len() > from_index" | ||
|
||
Status: SUCCESS\ | ||
Description: "assertion failed: to.len() > to_index" | ||
|
||
Status: SUCCESS\ | ||
Description: "assertion failed: from.len() >= from_offset" | ||
|
||
Status: SUCCESS\ | ||
Description: "assertion failed: to.len() >= to_offset" | ||
|
||
Status: SUCCESS\ | ||
Description: "assertion failed: from.len() >= len" | ||
|
||
Status: SUCCESS\ | ||
Description: "assertion failed: to.len() >= len" | ||
|
||
VERIFICATION:- SUCCESSFUL |