subprocess.run((f"mv {filepath} {new_filepath}").split(), encoding="utf-8", stdout=subprocess.PIPE).stdout
return new_filepath
+# Copy the rpk app
+def copy_rpk():
+ subprocess.run((f"cp Launcher_TC_AOT_04/org.tizen.example.Launcher_TC_AOT_04-1.0.0.rpk .").split(), encoding="utf-8", stdout=subprocess.PIPE).stdout
+ print(f"Copy complete : org.tizen.example.Launcher_TC_AOT_04-1.0.0.rpk")
+
# Main entry point
def main():
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter)
else:
sln_lists = get_sln_list("./", args.rebuild)
+ copy_rpk()
build_tpk(sorted(sln_lists))
--- /dev/null
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="9.0" package="org.tizen.example.Launcher_TC_AOT_04" res-type="tizen.sample.resource" res-version="1.5.0" version="1.0.0">
+ <icon>Launcher_TC_AOT_04.png</icon>
+ <label>Launcher_TC_AOT_04</label>
+ <allowed-package id="org.tizen.example.*"/>
+ <metadata key="http://tizen.org/metadata/ui-gadget/dll" value="Launcher_TC_AOT_04.dll" />
+ <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
+</manifest>
--- /dev/null
+\r
+Microsoft Visual Studio Solution File, Format Version 12.00\r
+# Visual Studio Version 17\r
+VisualStudioVersion = 17.11.35327.3\r
+MinimumVisualStudioVersion = 10.0.40219.1\r
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Launcher_TC_PLUGIN_12", "Launcher_TC_PLUGIN_12\Launcher_TC_PLUGIN_12.csproj", "{17B31F7B-A019-4198-94F2-189419DA239F}"\r
+EndProject\r
+Global\r
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+ Debug|Any CPU = Debug|Any CPU\r
+ Release|Any CPU = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+ {17B31F7B-A019-4198-94F2-189419DA239F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {17B31F7B-A019-4198-94F2-189419DA239F}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {17B31F7B-A019-4198-94F2-189419DA239F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU\r
+ {17B31F7B-A019-4198-94F2-189419DA239F}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {17B31F7B-A019-4198-94F2-189419DA239F}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {17B31F7B-A019-4198-94F2-189419DA239F}.Release|Any CPU.Deploy.0 = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(SolutionProperties) = preSolution\r
+ HideSolutionNode = FALSE\r
+ EndGlobalSection\r
+ GlobalSection(ExtensibilityGlobals) = postSolution\r
+ SolutionGuid = {576BD8A2-5349-4FCF-A323-CE5526FD57C8}\r
+ EndGlobalSection\r
+EndGlobal\r
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFramework>net6.0-tizen8.0</TargetFramework>
+ <OutputType>Exe</OutputType>
+ </PropertyGroup>
+</Project>
--- /dev/null
+using System;\r
+\r
+using Tizen.NUI;\r
+using Tizen.NUI.BaseComponents;\r
+\r
+namespace Launcher_TC_PLUGIN_12\r
+{\r
+ internal class Program : NUIApplication\r
+ {\r
+ protected override void OnCreate()\r
+ {\r
+ base.OnCreate();\r
+ Initialize();\r
+ }\r
+\r
+ void Initialize()\r
+ {\r
+ Window.Instance.KeyEvent += OnKeyEvent;\r
+\r
+ TextLabel text = new TextLabel("Hello Tizen")\r
+ {\r
+ HorizontalAlignment = HorizontalAlignment.Center,\r
+ VerticalAlignment = VerticalAlignment.Center,\r
+ TextColor = Color.Blue,\r
+ PointSize = 12.0f,\r
+ HeightResizePolicy = ResizePolicyType.FillToParent,\r
+ WidthResizePolicy = ResizePolicyType.FillToParent\r
+ };\r
+ Window.Instance.GetDefaultLayer().Add(text);\r
+\r
+ Animation animation = new Animation(2000);\r
+ animation.AnimateTo(text, "Orientation", new Rotation(new Radian(new Degree(180.0f)), PositionAxis.X), 0, 500);\r
+ animation.AnimateTo(text, "Orientation", new Rotation(new Radian(new Degree(0.0f)), PositionAxis.X), 500, 1000);\r
+ animation.Looping = true;\r
+ animation.Play();\r
+ }\r
+\r
+ public void OnKeyEvent(object sender, Window.KeyEventArgs e)\r
+ {\r
+ if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape"))\r
+ {\r
+ Exit();\r
+ }\r
+ }\r
+\r
+ static void Main(string[] args)\r
+ {\r
+ var app = new Program();\r
+ app.Run(args);\r
+ }\r
+ }\r
+}\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="8" package="org.tizen.example.Launcher_TC_PLUGIN_12" version="1.0.0">
+ <profile name="common" />
+ <ui-application appid="org.tizen.example.Launcher_TC_PLUGIN_12"
+ exec="Launcher_TC_PLUGIN_12.dll"
+ type="dotnet"
+ multiple="false"
+ taskmanage="true"
+ nodisplay="false"
+ launch_mode="single">
+ <label>Launcher_TC_PLUGIN_12</label>
+ <icon>Launcher_TC_PLUGIN_12.png</icon>
+ <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
+ <res-control resource-type="tizen.sample.resource" min-res-version="1.0.0" max-res-version="2.0.0" auto-close="false"></res-control>
+ </ui-application>
+</manifest>
--- /dev/null
+\r
+Microsoft Visual Studio Solution File, Format Version 12.00\r
+# Visual Studio Version 17\r
+VisualStudioVersion = 17.11.35327.3\r
+MinimumVisualStudioVersion = 10.0.40219.1\r
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Launcher_TC_TLC_11", "Launcher_TC_TLC_11\Launcher_TC_TLC_11.csproj", "{2977BA09-D3BC-4B80-BD0C-799954A3E160}"\r
+EndProject\r
+Global\r
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+ Debug|Any CPU = Debug|Any CPU\r
+ Release|Any CPU = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+ {2977BA09-D3BC-4B80-BD0C-799954A3E160}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {2977BA09-D3BC-4B80-BD0C-799954A3E160}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {2977BA09-D3BC-4B80-BD0C-799954A3E160}.Debug|Any CPU.Deploy.0 = Debug|Any CPU\r
+ {2977BA09-D3BC-4B80-BD0C-799954A3E160}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {2977BA09-D3BC-4B80-BD0C-799954A3E160}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {2977BA09-D3BC-4B80-BD0C-799954A3E160}.Release|Any CPU.Deploy.0 = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(SolutionProperties) = preSolution\r
+ HideSolutionNode = FALSE\r
+ EndGlobalSection\r
+ GlobalSection(ExtensibilityGlobals) = postSolution\r
+ SolutionGuid = {1E2E3A50-FE17-48ED-B8C7-409FBB2535F1}\r
+ EndGlobalSection\r
+EndGlobal\r
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFramework>net6.0-tizen8.0</TargetFramework>
+ <OutputType>Exe</OutputType>
+ </PropertyGroup>
+ <ItemGroup>\r
+ <PackageReference Include="SkiaSharp" Version="2.88.9" />\r
+ </ItemGroup>
+</Project>
--- /dev/null
+using System;\r
+\r
+using Tizen.NUI;\r
+using Tizen.NUI.BaseComponents;\r
+\r
+namespace Launcher_TC_TLC_11\r
+{\r
+ internal class Program : NUIApplication\r
+ {\r
+ protected override void OnCreate()\r
+ {\r
+ base.OnCreate();\r
+ Initialize();\r
+ }\r
+\r
+ void Initialize()\r
+ {\r
+ Window.Instance.KeyEvent += OnKeyEvent;\r
+\r
+ TextLabel text = new TextLabel("Hello Tizen")\r
+ {\r
+ HorizontalAlignment = HorizontalAlignment.Center,\r
+ VerticalAlignment = VerticalAlignment.Center,\r
+ TextColor = Color.Blue,\r
+ PointSize = 12.0f,\r
+ HeightResizePolicy = ResizePolicyType.FillToParent,\r
+ WidthResizePolicy = ResizePolicyType.FillToParent\r
+ };\r
+ Window.Instance.GetDefaultLayer().Add(text);\r
+\r
+ Animation animation = new Animation(2000);\r
+ animation.AnimateTo(text, "Orientation", new Rotation(new Radian(new Degree(180.0f)), PositionAxis.X), 0, 500);\r
+ animation.AnimateTo(text, "Orientation", new Rotation(new Radian(new Degree(0.0f)), PositionAxis.X), 500, 1000);\r
+ animation.Looping = true;\r
+ animation.Play();\r
+ }\r
+\r
+ public void OnKeyEvent(object sender, Window.KeyEventArgs e)\r
+ {\r
+ if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape"))\r
+ {\r
+ Exit();\r
+ }\r
+ }\r
+\r
+ static void Main(string[] args)\r
+ {\r
+ var app = new Program();\r
+ app.Run(args);\r
+ }\r
+ }\r
+}\r
--- /dev/null
+libtest
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="8" package="org.tizen.example.Launcher_TC_TLC_11" version="1.0.0">
+ <profile name="common" />
+ <ui-application appid="org.tizen.example.Launcher_TC_TLC_11"
+ exec="Launcher_TC_TLC_11.dll"
+ type="dotnet"
+ multiple="false"
+ taskmanage="true"
+ nodisplay="false"
+ launch_mode="single">
+ <label>Launcher_TC_TLC_11</label>
+ <icon>Launcher_TC_TLC_11.png</icon>
+ <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
+ <metadata key="http://tizen.org/metadata/prefer_nuget_cache" value="true" />
+ </ui-application>
+</manifest>
return "PASS"
+# The `Launcher_TC_AOT_04` resource package generates native image when the SPC.ni.dll exists.
+def TC_04():
+ sln_name = "Launcher_TC_AOT_04"
+
+ tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
+ if tpk_path == None:
+ return f"FAIL : Get the tpk path for {sln_name}"
+
+ if "OK" not in app_install(f"{tpk_path}", True):
+ return f"FAIL : Install the application for {tpk_path}"
+
+ pkg_id = "org.tizen.example.Launcher_TC_AOT_04"
+
+ root_path = get_root_path(f"{pkg_id}")
+ if root_path == "None":
+ return f"FAIL : Get the root path for {pkg_id}"
+
+ if exist(f"{root_path}/res/allowed/tizen.sample.resource/.native_image"):
+ return "FAIL : The .native_image folder should not exist"
+
+ raw = cmd(f"shell find {root_path}/res/allowed/tizen.sample.resource/ -name *.ni.dll")
+ lines1 = [l for l in raw.splitlines()]
+ raw = cmd(f"shell find {root_path}/res/allowed/tizen.sample.resource/ -maxdepth 1 -name *.dll -not -name *.ni.dll")
+ lines2 = [l for l in raw.splitlines()]
+ if len(lines1) != len(lines2):
+ return "FAIL : The number of .dll and .ni.dll must match in the application"
+
+ for ni in lines1:
+ is_same = False
+ for dll in lines2:
+ if Path(ni).name.replace(".ni.dll", "") == Path(dll).name.replace(".dll", ""):
+ is_same = True
+ break
+ if not is_same:
+ return "FAIL : The file name of .dll and .ni.dll must match in the application"
+
+ return "PASS"
+
# Run the test
def run():
cmd(f"root on")
cmd(f"uninstall org.tizen.example.Launcher_TC_AOT_01.Tizen")
cmd(f"uninstall org.tizen.example.Launcher_TC_AOT_02.Tizen")
cmd(f"uninstall org.tizen.example.Launcher_TC_AOT_03.Tizen")
+ cmd(f"uninstall org.tizen.example.Launcher_TC_AOT_04")
create_spc_ni()
funcMap = {
-'TC_01': TC_01, 'TC_02': TC_02, 'TC_03': TC_03,
-'AOT_TC_01': TC_01, 'AOT_TC_02': TC_02, 'AOT_TC_03': TC_03
+'TC_01': TC_01, 'TC_02': TC_02, 'TC_03': TC_03, 'TC_04': TC_04,
+'AOT_TC_01': TC_01, 'AOT_TC_02': TC_02, 'AOT_TC_03': TC_03, 'AOT_TC_04': TC_04
}
return "PASS"
+
+# The Launcher_TC_PLUGIN_12 application must have a .res_mount folder.
+def TC_12():
+ sln_name = "Launcher_TC_PLUGIN_12"
+
+ tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
+ if tpk_path == None:
+ return f"FAIL : Get the tpk path for {sln_name}"
+
+ if "OK" not in app_install(f"{tpk_path}"):
+ return f"FAIL : Install the application for {tpk_path}"
+
+ pkg_id = f"org.tizen.example.Launcher_TC_PLUGIN_12"
+
+ root_path = get_root_path(f"{pkg_id}")
+ if root_path == "None":
+ return f"FAIL : Get the root path for {pkg_id}"
+
+ if not exist(f"{root_path}/bin/.res_mount"):
+ return "FAIL : The .res_mount folder should exist"
+
+ return "PASS"
+
# Run the test
def run():
cmd(f"root on")
cmd(f"uninstall org.tizen.example.Launcher_TC_PLUGIN_09.Tizen")
cmd(f"uninstall org.tizen.example.Launcher_TC_PLUGIN_10.Tizen")
cmd(f"uninstall org.tizen.example.Launcher_TC_PLUGIN_11")
+ cmd(f"uninstall org.tizen.example.Launcher_TC_PLUGIN_12")
# Main entry point
def main():
else:
tc_array.append(funcMap[tc_num])
else:
- tc_array = [TC_01, TC_02, TC_03, TC_04, TC_05, TC_06, TC_07, TC_08, TC_09, TC_10, TC_11]
+ tc_array = [TC_01, TC_02, TC_03, TC_04, TC_05, TC_06, TC_07, TC_08, TC_09, TC_10, TC_11, TC_12]
global serial
if len(sys.argv) >= 2 and "TC_" not in sys.argv[1]:
funcMap = {
-'TC_01': TC_01, 'TC_02': TC_02, 'TC_03': TC_03, 'TC_04': TC_04, 'TC_05': TC_05,
-'TC_06': TC_06, 'TC_07': TC_07, 'TC_08': TC_08, 'TC_09': TC_09, 'TC_10': TC_10, 'TC_11': TC_11,
-'PLUGIN_TC_01': TC_01, 'PLUGIN_TC_02': TC_02, 'PLUGIN_TC_03': TC_03, 'PLUGIN_TC_04': TC_04, 'PLUGIN_TC_05': TC_05,
-'PLUGIN_TC_06': TC_06, 'PLUGIN_TC_07': TC_07, 'PLUGIN_TC_08': TC_08, 'PLUGIN_TC_09': TC_09, 'PLUGIN_TC_10': TC_10, 'PLUGIN_TC_11': TC_11
+'TC_01': TC_01, 'TC_02': TC_02, 'TC_03': TC_03, 'TC_04': TC_04, 'TC_05': TC_05, 'TC_06': TC_06,
+'TC_07': TC_07, 'TC_08': TC_08, 'TC_09': TC_09, 'TC_10': TC_10, 'TC_11': TC_11, 'TC_12': TC_12,
+'PLUGIN_TC_01': TC_01, 'PLUGIN_TC_02': TC_02, 'PLUGIN_TC_03': TC_03, 'PLUGIN_TC_04': TC_04, 'PLUGIN_TC_05': TC_05, 'PLUGIN_TC_06': TC_06,
+'PLUGIN_TC_07': TC_07, 'PLUGIN_TC_08': TC_08, 'PLUGIN_TC_09': TC_09, 'PLUGIN_TC_10': TC_10, 'PLUGIN_TC_11': TC_11, 'PLUGIN_TC_12': TC_12
}
return "PASS"
+# The `Launcher_TC_TLC_01` application must have TLC applied.
+def TC_10():
+ if not check_tc_support():
+ return "NONE - TC_10 is not supported on this platform"
+
+ sln_name = "Launcher_TC_TLC_11"
+
+ tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
+ if tpk_path == None:
+ return f"FAIL : Get the tpk path for {sln_name}"
+
+ if "OK" not in app_install(f"{tpk_path}"):
+ return f"FAIL : Install the application for {tpk_path}"
+
+ pkg_id = f"org.tizen.example.Launcher_TC_TLC_11"
+
+ root_path = get_root_path(f"{pkg_id}")
+ if root_path == "None":
+ return f"FAIL : Get the root path for {pkg_id}"
+
+ if not exist(f"{root_path}/lib/libtest.so"):
+ return "FAIL : The libtest.so library should exist in the application"
+
+ raw = cmd(f"shell ls -alZ {root_path}/lib/libtest.so")
+ if (f"{root_path}/lib/libtest.so" not in raw) or \
+ (f"{DOTNET_DIR}Libraries/libtest.so.." not in raw):
+ return "FAIL : The libtest.so library should exist or be a symbolic link"
+
+ sha = raw.split("..")[1].rstrip()
+
+ raw = cmd(f"shell find {DOTNET_DIR}Libraries/ -name libtest.so*")
+ if sha not in raw:
+ return f"FAIL : The libtest.so library should exist in {DOTNET_DIR}Libraries"
+
+ return "PASS"
+
# Run the test
def run():
cmd(f"root on")
cmd(f"uninstall org.tizen.example.Launcher_TC_TLC_08.Tizen")
cmd(f"uninstall org.tizen.example.Launcher_TC_TLC_09.Tizen")
cmd(f"uninstall org.tizen.example.Launcher_TC_TLC_10.Tizen")
+ cmd(f"uninstall org.tizen.example.Launcher_TC_TLC_11")
# Main entry point
def main():
else:
tc_array.append(funcMap[tc_num])
else:
- tc_array = [TC_01, TC_02, TC_03, TC_04, TC_05, TC_06, TC_07, TC_08, TC_09]
+ tc_array = [TC_01, TC_02, TC_03, TC_04, TC_05, TC_06, TC_07, TC_08, TC_09, TC_10]
global serial
if len(sys.argv) >= 2 and "TC_" not in sys.argv[1]:
funcMap = {
-'TC_01': TC_01, 'TC_02': TC_02, 'TC_03': TC_02_03, 'TC_04': TC_04, 'TC_05': TC_04_05, 'TC_06': TC_04_05_06, 'TC_07': TC_07, 'TC_08': TC_08, 'TC_09': TC_09,
+'TC_01': TC_01, 'TC_02': TC_02, 'TC_03': TC_02_03, 'TC_04': TC_04, 'TC_05': TC_04_05, 'TC_06': TC_04_05_06, 'TC_07': TC_07, 'TC_08': TC_08, 'TC_09': TC_09, 'TC_10': TC_10,
'TLC_TC_01': TC_01, 'TLC_TC_02': TC_02, 'TLC_TC_03': TC_02_03, 'TLC_TC_04': TC_04, 'TLC_TC_05': TC_04_05,
-'TLC_TC_06': TC_04_05_06, 'TLC_TC_07': TC_07, 'TLC_TC_08': TC_08, 'TLC_TC_09': TC_09
+'TLC_TC_06': TC_04_05_06, 'TLC_TC_07': TC_07, 'TLC_TC_08': TC_08, 'TLC_TC_09': TC_09, 'TLC_TC_10': TC_10
}
search_tpk(module, full_filename)
else:
ext = os.path.splitext(full_filename)[-1]
- if ext == ".tpk" and f"{module}" in full_filename:
+ if ext == ".tpk" or ext == ".rpk" and f"{module}" in full_filename:
tpk_lists.append(full_filename)
return tpk_lists
return None
# Install the application
-def app_install(tpk_path):
+def app_install(tpk_path, isRpk=False):
raw = cmd(f"push {tpk_path} {OWNER_DIR}")
if "1 file(s) pushed. 0 file(s) skipped." not in raw:
return "FAIL"
tpk_name = Path(tpk_path).name
- raw = cmd(f"shell pkgcmd -i -t tpk -p {OWNER_DIR}{tpk_name}")
+ if (isRpk):
+ raw = cmd(f"shell pkgcmd -i -t rpk -p {OWNER_DIR}{tpk_name}")
+ else:
+ raw = cmd(f"shell pkgcmd -i -t tpk -p {OWNER_DIR}{tpk_name}")
if "key[end] val[ok]" not in raw:
cmd(f"shell rm {OWNER_DIR}{tpk_name}")
return "FAIL"