aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorduerpei <duep.fnst@fujitsu.com>2022-06-16 11:50:57 +0800
committerduerpei <duep.fnst@fujitsu.com>2022-06-16 11:50:57 +0800
commit562d91e1446047dcf340116dec2161c2f11d0745 (patch)
tree11fb3b67b9088866518876b9fb3d621a171c4ba4 /tests
parent18633e747c6bb469f31d2bc2e595b85099865b4f (diff)
agl-test-framework: use PTESTBaseTest class
Move the "run_tests" script of glib2 under "qa-test-misc" to "agl-test-framework", this is more reasonable. And modify the script file run_tests under glib2, make it use PTESTBaseTest class. Later, I will delete the "run_tests" scripts under "qa-test-misc" Bug-AGL: SPEC-4345 Signed-off-by: duerpei <duep.fnst@fujitsu.com> Change-Id: Id055b829954bf8bdf75a90ff5b417baae0c4d5fb
Diffstat (limited to 'tests')
-rw-r--r--tests/glib2/__init__.py0
-rw-r--r--tests/glib2/run_tests.py52
2 files changed, 52 insertions, 0 deletions
diff --git a/tests/glib2/__init__.py b/tests/glib2/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/glib2/__init__.py
diff --git a/tests/glib2/run_tests.py b/tests/glib2/run_tests.py
new file mode 100644
index 0000000..37c91d5
--- /dev/null
+++ b/tests/glib2/run_tests.py
@@ -0,0 +1,52 @@
+import pytest
+
+import plugins.agl_test_log as log
+
+from plugins.agl_test_ptest_base import PTESTBase
+
+class GLIB2Base(PTESTBase):
+ def __init__(self):
+ super().__init__(test_name="glib-2.0")
+
+ def log_process(self):
+ log_file = self.get_logfile()
+ self.case_info_list = log.log_process_gnome_desktop_testing(log_file)
+ self.init_case_status()
+
+@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")
+
+@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
+
+if __name__ == '__main__':
+ pytest.main("-s run_tests")