support/testing: add smmap2 test

Add a simple test case that imports the module and instantiates a new
SlidingWindowMapManager class.

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Adam Duskett
2019-11-29 12:38:41 -08:00
committed by Thomas Petazzoni
parent 30968cfd83
commit f81f673a78
3 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
# Taken from smmap/test/test_tutorial.py
import smmap
mman = smmap.SlidingWindowMapManager()
assert mman.num_file_handles() == 0
assert mman.mapped_memory_size() == 0

View File

@@ -0,0 +1,21 @@
from tests.package.test_python import TestPythonPackageBase
class TestPythonPy2Smmap2(TestPythonPackageBase):
__test__ = True
config = TestPythonPackageBase.config + \
"""
BR2_PACKAGE_PYTHON=y
BR2_PACKAGE_PYTHON_SMMAP2=y
"""
sample_scripts = ["tests/package/sample_python_smmap2.py"]
class TestPythonPy3Smmap2(TestPythonPackageBase):
__test__ = True
config = TestPythonPackageBase.config + \
"""
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON_SMMAP2=y
"""
sample_scripts = ["tests/package/sample_python_smmap2.py"]