File: test_profiling.sh

package info (click to toggle)
nethsm-pkcs11 2.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,248 kB
  • sloc: ansic: 1,511; sh: 943; makefile: 31
file content (21 lines) | stat: -rwxr-xr-x 573 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

set -e

export LLVM_PROFILE_FILE="${PWD}/profile/%p-%m.profraw"

rm -rf _test_objects

# run normal tests
RUSTFLAGS="-C instrument-coverage" cargo test --all-targets

# run tests that require to be run in a single thread
RUSTFLAGS="-C instrument-coverage" cargo test --all-targets -- --test-threads=1  --ignored


files=$(RUSTFLAGS="-C instrument-coverage" cargo test --tests --no-run --message-format=json | jq -r "select(.profile.test == true) | .filenames[]" | grep -v dSYM - )

for file in $files;
do 
  printf "%s %s " -object $file >> _test_objects
done