From 73df946d56c74384511a194dd01dbe099584fd1a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 15:14:23 +0200 Subject: Adding upstream version 1.16.10. Signed-off-by: Daniel Baumann --- src/cmd/compile/internal/ssa/gen/cover.bash | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 src/cmd/compile/internal/ssa/gen/cover.bash (limited to 'src/cmd/compile/internal/ssa/gen/cover.bash') diff --git a/src/cmd/compile/internal/ssa/gen/cover.bash b/src/cmd/compile/internal/ssa/gen/cover.bash new file mode 100755 index 0000000..6c860fc --- /dev/null +++ b/src/cmd/compile/internal/ssa/gen/cover.bash @@ -0,0 +1,26 @@ +#!/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 *.go' usage to run the generator. + +cat >main_test.go <<-EOF + // +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 -- cgit v1.2.3