1 # Copyright
(C
) 1997-2022 Free Software Foundation
, Inc.
3 # This
program is free software
; you can redistribute it and
/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation
; either version
3 of the License
, or
6 #
(at your option
) any later version.
8 # This
program is distributed in the hope that it will be useful
,
9 # but WITHOUT
ANY WARRANTY
; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License
for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with GCC
; see the file COPYING3.
If not see
15 #
<http
://www.gnu.org
/licenses
/>.
17 # Verify various kinds of gcov output
: line counts
, branch percentages
,
18 # and
call return percentages.
None of this is language
-specific.
20 load_lib
"target-supports.exp"
23 # clean
-p1689
-file
-- delete a working file the compiler creates
for p1689
25 # TESTCASE is the
name of the test.
26 # SUFFIX is file suffix
28 proc clean
-p1689
-file
{ testcase suffix
} {
29 set basename
[file tail $testcase
]
30 set base
[file rootname $basename
]
31 remote_file host
delete $base.$suffix
35 # clean
-p1689
-- delete the working files the compiler creates
for p1689
37 # TESTCASE is the
name of the test.
39 proc clean
-p1689
{ testcase
} {
40 clean
-p1689
-file $testcase
"d"
41 clean
-p1689
-file $testcase
"ddi"
44 #
Call by dg
-final to check a P1689 dependency file
46 proc run
-check
-p1689
-valid
{ depfile template
} {
48 # Extract the test file
name from the arguments.
49 set testcase
[file rootname
[file tail $depfile
]]
51 verbose
"Running P1689 validation for $testcase in $srcdir/$subdir" 2
52 set testcase
[remote_download host $testcase
]
54 set pytest_script
"test-p1689.py"
55 if { ![check_effective_target_recent_python3
] } {
56 unsupported
"$pytest_script python3 is missing"
60 verbose
"running script" 1
61 spawn
-noecho python3 $srcdir
/$subdir
/$pytest_script
--all
--actual $depfile
--expect $srcdir
/$subdir
/$template
64 -re
"ERROR: (\[^\r\n\]*)" {
65 fail $expect_out
(0,string
)
73 proc run
-check
-module
-dep
{ depfile flag expected
} {
75 # Extract the test file
name from the arguments.
76 set testcase
[file rootname
[file tail $depfile
]]
78 verbose
"Verifying dependencies for $testcase in $srcdir/$subdir" 2
79 set testcase
[remote_download host $testcase
]
81 set pytest_script
"test-depfile.py"
82 if { ![check_effective_target_recent_python3
] } {
83 unsupported
"$pytest_script python3 is missing"
87 verbose
"running script test-depfile.py" 1
88 spawn
-noecho python3 $srcdir
/$subdir
/$pytest_script
--all
--depfile $depfile $flag $expected
91 -re
"ERROR: (\[^\r\n\]*)" {
92 fail $expect_out
(0,string
)
98 proc run
-check
-module
-dep
-expect
-input
{ depfile expected
} {
99 run
-check
-module
-dep $depfile
"--expect-input" $expected