From f8bba84b84c99151ff06d039881afe1191fd8811 Mon Sep 17 00:00:00 2001 From: Laurent Ellerbach Date: Fri, 26 Feb 2021 23:43:18 +0300 Subject: [PATCH] fixing pe file loading --- source/TestAdapter/Executor.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/source/TestAdapter/Executor.cs b/source/TestAdapter/Executor.cs index 042fed6..deec0eb 100644 --- a/source/TestAdapter/Executor.cs +++ b/source/TestAdapter/Executor.cs @@ -148,11 +148,8 @@ private List RunTest(List tests) Settings.LoggingLevel.Verbose); var source = tests.First().Source; - var nfUnitTestLauncherLocation = source.Replace(Path.GetFileName(source), "nanoFramework.UnitTestLauncher.pe"); - var workingDirectory = Path.GetDirectoryName(nfUnitTestLauncherLocation); - var mscorlibLocation = source.Replace(Path.GetFileName(source), "mscorlib.pe"); - var nfTestFrameworkLocation = source.Replace(Path.GetFileName(source), "nanoFramework.TestFramework.pe"); - var nfAssemblyUnderTestLocation = source.Replace(".dll", ".pe"); + var allPeFiles = Directory.GetFiles(Path.GetFileName(source), "*.pe"); + var workingDirectory = Path.GetDirectoryName(source); // prepare the process start of the WIN32 nanoCLR _nanoClr = new Process(); @@ -169,7 +166,13 @@ private List RunTest(List tests) // 2. mscorlib // 3. test framework // 4. test application - string parameter = $"-load {nfUnitTestLauncherLocation} -load {mscorlibLocation} -load {nfTestFrameworkLocation} -load {nfAssemblyUnderTestLocation}"; + StringBuilder str = new StringBuilder(); + foreach(var pe in allPeFiles) + { + str.Append($" -load {pe}"); + } + + string parameter = str.ToString(); _logger.LogMessage( "Launching process with nanoCLR...",