From 34357a46cf8f5a0a7e2897079355eeb1055ca9fb Mon Sep 17 00:00:00 2001 From: Don HO Date: Tue, 25 Aug 2020 02:21:51 +0200 Subject: [PATCH] Unit-tests for function-list Close #8757, close #8762 --- .../bash/unitTest.expected.result | 2 +- .../bash/unitTest.expected.result.correct | 1 + .../Test/FunctionList/unitTestLauncher.ps1 | 36 ++++++------------- .../Test/FunctionList/{VHDL => vhdl}/unitTest | 0 .../{VHDL => vhdl}/unitTest.expected.result | 0 5 files changed, 12 insertions(+), 27 deletions(-) create mode 100644 PowerEditor/Test/FunctionList/bash/unitTest.expected.result.correct rename PowerEditor/Test/FunctionList/{VHDL => vhdl}/unitTest (100%) rename PowerEditor/Test/FunctionList/{VHDL => vhdl}/unitTest.expected.result (100%) diff --git a/PowerEditor/Test/FunctionList/bash/unitTest.expected.result b/PowerEditor/Test/FunctionList/bash/unitTest.expected.result index 71444fef..c53b0b3f 100644 --- a/PowerEditor/Test/FunctionList/bash/unitTest.expected.result +++ b/PowerEditor/Test/FunctionList/bash/unitTest.expected.result @@ -1 +1 @@ -{"leaves":["setenv","action_needed","canonicalize_path","make_module","db2_name","versioned_copy"],"root":"unitTest"} \ No newline at end of file +{"leaves":["action_needed","canonicalize_path","make_module","db2_name","versioned_copy"],"root":"unitTest"} \ No newline at end of file diff --git a/PowerEditor/Test/FunctionList/bash/unitTest.expected.result.correct b/PowerEditor/Test/FunctionList/bash/unitTest.expected.result.correct new file mode 100644 index 00000000..71444fef --- /dev/null +++ b/PowerEditor/Test/FunctionList/bash/unitTest.expected.result.correct @@ -0,0 +1 @@ +{"leaves":["setenv","action_needed","canonicalize_path","make_module","db2_name","versioned_copy"],"root":"unitTest"} \ No newline at end of file diff --git a/PowerEditor/Test/FunctionList/unitTestLauncher.ps1 b/PowerEditor/Test/FunctionList/unitTestLauncher.ps1 index 2d8ff79b..f10128f4 100644 --- a/PowerEditor/Test/FunctionList/unitTestLauncher.ps1 +++ b/PowerEditor/Test/FunctionList/unitTestLauncher.ps1 @@ -1,47 +1,31 @@ -..\..\bin\notepad++.exe -export=functionList -lasm .\asm\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lautoit .\autoit\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lbash .\bash\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lbatch .\batch\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lc .\c\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lcpp .\cpp\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lcs .\cs\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lini .\ini\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -linno .\inno\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -ljava .\java\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -ljavascript .\javascript\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lnsis .\nsis\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lperl .\perl\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lphp .\php\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lpowershell .\powershell\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lpython .\python\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lruby .\ruby\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lvhdl .\vhdl\unitTest | Out-Null -..\..\bin\notepad++.exe -export=functionList -lxml .\xml\unitTest | Out-Null - $testRoot = ".\" Get-ChildItem $testRoot -Filter *.* | Foreach-Object { if ((Get-Item $testRoot$_) -is [System.IO.DirectoryInfo]) - { + { + $dirName = (Get-Item $testRoot$_).Name + ..\..\bin\notepad++.exe -export=functionList -l"$dirName" $testRoot$_\unitTest | Out-Null + $expectedRes = Get-Content $testRoot$_\unitTest.expected.result $generatedRes = Get-Content $testRoot$_\unitTest.result.json if ($generatedRes -eq $expectedRes) { Remove-Item $testRoot$_\unitTest.result.json - "" - "OK" + "$dirName ... OK" } else { - "$generatedRes" + "$dirName ... KO" + "" + "There's a (some) problem(s) in your functionList.xml" exit -1 } } } - +"" +"All tests are passed." exit 0 - diff --git a/PowerEditor/Test/FunctionList/VHDL/unitTest b/PowerEditor/Test/FunctionList/vhdl/unitTest similarity index 100% rename from PowerEditor/Test/FunctionList/VHDL/unitTest rename to PowerEditor/Test/FunctionList/vhdl/unitTest diff --git a/PowerEditor/Test/FunctionList/VHDL/unitTest.expected.result b/PowerEditor/Test/FunctionList/vhdl/unitTest.expected.result similarity index 100% rename from PowerEditor/Test/FunctionList/VHDL/unitTest.expected.result rename to PowerEditor/Test/FunctionList/vhdl/unitTest.expected.result