...

Text file src/nhooyr.io/websocket/ci/test.sh

Documentation: nhooyr.io/websocket/ci

     1#!/bin/sh
     2set -eu
     3cd -- "$(dirname "$0")/.."
     4
     5(
     6  cd ./internal/examples
     7  go test "$@" ./...
     8)
     9(
    10  cd ./internal/thirdparty
    11  go test "$@" ./...
    12)
    13
    14go install github.com/agnivade/wasmbrowsertest@latest
    15go test --race --bench=. --timeout=1h --covermode=atomic --coverprofile=ci/out/coverage.prof --coverpkg=./... "$@" ./...
    16sed -i.bak '/stringer\.go/d' ci/out/coverage.prof
    17sed -i.bak '/nhooyr.io\/websocket\/internal\/test/d' ci/out/coverage.prof
    18sed -i.bak '/examples/d' ci/out/coverage.prof
    19
    20# Last line is the total coverage.
    21go tool cover -func ci/out/coverage.prof | tail -n1
    22
    23go tool cover -html=ci/out/coverage.prof -o=ci/out/coverage.html

View as plain text