testing/tests/package: add basic unit test for IPython
authorAndrey Smirnov <andrew.smirnov@gmail.com>
Wed, 12 Jul 2017 02:40:09 +0000 (19:40 -0700)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 22 Jul 2017 20:55:05 +0000 (22:55 +0200)
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
[Thomas: update .gitlab-ci.yml.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
.gitlab-ci.yml
support/testing/tests/package/test_ipython.py [new file with mode: 0644]

index 9a1f0273a18f6f01cc6f75edef2b61383b3443c7..f360b6c669630dad504c3bfcc776938ac42bc82d 100644 (file)
@@ -226,6 +226,8 @@ tests.fs.test_squashfs.TestSquashfs: *runtime_test
 tests.fs.test_ubi.TestUbi: *runtime_test
 tests.fs.test_yaffs2.TestYaffs2: *runtime_test
 tests.package.test_dropbear.TestDropbear: *runtime_test
+tests.package.test_ipython.TestIPythonPy2: *runtime_test
+tests.package.test_ipython.TestIPythonPy3: *runtime_test
 tests.package.test_python.TestPython2: *runtime_test
 tests.package.test_python.TestPython3: *runtime_test
 tests.toolchain.test_external.TestExternalToolchainBuildrootMusl: *runtime_test
diff --git a/support/testing/tests/package/test_ipython.py b/support/testing/tests/package/test_ipython.py
new file mode 100644 (file)
index 0000000..dd8bf50
--- /dev/null
@@ -0,0 +1,38 @@
+import os
+
+from tests.package.test_python import TestPythonBase
+#
+# The following pythong tests are not being used here:
+#
+# - version_test: IPython does not support --version option
+#
+# - zlib_test: IPython does not return a non-zero code the way CPython
+#              does, so this test ends up being a false-negative
+#
+class TestIPythonPy2(TestPythonBase):
+    config = TestPythonBase.config + \
+"""
+BR2_PACKAGE_PYTHON=y
+BR2_PACKAGE_PYTHON_IPYTHON=y
+"""
+    interpreter = "ipython"
+
+    def test_run(self):
+        self.login()
+        self.math_floor_test(40)
+        self.libc_time_test(40)
+
+class TestIPythonPy3(TestPythonBase):
+    config = TestPythonBase.config + \
+"""
+BR2_PACKAGE_PYTHON3=y
+BR2_PACKAGE_PYTHON_IPYTHON=y
+"""
+    interpreter = "ipython"
+
+    def test_run(self):
+        self.login()
+        self.math_floor_test(40)
+        self.libc_time_test(40)
+
+