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")
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")
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")
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")
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")
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")
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")
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 ===")
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)
get_script_path("./")
run(serial)
+ result(serial)
if __name__ == "__main__":
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):