From patchwork Tue Jan 18 09:32:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 50143 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CA2DC3857C5C for ; Tue, 18 Jan 2022 09:32:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id ED4333858D28 for ; Tue, 18 Jan 2022 09:32:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ED4333858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0B3BE212BB for ; Tue, 18 Jan 2022 09:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1642498351; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WFYiS5ApKVmTZyDXqtCUhe1DEqKKRc7fmUz20UzSkA4=; b=t3Fw+138jIPzMlQbdYRc6vw2aeeXXeBfoxeg2nASh2gSM0NXnxbKl2DENk6T0OazboDYa9 bOvLDMCRQbJguMkatFjW5q/ceSHYAzIpl51lOVoJxEuen27OLHIaG4BBP/mEuift4S8X6v EGQov31ns/JZNzosAJ+1lqAITTh67D0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1642498351; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WFYiS5ApKVmTZyDXqtCUhe1DEqKKRc7fmUz20UzSkA4=; b=i5jC1BV4DVsmo7rtt0H0Tk2fMOAlj6gI1HM2SHi+eKMfCFq5XVzXGY+Ye0ZuiM42mHLkPv leZ4myfifFYTnjDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id F0F4413B26 for ; Tue, 18 Jan 2022 09:32:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MRXMOS6J5mGrCgAAMHmgww (envelope-from ) for ; Tue, 18 Jan 2022 09:32:30 +0000 Message-ID: Date: Tue, 18 Jan 2022 10:32:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH][pushed] Add check_effective_target_python3_module. To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" The patch adds detection of non-standard 'unicode' python module. Martin 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. --- 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 { } {