the DejaGnu site has links to these. For running the BRIG frontend
tests, a tool to assemble the binary BRIGs from HSAIL text,
@uref{https://github.com/HSAFoundation/HSAIL-Tools/,,HSAILasm} must
-be installed.
+be installed. Some optional tests also require Python3 and pytest module.
If the directories where @command{runtest} and @command{expect} were
installed are not in the @env{PATH}, you may need to set the following
return $failed
}
+proc gcov-pytest-format-line { args } {
+ global subdir
+
+ set testcase [lindex $args 0]
+ set pytest_script [lindex $args 1]
+ set output_line [lindex $args 2]
+
+ set index [string first "::" $output_line]
+ set test_output [string range $output_line [expr $index + 2] [string length $output_line]]
+
+ return "$subdir/$testcase ${pytest_script}::${test_output}"
+}
+
# Call by dg-final to run gcov --json-format which produces a JSON file
# that is later analysed by a pytest Python script.
# We pass filename of a test via GCOV_PATH environment variable.
set testcase [remote_download host $testcase]
set result [remote_exec host $GCOV "$testcase -i"]
- set result [remote_exec host "pytest -m pytest --version"]
+ set pytest_cmd "python3 -m pytest --color=no -rap -s --tb=no"
+ set result [remote_exec host "$pytest_cmd --version"]
set status [lindex $result 0]
if { $status != 0 } then {
- unresolved "could not find Python interpreter and (or) pytest module for $testcase"
+ unsupported "$subdir/$testcase run-gcov-pytest python3 pytest missing"
return
}
set pytest_script [lindex $args 1]
setenv GCOV_PATH $testcase
- verbose "pytest_script: $pytest_script" 2
- spawn -noecho python3 -m pytest --color=no -rA -s --tb=no $srcdir/$subdir/$pytest_script
+ verbose "pytest_script: $srcdir $subdir $pytest_script" 2
+ spawn -noecho python3 -m pytest --color=no -rap -s --tb=no $srcdir/$subdir/$pytest_script
set prefix "\[^\r\n\]*"
expect {
-re "FAILED($prefix)\[^\r\n\]+\r\n" {
- fail "$expect_out(1,string)"
+ set output [gcov-pytest-format-line $testcase $pytest_script $expect_out(1,string)]
+ fail $output
exp_continue
}
-re "ERROR($prefix)\[^\r\n\]+\r\n" {
- fail "$expect_out(1,string)"
+ set output [gcov-pytest-format-line $testcase $pytest_script $expect_out(1,string)]
+ fail $output
exp_continue
}
-re "PASSED($prefix)\[^\r\n\]+\r\n" {
- pass "$expect_out(1,string)"
+ set output [gcov-pytest-format-line $testcase $pytest_script $expect_out(1,string)]
+ pass $output
exp_continue
}
}