public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6629] Add check_effective_target_pytest3.
@ 2022-01-17 10:28 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2022-01-17 10:28 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4460c638fafddef1df1d35efc52ca1e339b54342

commit r12-6629-g4460c638fafddef1df1d35efc52ca1e339b54342
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Jan 17 11:27:59 2022 +0100

    Add check_effective_target_pytest3.
    
    gcc/testsuite/ChangeLog:
    
            * lib/gcov.exp: Use check_effective_target_pytest3.
            * lib/target-supports.exp: Add check_effective_target_pytest3.

Diff:
---
 gcc/testsuite/lib/gcov.exp            |  9 ++++-----
 gcc/testsuite/lib/target-supports.exp | 12 ++++++++++++
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/gcc/testsuite/lib/gcov.exp b/gcc/testsuite/lib/gcov.exp
index dfa1b3686ab..6c57515e229 100644
--- a/gcc/testsuite/lib/gcov.exp
+++ b/gcc/testsuite/lib/gcov.exp
@@ -17,6 +17,8 @@
 # Verify various kinds of gcov output: line counts, branch percentages,
 # and call return percentages.  None of this is language-specific.
 
+load_lib "target-supports.exp"
+
 global GCOV
 
 #
@@ -274,11 +276,8 @@ proc run-gcov-pytest { args } {
     set testcase [remote_download host $testcase]
     set result [remote_exec host $GCOV "$testcase -i"]
 
-    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 {
-      unsupported "$subdir/$testcase run-gcov-pytest python3 pytest missing"
+    if { ![check_effective_target_pytest3] } {
+      unsupported "$script pytest python3 is missing"
       return
     }
 
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 12c5ca5da33..fd48475a57c 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -11734,3 +11734,15 @@ proc check_effective_target_python3 { } {
         return 0;
     }
 }
+
+# Return 1 if pytest module is available for python3.
+
+proc check_effective_target_pytest3 { } {
+    set result [remote_exec host "python3 -m pytest --color=no -rap -s --tb=no --version"]
+    set status [lindex $result 0]
+    if { $status == 0 } then {
+        return 1;
+    } else {
+        return 0;
+    }
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-17 10:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17 10:28 [gcc r12-6629] Add check_effective_target_pytest3 Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).