summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
author최종헌/Common Platform Lab(SR)/삼성전자 <j-h.choi@samsung.com>2022-02-09 14:12:43 +0900
committerGitHub Enterprise <noreply-CODE@samsung.com>2022-02-09 14:12:43 +0900
commitf5f56f6a6bca5423fd3930a1613b6a4c306cac19 (patch)
tree7e1d3906fc8dd6ea245a690a865b24178e34c8af /tests
parentda8962fa45dc1080fadadaf564402233c3076ac4 (diff)
downloadlauncher-f5f56f6a6bca5423fd3930a1613b6a4c306cac19.tar.gz
launcher-f5f56f6a6bca5423fd3930a1613b6a4c306cac19.tar.bz2
launcher-f5f56f6a6bca5423fd3930a1613b6a4c306cac19.zip
[TC Fixed] Even without SPC.ni.dll, the application generates native image (#379)
Change-Id: I062ac6e2c57a7fc9faf45c3bc8e1315e377f9e7e
Diffstat (limited to 'tests')
-rwxr-xr-xtests/TCs/1_AOT/AOT.py27
-rw-r--r--tests/TCs/1_AOT/README.md12
2 files changed, 26 insertions, 13 deletions
diff --git a/tests/TCs/1_AOT/AOT.py b/tests/TCs/1_AOT/AOT.py
index f32488b..af7873a 100755
--- a/tests/TCs/1_AOT/AOT.py
+++ b/tests/TCs/1_AOT/AOT.py
@@ -39,7 +39,7 @@ def TC_01():
return "PASS"
-# The `Launcher_TC_AOT_02` application generates native image.
+# The `Launcher_TC_AOT_02` application generates native image when the SPC.ni.dll exists.
def TC_02():
if "OK" not in create_spc_ni():
return f"FAIL : Create native image for {SPC_DLL}"
@@ -80,7 +80,7 @@ def TC_02():
return "PASS"
-# The `Launcher_TC_AOT_03` application does not generate native image.
+# The `Launcher_TC_AOT_03` application generates native image when the SPC.ni.dll doesn't exist.
def TC_03():
if "OK" not in remove_system_ni():
return "FAIL : Remove the platform native image"
@@ -100,13 +100,24 @@ def TC_03():
if root_path == "None":
return f"FAIL : Get the root path for {pkg_id}"
- if exist(f"{root_path}/bin/.native_image"):
- return "FAIL : The .native_image folder should not exist"
+ if not exist(f"{root_path}/bin/.native_image"):
+ return "FAIL : The .native_image folder should exist"
- raw = cmd(f"shell find {root_path}/bin/ -name *.ni.dll")
- lines = [l for l in raw.splitlines()]
- if len(lines) != 0:
- return "FAIL : The .ni.dll files should not exist"
+ raw = cmd(f"shell find {root_path}/bin/.native_image/ -name *.ni.dll")
+ lines1 = [l for l in raw.splitlines()]
+ raw = cmd(f"shell find {root_path}/bin/ -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"
diff --git a/tests/TCs/1_AOT/README.md b/tests/TCs/1_AOT/README.md
index e5bc7b3..6a6e06c 100644
--- a/tests/TCs/1_AOT/README.md
+++ b/tests/TCs/1_AOT/README.md
@@ -36,20 +36,22 @@ launcher/tests/TCs/1_AOT$ ./AOT.py TC_01
3. The `.native_image` folder and `.ni.dll` files do not exist.
* TC_02
```
- PASS : The Launcher_TC_AOT_02 application generates native image.
+ PASS : The Launcher_TC_AOT_02 application generates native image when the SPC.ni.dll exists.
```
1. The `System.Private.CoreLib.ni.dll`(SPC.dll.Backup) file exists.
2. The `prefer_dotnet_aot` metadata value is `true` in the manifest.
3. The `.native_image` folder and `.ni.dll` files exist.
- 4. The number of `.dll` and `.ni.dll` in the application is the same.
- 5. The file name of `.dll` and `.ni.dll` must match in the application
+ 4. The number of `.dll` files and the number of `.ni.dll` files in the application are the same.
+ 5. The file names of `.dll` and `.ni.dll` must match in the application.
* TC_03
```
- PASS : The Launcher_TC_AOT_03 application does not generate native image.
+ PASS : The Launcher_TC_AOT_03 application generates native image when the SPC.ni.dll doesn't exist.
```
1. The `System.Private.CoreLib.ni.dll`(SPC.dll.Backup) file does not exist.
2. The `prefer_dotnet_aot` metadata value is `true` in the manifest.
- 3. The `.native_image` folder and `.ni.dll` files do not exist.
+ 3. The `.native_image` folder and `.ni.dll` files exist.
+ 4. The number of `.dll` files and the number of `.ni.dll` files in the application are the same.
+ 5. The file names of `.dll` and `.ni.dll` must match in the application.
----
### Note