Displays the result of launcher tc (#549)
author최종헌/MDE Lab(SR)/삼성전자 <j-h.choi@samsung.com>
Mon, 27 May 2024 01:53:48 +0000 (10:53 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 27 May 2024 01:53:48 +0000 (10:53 +0900)
Change-Id: I601d6f5dd9e198e0079aefec46e0cac64033ca73

tests/TCs/1_AOT/AOT.py
tests/TCs/2_PLUGIN/PLUGIN.py
tests/TCs/3_PRELOAD/PRELOAD.py
tests/TCs/4_TAC/TAC.py
tests/TCs/5_TLC/TLC.py
tests/TCs/6_TOOL/TOOL.py
tests/TCs/7_LAUNCH/LAUNCH.py
tests/TCs/ALL.py
tests/TCs/Utils.py

index 8463227ca144f713865238d57030b69ab685c7c5..ee704bc65657fdabdecc497cb64a20942cdd4eac 100755 (executable)
@@ -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")
index 6d191232c4087eabeef001d1d992113d56915910..b6709fbcedfb421a808321c899408219b073b67d 100755 (executable)
@@ -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")
index 9e8490650085bae31e82fd36ff29e560081369e5..c1301a0d005d0a270ab5f78f92a90cce9574d22a 100755 (executable)
@@ -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")
index 78b6f83d08181aa34132c434815cb29f5197030d..8a10c092b38224f5d73f79d4bca447c0fa642fbd 100755 (executable)
@@ -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")
index 42b1ef6fd03e8ecfd907e8266d8473172bd096c3..c958103bde361ba076649500a12ce5a8bf4b2950 100755 (executable)
@@ -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")
index 5361c35ce3694950364d711e715ceb339db59eee..3a00ff24058f36bd4838508d0e22a3a7dbc9e39f 100755 (executable)
@@ -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")
index 62354e42043ce50dd9a0c0b54a41ea49bf0df8be..b03229f0f9b32c33260e710c384cc86618d4f02f 100755 (executable)
@@ -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")
index e6ae958cbeeddf7980fa4629a7f09491be4189f6..212654bd4a483b7831bcd037b3076cf693695c9b 100755 (executable)
@@ -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__":
index da67ff38a378c11c392ab6c5750414dda0fd9885..b867036d4201dbf6f8c8528c6892e8bdbb6efe1d 100755 (executable)
@@ -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):