Add define HOST_XXX to support pal.h
[platform/core/dotnet/launcher.git] / tests / TCs / ALL.py
1 #!/usr/bin/env python3
2 import os, subprocess, sys
3 sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
4
5 from time import sleep
6 from Utils import *
7
8
9 script_lists = []
10 def get_script_path(dirname):
11     filenames = os.listdir(dirname)
12     for filename in filenames:
13         full_filename = os.path.join(dirname, filename)
14         if os.path.isdir(full_filename):
15             get_script_path(full_filename)
16         else:
17             ext = os.path.splitext(full_filename)[-1]
18             if ext == ".py" and \
19                "BuildTPK" not in full_filename and \
20                "Utils" not in full_filename and \
21                "ALL" not in full_filename:
22                 script_lists.append(full_filename)
23     return script_lists
24
25
26 def run(serial):
27     device = get_device_type()
28     print(f"=== Dotnet-Launcher [{device}] Test Case ===")
29
30     for tc in sorted(script_lists):
31         subprocess.run((f"{tc} {serial}").split())
32         sleep(3)
33
34
35 def main():
36     serial = read_serial(None)
37     if serial is None:
38         print("No connected device(s).")
39         exit(1)
40
41     get_script_path("./")
42     run(serial)
43
44
45 if __name__ == "__main__":
46     try:
47         main()
48     except KeyboardInterrupt:
49         exit(1)