aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryanxk <yanxk.fnst@fujitsu.com>2022-08-14 11:59:52 +0800
committeryanxk <yanxk.fnst@fujitsu.com>2022-08-14 11:59:52 +0800
commit2612ee28807b08c16f7c1502ff88e713c3897e9c (patch)
tree858f4f3496d4ea35c92b5c62f4135251a1efaf7b
parent4bc58fc5cc29a5deae8ede984ab8e68e7874f615 (diff)
agl-test-framework: deploy parametric implementation for old ‘glib-2.0’ test
Single definitions are no longer used in this test framework, they are now replaced by another parametric implementation. The benefit of this is that it minimizes the likelihood of requiring manual maintenance due to the small but frequent updates from the upstream. Bug-AGL: SPEC-4345 Signed-off-by: yanxk <yanxk.fnst@fujitsu.com> Change-Id: I86a0edabb27c7117d8279e1478be94f456894533
-rw-r--r--tests/glib2/run_tests.py40
1 files changed, 6 insertions, 34 deletions
diff --git a/tests/glib2/run_tests.py b/tests/glib2/run_tests.py
index ce45df9..dfc23ae 100644
--- a/tests/glib2/run_tests.py
+++ b/tests/glib2/run_tests.py
@@ -13,46 +13,18 @@ class GLIB2Base(PTESTBase):
self.case_info_list = log.log_process_gnome_desktop_testing(log_file)
self.init_case_status()
+instance = GLIB2Base()
+instance.run_ptest()
+
@pytest.fixture(scope='module')
def testbase():
- #init instance for test
- instance = GLIB2Base()
- #run test scripts
- #the "test_name" should be the name of test set in ptest
- instance.run_test_fun()
- #parser log
- instance.log_process()
-
yield instance
-
#package log files and make report file
instance.log_report()
-def setup_module(testbase: GLIB2Base):
- print("setup function start")
-
-def precheck():
- instance = GLIB2Base()
- return instance.precheck()
-skip_msg = "The current environment does not match the test requirements."
-pytestmark = pytest.mark.skipif(precheck() == False, reason = skip_msg)
-
-@pytest.mark.oss_default
-def test_timeloop_closure(testbase: GLIB2Base):
- name = "glib/timeloop-closure.test"
- testbase.run_case(name)
-
-@pytest.mark.oss_default
-def test_contenttype(testbase: GLIB2Base):
- name = "glib/contenttype.test"
- testbase.run_case(name)
-
-@pytest.mark.oss_default
-def test_string(testbase: GLIB2Base):
- name = "glib/string.test"
- testbase.run_case(name)
-
-#TODO:Completion test cases
+@pytest.mark.parametrize('case_name', instance.case_info_list.keys())
+def test_glib2(testbase: GLIB2Base, case_name):
+ testbase.run_case(case_name)
if __name__ == '__main__':
pytest.main("-s run_tests")