diff options
-rw-r--r-- | plugins/agl_test_log.py | 11 | ||||
-rw-r--r-- | tests/glib2/__init__.py | 0 | ||||
-rw-r--r-- | tests/glib2/run_tests.py | 52 |
3 files changed, 56 insertions, 7 deletions
diff --git a/plugins/agl_test_log.py b/plugins/agl_test_log.py index e064047..b4a273e 100644 --- a/plugins/agl_test_log.py +++ b/plugins/agl_test_log.py @@ -54,16 +54,13 @@ gnome_desktop_testing log formate: SKIP: glib/testname.test ''' def log_process_gnome_desktop_testing(log): - pattern = '^(FAIL|PASS|SKIP.+?): (.+test?)' + pattern = '^(FAIL|PASS|SKIP+?): (.+test?)' parse_result = log_parse(log, pattern) - test_cases_values_and_status = [["test_id","values","status"]] - + case_list = dict() if parse_result: for item in parse_result: - item_result = [item[1], item[0], ""] - test_cases_values_and_status.append(item_result) - - return test_cases_values_and_status + case_list[item[1]] = [item[1], item[0], ""] + return case_list # parse log file with pattern def log_parse(log, pattern): 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") |