From patchwork Wed Jul 12 02:40:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 786936 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 3x6jrN3Nllz9s7C for ; Wed, 12 Jul 2017 12:41:24 +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="NGoasAZf"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 84127872CC; Wed, 12 Jul 2017 02:41:17 +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 f9FZK-xwDG9x; Wed, 12 Jul 2017 02:41:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 871E987275; Wed, 12 Jul 2017 02:41:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id D67B21C0ACA for ; Wed, 12 Jul 2017 02:41:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D03FA2E0DF for ; Wed, 12 Jul 2017 02:41:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QIZlJZzh2sJ7 for ; Wed, 12 Jul 2017 02:41:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by silver.osuosl.org (Postfix) with ESMTPS id 82DCA2D1F1 for ; Wed, 12 Jul 2017 02:41:01 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id z6so1295347pfk.3 for ; Tue, 11 Jul 2017 19:41:01 -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=Q41VQ8w2oYfNwviZ41yWfvbTHt9KarkQbvdnJhJsdl4=; b=NGoasAZf/62MNUKHFw2UkII1HYhxEnlz3arUuCzL9Zk9hU+j46F4hQ1g4C87NqSGGS /f+da8c2s6e/Fi7p/E8ZJKqcvQTA96NaFcmRRiYCLK6VrgEH/Chk7DDNNgaMhKDzZ+EG L1fRSkwTijvZptrg1xKXq+GvouwpWOAM3NrHo2dUTGXDuERFomNPguqSxHjFuiBlrCdV RkpUJXsq09VClmlvMIGNyBz+npicTzPAnxkIDAsc08/SruOkjnY2QoczZ8QyzLF+vhp5 HDz5Kd1s9tXN+p6FMX7+cFSfu8V35JoceTkyJ7i7+Mvj8KjZGUEDBIdx1/o6v3pSnzJG 1U/A== 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=Q41VQ8w2oYfNwviZ41yWfvbTHt9KarkQbvdnJhJsdl4=; b=qI61STzDwAo8BYPYZspOHy1vu7PY/ZNmyqC2uvfxpektNnSLekE3rHIeQQX4TBGMj1 IwEIgIHdu+U8wkUyRHoxZ3Fsq3wnuXudJDJoE6QSyVFH5FvnK544+MrQgF4XjVB0kBwU hfAxA5rQxjFtZQuTRFmf7nceczPFbY6X+IG9KDMdE1UuH06BcZ4dVIBXm70PD/0OQhP8 h6vGzsyYrQme6AuY4BpeMgqCqgwshgeEdrMKepM39djkkbB86n0tkvYT5fUR4yiFPWC4 0UV6ZAie+tOsZBc5TM838WRRCyCeBIwV41jrqVRzg+uZi5G5rOqBVAjEisF7BohDrakS Uwig== X-Gm-Message-State: AIVw112J7TnObJUv1/ofozvwIZbRodzOZ+CEYFk+Sl0197/2g5bcDX4d d4t/DsgkNm6FdjQq7nM= X-Received: by 10.98.96.66 with SMTP id u63mr28092739pfb.68.1499827260942; Tue, 11 Jul 2017 19:41:00 -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:00 -0700 (PDT) From: Andrey Smirnov To: buildroot@buildroot.org Date: Tue, 11 Jul 2017 19:40:06 -0700 Message-Id: <20170712024009.2366-4-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 3/6] testing/tests/package/test_python: add TestPython3 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" Add Python3 version of TestPython2 to make sure both versions of Python get unit-tested. Modify the code of libc_time_test() to support that change (convert the code to use Python3-style "print"). Signed-off-by: Andrey Smirnov --- support/testing/tests/package/test_python.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/support/testing/tests/package/test_python.py b/support/testing/tests/package/test_python.py index 250827e..218235b 100644 --- a/support/testing/tests/package/test_python.py +++ b/support/testing/tests/package/test_python.py @@ -26,9 +26,10 @@ BR2_TARGET_ROOTFS_CPIO=y self.assertEqual(exit_code, 0) def libc_time_test(self): - cmd = "python -c 'import ctypes;" + cmd = "python -c 'from __future__ import print_function;" + cmd += "import ctypes;" cmd += "libc = ctypes.cdll.LoadLibrary(\"libc.so.1\");" - cmd += "print libc.time(None)'" + cmd += "print(libc.time(None))'" _, exit_code = self.emulator.run(cmd) self.assertEqual(exit_code, 0) @@ -48,3 +49,15 @@ BR2_PACKAGE_PYTHON=y self.math_floor_test() self.libc_time_test() self.zlib_test() + +class TestPython3(TestPythonBase): + config = TestPythonBase.config + \ +""" +BR2_PACKAGE_PYTHON3=y +""" + def test_run(self): + self.login() + self.version_test("Python 3") + self.math_floor_test() + self.libc_time_test() + self.zlib_test()