From: 최종헌/MDE Lab(SR)/삼성전자 Date: Mon, 27 May 2024 01:53:48 +0000 (+0900) Subject: Displays the result of launcher tc (#549) X-Git-Tag: accepted/tizen/unified/20240621.010434~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56bd9a2e6d1ff9b027129fce935d331e35243e98;p=platform%2Fcore%2Fdotnet%2Flauncher.git Displays the result of launcher tc (#549) Change-Id: I601d6f5dd9e198e0079aefec46e0cac64033ca73 --- diff --git a/tests/TCs/1_AOT/AOT.py b/tests/TCs/1_AOT/AOT.py index 8463227..ee704bc 100755 --- a/tests/TCs/1_AOT/AOT.py +++ b/tests/TCs/1_AOT/AOT.py @@ -127,6 +127,9 @@ def run(): r = round(((p / (len(tc_array) - n)) * 100), 2) print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n") + with open(f"{RESULT_PATH}", "a+") as file: + file.write(f"| {module_name} | {p} | {f} | {n} | {r} |\n") + # Uninstall the application and restore to original state def clean(): cmd(f"uninstall org.tizen.example.Launcher_TC_AOT_01.Tizen") diff --git a/tests/TCs/2_PLUGIN/PLUGIN.py b/tests/TCs/2_PLUGIN/PLUGIN.py index 6d19123..b6709fb 100755 --- a/tests/TCs/2_PLUGIN/PLUGIN.py +++ b/tests/TCs/2_PLUGIN/PLUGIN.py @@ -320,6 +320,9 @@ def run(): r = round(((p / (len(tc_array) - n)) * 100), 2) print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n") + with open(f"{RESULT_PATH}", "a+") as file: + file.write(f"| {module_name} | {p} | {f} | {n} | {r} |\n") + # Uninstall the application and restore to original state def clean(): cmd(f"uninstall org.tizen.example.Launcher_TC_PLUGIN_01.Tizen") diff --git a/tests/TCs/3_PRELOAD/PRELOAD.py b/tests/TCs/3_PRELOAD/PRELOAD.py index 9e84906..c1301a0 100755 --- a/tests/TCs/3_PRELOAD/PRELOAD.py +++ b/tests/TCs/3_PRELOAD/PRELOAD.py @@ -109,6 +109,9 @@ def run(): r = round(((p / (len(tc_array) - n)) * 100), 2) print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n") + with open(f"{RESULT_PATH}", "a+") as file: + file.write(f"| {module_name} | {p} | {f} | {n} | {r} |\n") + # Uninstall the application and restore to original state def clean(): cmd(f"uninstall org.tizen.example.Launcher_TC_PRELOAD_01.Tizen") diff --git a/tests/TCs/4_TAC/TAC.py b/tests/TCs/4_TAC/TAC.py index 78b6f83..8a10c09 100755 --- a/tests/TCs/4_TAC/TAC.py +++ b/tests/TCs/4_TAC/TAC.py @@ -515,6 +515,9 @@ def run(): r = round(((p / (len(tc_array) - n)) * 100), 2) print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n") + with open(f"{RESULT_PATH}", "a+") as file: + file.write(f"| {module_name} | {p} | {f} | {n} | {r} |\n") + # Uninstall the application and restore to original state def clean(): cmd(f"uninstall org.tizen.example.Launcher_TC_TAC_01.Tizen") diff --git a/tests/TCs/5_TLC/TLC.py b/tests/TCs/5_TLC/TLC.py index 42b1ef6..c958103 100755 --- a/tests/TCs/5_TLC/TLC.py +++ b/tests/TCs/5_TLC/TLC.py @@ -582,6 +582,9 @@ def run(): r = round(((p / (len(tc_array) - n)) * 100), 2) print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n") + with open(f"{RESULT_PATH}", "a+") as file: + file.write(f"| {module_name} | {p} | {f} | {n} | {r} |\n") + # Uninstall the application and restore to original state def clean(): cmd(f"uninstall org.tizen.example.Launcher_TC_TLC_01.Tizen") diff --git a/tests/TCs/6_TOOL/TOOL.py b/tests/TCs/6_TOOL/TOOL.py index 5361c35..3a00ff2 100755 --- a/tests/TCs/6_TOOL/TOOL.py +++ b/tests/TCs/6_TOOL/TOOL.py @@ -670,6 +670,9 @@ def run(): r = round(((p / (len(tc_array) - n)) * 100), 2) print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n") + with open(f"{RESULT_PATH}", "a+") as file: + file.write(f"| {module_name} | {p} | {f} | {n} | {r} |\n") + # Uninstall the application and restore to original state def clean(): cmd(f"uninstall org.tizen.example.Launcher_TC_TOOL_01.Tizen") diff --git a/tests/TCs/7_LAUNCH/LAUNCH.py b/tests/TCs/7_LAUNCH/LAUNCH.py index 62354e4..b03229f 100755 --- a/tests/TCs/7_LAUNCH/LAUNCH.py +++ b/tests/TCs/7_LAUNCH/LAUNCH.py @@ -189,6 +189,9 @@ def run(): r = round(((p / (len(tc_array) - n)) * 100), 2) print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n") + with open(f"{RESULT_PATH}", "a+") as file: + file.write(f"| {module_name} | {p} | {f} | {n} | {r} |\n") + # Uninstall the application and restore to original state def clean(): cmd(f"uninstall org.tizen.example.Launcher_TC_LAUNCH_01.Tizen") diff --git a/tests/TCs/ALL.py b/tests/TCs/ALL.py index e6ae958..212654b 100755 --- a/tests/TCs/ALL.py +++ b/tests/TCs/ALL.py @@ -18,12 +18,18 @@ def get_script_path(dirname): if ext == ".py" and \ "BuildTPK" not in full_filename and \ "Utils" not in full_filename and \ - "ALL" not in full_filename: + "ALL" not in full_filename and \ + "candidate_mcj" not in full_filename: script_lists.append(full_filename) return script_lists def run(serial): + with open(f"{RESULT_PATH}", "w") as file: + file.write("==== Dotnet Launcher Unit Test Result ====\n") + file.write("| MODULE | PASS | FAIL | NONE | RATIO |\n") + file.write("------------------------------------------\n") + device = get_device_type() print(f"=== Dotnet-Launcher [{device}] Test Case ===") @@ -31,6 +37,16 @@ def run(serial): subprocess.run((f"{tc} {serial}").split()) sleep(3) + with open(f"{RESULT_PATH}", "a+") as file: + file.write("------------------------------------------\n") + file.write("| MODULE | PASS | FAIL | NONE | RATIO |\n") + + +def result(serial): + with open(f"{RESULT_PATH}", "r") as file: + result = file.read() + print(result) + def main(): serial = read_serial(None) @@ -40,6 +56,7 @@ def main(): get_script_path("./") run(serial) + result(serial) if __name__ == "__main__": diff --git a/tests/TCs/Utils.py b/tests/TCs/Utils.py index da67ff3..b867036 100755 --- a/tests/TCs/Utils.py +++ b/tests/TCs/Utils.py @@ -13,6 +13,7 @@ IBCDATA_DIR = "/usr/share/dotnet.tizen/ibcdata/" DOTNET_DIR = "/opt/usr/dotnet/" OWNER_DIR = "/home/owner/" SPC_DLL = "System.Private.CoreLib.dll" +RESULT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "result.log")) # Check the sdb connection status and get a device serial number def read_serial(serial):