public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-6661] Add check_effective_target_python3_module.
Date: Tue, 18 Jan 2022 09:32:52 +0000 (GMT)	[thread overview]
Message-ID: <20220118093252.DC2FB385802F@sourceware.org> (raw)

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 { } {


                 reply	other threads:[~2022-01-18  9:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220118093252.DC2FB385802F@sourceware.org \
    --to=marxin@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).