From patchwork Fri Nov 2 04:12:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martincoski X-Patchwork-Id: 992179 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MJQyFa4u"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42mTGT2j5QzB4R2 for ; Fri, 2 Nov 2018 15:13:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id EA62A25489; Fri, 2 Nov 2018 04:13:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nH8k2F9CapVz; Fri, 2 Nov 2018 04:13:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id CE3F624F56; Fri, 2 Nov 2018 04:13:50 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 550021BF4DA for ; Fri, 2 Nov 2018 04:13:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4D98486D2F for ; Fri, 2 Nov 2018 04:13:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jiyZywR5YwPW for ; Fri, 2 Nov 2018 04:13:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by whitealder.osuosl.org (Postfix) with ESMTPS id 7BEE586C80 for ; Fri, 2 Nov 2018 04:13:48 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id 189so1113988qkj.8 for ; Thu, 01 Nov 2018 21:13:48 -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 :in-reply-to:references; bh=o55TOBoIa/CMo6KOrYfZSFWjktfMMhoMogWwHtMYRrg=; b=MJQyFa4uGwerWxy7GFNS0E2es+BZg5MYvzqJPOI3gKNZAderiC0n9u0NW3lC/HLDEj mTsmWLJb4FfVerqF44P9ZtAzuN1+xgj5nvkuIIvj8DE0XBHVjFgIfJeXJ3OZQq7tlofp PebgUk1PUZrakovSTqEWtRaqTQod4U3H84JjuXItQ2INktIa2QSV4rANRt3PzWEquO7R c4IVBtDf1y+uz7svRjsTJJDceH8/AWW8NSsdh98AL17whBCzLAdWYKUupHo3TQE46HYO BMIkCQ8bX9IfMAub7SASrESBN1evM8ICtQWjf7+6TMu14MrQ3SkdEzik9y3dRjKJ5ujc KX+Q== 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:in-reply-to:references; bh=o55TOBoIa/CMo6KOrYfZSFWjktfMMhoMogWwHtMYRrg=; b=JR1FNUnS80a5LKF4otUguPxDhqA6nRDXlwCx6+thSjO3dJ5GI995UgRMfrDUGE2Wvw HAX34yMZbEEjU1pnxUUoTZrRe6DeOUme6oFxMoTFKCWO+kqV4+GTtmpn86skODAYETzI MpFgZeg8GCVxszr+AJg1Ocfx0GdrMZVCFTyjUtP03WuRASiY9tYiYHOcsrAx1insBj13 7fP6YLLJQyy2yNytPBn5TYCIG9r948Op9ei9dbsi4cckCPGsw/TKATDb9BNegBpwS4xP 5g71vtwjsvTrBTE1WhUH3W/5A6EjNsNgCfPge1MFjc6vC9WILrvNDiTQh0qaETjBJDj+ hPlQ== X-Gm-Message-State: AGRZ1gIhR1sDFuDcAlHWmzhGkt3jZlKud6paciB2JxbTsoH/uHo3bufV a6GMQT7klhAXlhkAaBAvfXdAE2+Z X-Google-Smtp-Source: AJdET5eC1QX2d0ST2qDMvRJo5Tgzu1QpnvkR0uECc5P1xEcj6QFvzpxHDDGl5eQJI8Gd3g8xf6Ngxg== X-Received: by 2002:a37:17df:: with SMTP id 92mr9350668qkx.191.1541132027482; Thu, 01 Nov 2018 21:13:47 -0700 (PDT) Received: from ultri5.home ([179.181.159.8]) by smtp.gmail.com with ESMTPSA id 83sm32849688qkz.73.2018.11.01.21.13.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 21:13:47 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Fri, 2 Nov 2018 01:12:36 -0300 Message-Id: <20181102041241.28910-8-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181102041241.28910-1-ricardo.martincoski@gmail.com> References: <20181102041241.28910-1-ricardo.martincoski@gmail.com> In-Reply-To: <20181016004230.10393-1-ricardo.martincoski@gmail.com> References: <20181016004230.10393-1-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH v2 07/12] support/testing: use TestPythonPackageBase for python-incremental X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Asaf Kahlon , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Move the test script to be run on the target from inline in the test case to a separate file. Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle Cc: Asaf Kahlon Cc: Thomas Petazzoni Cc: Yegor Yefremov --- Changes v1 -> v2: - refresh after creating TestPythonPackageBase; --- .../package/sample_python_incremental.py | 3 ++ .../tests/package/test_python_incremental.py | 32 ++++++------------- 2 files changed, 12 insertions(+), 23 deletions(-) create mode 100644 support/testing/tests/package/sample_python_incremental.py diff --git a/support/testing/tests/package/sample_python_incremental.py b/support/testing/tests/package/sample_python_incremental.py new file mode 100644 index 0000000000..b6e2aa803c --- /dev/null +++ b/support/testing/tests/package/sample_python_incremental.py @@ -0,0 +1,3 @@ +import incremental +v = incremental.Version("package", 1, 2, 3, release_candidate=4) +assert(str(v) == "[package, version 1.2.3rc4]") diff --git a/support/testing/tests/package/test_python_incremental.py b/support/testing/tests/package/test_python_incremental.py index 5a98efc666..22dde5e358 100644 --- a/support/testing/tests/package/test_python_incremental.py +++ b/support/testing/tests/package/test_python_incremental.py @@ -1,32 +1,18 @@ -from tests.package.test_python import TestPythonBase, TestPythonBase2, TestPythonBase3 +from tests.package.test_python import TestPythonPackageBase, TestPythonBase2, TestPythonBase3 -class TestPythonIncremental(TestPythonBase): - def str_test(self): - cmd = self.interpreter + " -c 'import incremental;" - cmd += "v = incremental.Version(\"package\", 1, 2, 3, release_candidate=4);" - cmd += "assert(str(v) == \"[package, version 1.2.3rc4]\")'" - _, exit_code = self.emulator.run(cmd, timeout=30) - self.assertEqual(exit_code, 0) - - -class TestPythonPy2Incremental(TestPythonIncremental, TestPythonBase2): - config = TestPythonBase2.config + \ +class TestPythonIncremental(TestPythonPackageBase): + config_package = \ """ BR2_PACKAGE_PYTHON_INCREMENTAL=y """ + sample_scripts = ["tests/package/sample_python_incremental.py"] + timeout = 30 - def test_run(self): - self.login() - self.str_test() +class TestPythonPy2Incremental(TestPythonIncremental, TestPythonBase2): + pass -class TestPythonPy3Incremental(TestPythonIncremental, TestPythonBase3): - config = TestPythonBase3.config + \ - """ - BR2_PACKAGE_PYTHON_INCREMENTAL=y - """ - def test_run(self): - self.login() - self.str_test() +class TestPythonPy3Incremental(TestPythonIncremental, TestPythonBase3): + pass