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

https://gcc.gnu.org/g:e8feb059ca2b3fb50a1ccec01a49f119ec223084

commit r12-6661-ge8feb059ca2b3fb50a1ccec01a49f119ec223084
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Jan 18 10:31:15 2022 +0100

    Add check_effective_target_python3_module.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.src/maintainers.exp: Use
            check_effective_target_python3_module for checking of unicode
            module.
            * lib/target-supports.exp: Add
            check_effective_target_python3_module.

Diff:
---
 gcc/testsuite/gcc.src/maintainers.exp |  6 ++++++
 gcc/testsuite/lib/target-supports.exp | 12 ++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/gcc/testsuite/gcc.src/maintainers.exp b/gcc/testsuite/gcc.src/maintainers.exp
index a4b3986be77..045f7ec0f67 100644
--- a/gcc/testsuite/gcc.src/maintainers.exp
+++ b/gcc/testsuite/gcc.src/maintainers.exp
@@ -29,6 +29,12 @@ proc gcc_src_run_maintainers_verify_sh {} {
       return
     }
 
+    if { ![check_effective_target_python3_module "unidecode"] } {
+      unsupported "$script 'unidecode' python3 module is missing"
+      return
+    }
+
+
     set result [remote_exec host $contrib/$script $maintainers]
     set status [lindex $result 0]
     if { $status == 0 } then {
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index fbb6c735223..cffcdb5f049 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -11735,6 +11735,18 @@ proc check_effective_target_recent_python3 { } {
     }
 }
 
+# Return 1 if python3 contains a module
+
+proc check_effective_target_python3_module { module } {
+    set result [remote_exec host "python3 -c \"import $module\""]
+    set status [lindex $result 0]
+    if { $status == 0 } then {
+        return 1;
+    } else {
+        return 0;
+    }
+}
+
 # Return 1 if pytest module is available for python3.
 
 proc check_effective_target_pytest3 { } {


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

only message in thread, other threads:[~2022-01-18  9:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18  9:32 [gcc r12-6661] Add check_effective_target_python3_module 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).