| Linux in-mum-web1499.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64 Path : /opt/golang/1.22.0/src/cmd/compile/internal/ssa/_gen/ |
| Current File : //opt/golang/1.22.0/src/cmd/compile/internal/ssa/_gen/cover.bash |
#!/usr/bin/env bash
# Copyright 2020 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# A quick and dirty way to obtain code coverage from rulegen's main func. For
# example:
#
# ./cover.bash && go tool cover -html=cover.out
#
# This script is needed to set up a temporary test file, so that we don't break
# regular 'go run .' usage to run the generator.
cat >main_test.go <<-EOF
//go:build ignore
package main
import "testing"
func TestCoverage(t *testing.T) { main() }
EOF
go test -run='^TestCoverage$' -coverprofile=cover.out "$@" *.go
rm -f main_test.go