diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-09-30 10:02:31 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-30 10:02:31 -0500 |
| commit | 21f0caf2fc3114d70eabe62ffdd3305ab684c365 (patch) | |
| tree | 31e43c1b990670d8d251e0310d8f6fc1b1243d55 /bin | |
| parent | f950cfdb6145b7a251f3c12f3eee14b295a4b374 (diff) | |
| parent | 7beef0748745aaa01b717dbde294365ec7a1dc36 (diff) | |
| download | slskd-21f0caf2fc3114d70eabe62ffdd3305ab684c365.tar.gz | |
Merge branch 'master' into dockerfile
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/benchmark | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/bin/benchmark b/bin/benchmark new file mode 100755 index 00000000..33e11f33 --- /dev/null +++ b/bin/benchmark @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +set -e +set -o pipefail + +test_name="" + +while test $# -gt 0; do + case "$1" in + -h|--help) + echo '' + echo 'usage: benchmark --test <name>' + echo '' + echo 'options:' + echo '-h, --help show help' + echo '--test NAME name (or substring, case-insensitive) of the benchmark test class to run' + echo '' + echo 'examples:' + echo ' benchmark --test helloworld' + echo '' + exit 0 + ;; + --test) + shift + test_name=$1 + shift + ;; + *) + break + ;; + esac +done + +if [ -z "$test_name" ]; then + echo 'error: --test is required' + exit 1 +fi + +dotnet test tests/slskd.Tests.Benchmarks -c Release -v q --nologo --filter "FullyQualifiedName~$test_name" --logger "console;verbosity=detailed" \ + | sed -n '/BenchmarkRunner: Start/,/BenchmarkRunner: End/p' |
