From patchwork Wed Jul 12 02:40:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 786935 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x6jrK4kj4z9s7C for ; Wed, 12 Jul 2017 12:41:21 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SkpKXcoX"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 91ACC871CB; Wed, 12 Jul 2017 02:41:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aBR9q-xmJsWd; Wed, 12 Jul 2017 02:41:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id C693A87283; Wed, 12 Jul 2017 02:41:14 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id BFB771C0ACA for ; Wed, 12 Jul 2017 02:41:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B962187196 for ; Wed, 12 Jul 2017 02:41:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G7CO1AKD56iS for ; Wed, 12 Jul 2017 02:41:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 5D6C887172 for ; Wed, 12 Jul 2017 02:41:02 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id q85so1294558pfq.2 for ; Tue, 11 Jul 2017 19:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MHA/d4nSCg36zqK3KaodArwYEON7iY6DqS1gI6yutC8=; b=SkpKXcoXqjeHJa9xq2ca0maRh2YKujUN8KLQn54b4eZ89I5GDYuDviyuNy4I/2wJ7c ooBtZ1ajMm03Q5575MW9sHPycZzp9Xj+vGML0+nP9xNDriON4+4UYXdGHuXf3JBh8Iqx b6NnIdiD5mceJmo6BBWc43kdlKKGV1QzUf99S6luhz8o1sqMBiqjSILf/eFdOc023cN9 BiHyEmUa5y/cZgGvFBSeL3vheHCgVUhgROIroFOSRmgZpZ5Mzr+rbnOkHyOx31xd7Li8 cHLLB9PVjKsj4uuMHfkAmBl09fNee0pX+hJsw4RZF+DMv7FG47mkB/5K284Op+OAACYa IF6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MHA/d4nSCg36zqK3KaodArwYEON7iY6DqS1gI6yutC8=; b=cNEh6SAIlOue5tr58hK72rifi3Eqde52LJvr+kQiwFV2Z/lMOYdo7aBzhHJlcqMfQL 9DYOwPDKXVGwrVWiKSZPAPPBJaW8XWP9qJra6SeUA7IWhvVHFFLnep4Uty7CyMXtzLho iZ6+A+ymcG8gVj8zv+yFJQ+12gz7XGsKRu7cACkN/yNhDNShL2gq0QJb2hcRgNb2TXgA sWMHZumNYkcbM9ywyZAa6wiHTNM+GwegppVt95noCpdnlTszRoAdZs422B3asJtaLEVt 3E/HaP6AguS6CeSFsMscARUzH/zYvdd4rdq8mg8JJSJPIfytZ5ums5N5ygTno6pLfiVK B/dQ== X-Gm-Message-State: AIVw111rkjvVABgeJw+qsVAR36vdis/aEuC0oHaPegOZ1u1vzbfwwKNm ooSx47FbQx0VZpMOLuo= X-Received: by 10.84.191.131 with SMTP id a3mr1608198pld.279.1499827261785; Tue, 11 Jul 2017 19:41:01 -0700 (PDT) Received: from squirtle.westlake.spaceflightindustries.com ([173.226.206.194]) by smtp.gmail.com with ESMTPSA id h27sm1239640pfd.34.2017.07.11.19.41.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jul 2017 19:41:01 -0700 (PDT) From: Andrey Smirnov To: buildroot@buildroot.org Date: Tue, 11 Jul 2017 19:40:07 -0700 Message-Id: <20170712024009.2366-5-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170712024009.2366-1-andrew.smirnov@gmail.com> References: <20170712024009.2366-1-andrew.smirnov@gmail.com> Cc: Andrey Smirnov Subject: [Buildroot] [PATCH v2 4/6] testing/tests/package/test_python: do not hardcode interpreter name X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In order to be able to leverage the same test code for testing different python interpreters (or wrappers around CPython) allow classes derivate of TestPythonBase to override the name of the executable used to run tests. Signed-off-by: Andrey Smirnov --- support/testing/tests/package/test_python.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/support/testing/tests/package/test_python.py b/support/testing/tests/package/test_python.py index 218235b..a3ec31b 100644 --- a/support/testing/tests/package/test_python.py +++ b/support/testing/tests/package/test_python.py @@ -8,6 +8,8 @@ class TestPythonBase(infra.basetest.BRTest): BR2_TARGET_ROOTFS_CPIO=y # BR2_TARGET_ROOTFS_TAR is not set """ + interpreter = "python" + def login(self): cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") self.emulator.boot(arch="armv5", @@ -16,17 +18,17 @@ BR2_TARGET_ROOTFS_CPIO=y self.emulator.login() def version_test(self, version): - cmd = "python --version 2>&1 | grep '^{}'".format(version) + cmd = self.interpreter + " --version 2>&1 | grep '^{}'".format(version) _, exit_code = self.emulator.run(cmd) self.assertEqual(exit_code, 0) def math_floor_test(self): - cmd = "python -c 'import math; math.floor(12.3)'" + cmd = self.interpreter + " -c 'import math; math.floor(12.3)'" _, exit_code = self.emulator.run(cmd) self.assertEqual(exit_code, 0) def libc_time_test(self): - cmd = "python -c 'from __future__ import print_function;" + cmd = self.interpreter + " -c 'from __future__ import print_function;" cmd += "import ctypes;" cmd += "libc = ctypes.cdll.LoadLibrary(\"libc.so.1\");" cmd += "print(libc.time(None))'" @@ -34,7 +36,7 @@ BR2_TARGET_ROOTFS_CPIO=y self.assertEqual(exit_code, 0) def zlib_test(self): - cmd = "python -c 'import zlib'" + cmd = self.interpreter + " -c 'import zlib'" _, exit_code = self.emulator.run(cmd) self.assertEqual(exit_code, 1)