File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ #  Copyright (C) 2024-2025 SUSE LLC. All rights reserved.
3+ #  Use of this source code is governed by a BSD-style
4+ #  license that can be found in the LICENSE file.
5+ 
6+ set  -Eeuo pipefail
7+ 
8+ root=" $( readlink -f " $( dirname " ${BASH_SOURCE[0]} " )  /.." ) " 
9+ pushd  " $root " 
10+ 
11+ GO=" ${GO:- go} " 
12+ 
13+ silent=
14+ verbose=
15+ long=
16+ while  getopts  " svL"   opt;  do 
17+ 	case  " $opt "   in 
18+ 		s)
19+ 			silent=1
20+ 			;;
21+ 		v)
22+ 			verbose=1
23+ 			;;
24+ 		L)
25+ 			long=1
26+ 			;;
27+ 		* )
28+ 			echo  " $0  [-s(ilent)]" 
29+ 			exit  1
30+ 	esac 
31+ done 
32+ 
33+ gocoverdir=" $( mktemp --tmpdir -d gocoverdir.XXXXXXXX) " 
34+ trap  ' rm -rf $gocoverdir'   EXIT
35+ 
36+ test_args=()
37+ [ -n  " $verbose "   ] &&  test_args+=(" -v"  )
38+ [ -z  " $long "   ] &&  test_args+=(" -short"  )
39+ 
40+ " $GO "   test  -count 1 -cover -test.gocoverdir=" $gocoverdir "   " ${test_args[@]} "   ./...
41+ sudo " $GO "   test  -count 1 -cover -test.gocoverdir=" $gocoverdir "   " ${test_args[@]} "   ./...
42+ 
43+ " $GO "   tool covdata percent -i " $gocoverdir " 
44+ [ -n  " $silent "   ] ||  " $GO "   tool covdata func -i " $gocoverdir "   |  sort -k 3gr
45+ 
46+ gocoverage=" $( mktemp gocoverage.XXXXXXXX) " 
47+ trap  ' rm $gocoverage'   EXIT
48+ 
49+ " $GO "   tool covdata textfmt -i " $gocoverdir "   -o " $gocoverage " 
50+ [ -n  " $silent "   ] ||  " $GO "   tool cover -html=" $gocoverage " 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments