From 5f2c60a9274b2a72c59cf84ebfdeebbd90c07b1a Mon Sep 17 00:00:00 2001 From: Lars Egeberg Hansen Date: Wed, 20 Sep 2023 14:08:05 +0200 Subject: [PATCH] Showing unittests in Testing extension on win fixed --- .../Cobol-check/config.properties | 3 +- vs-code-extension/client/src/extension.ts | 33 ++++++++++--------- .../client/src/services/CobolCheckLauncher.ts | 5 ++- .../client/src/services/TestTree.ts | 5 +-- vs-code-extension/package.json | 2 +- 5 files changed, 27 insertions(+), 21 deletions(-) diff --git a/vs-code-extension/Cobol-check/config.properties b/vs-code-extension/Cobol-check/config.properties index 5347f7b0..7785ca86 100644 --- a/vs-code-extension/Cobol-check/config.properties +++ b/vs-code-extension/Cobol-check/config.properties @@ -173,7 +173,7 @@ concatenated.test.suites = Cobol-check/ALLTESTS # Example: # gnucobol.compile.options = -std=ibm,-fsingle-quote #--------------------------------------------------------------------------------------------------------------------- -gnucobol.compile.options = null +gnucobol.compile.options = -std=ibm,-fsingle-quote,-fnot-reserved=EVENT #--------------------------------------------------------------------------------------------------------------------- # Shell scripts and JCL files for executing your test suites. @@ -195,3 +195,4 @@ zos.process = unix.process = linux_gnucobol_run_tests cobol_run_tests cobol_run_tests + diff --git a/vs-code-extension/client/src/extension.ts b/vs-code-extension/client/src/extension.ts index 1fea14e3..e41a8a91 100644 --- a/vs-code-extension/client/src/extension.ts +++ b/vs-code-extension/client/src/extension.ts @@ -241,10 +241,13 @@ async function createDirectoryItems( controller:vscode.TestController, uri: vsco // Create TestFile for each directory var isInsideTestSuite: boolean = await getIsInsideTestSuiteDirectory1(uri.fsPath) - // const dirArr = vscode.workspace.asRelativePath(uri.fsPath).split(getFileSeperatorForOS(currentPlatform)) - const dirArr = vscode.workspace.asRelativePath(uri.fsPath).split("/") - const rootDir = uri.fsPath.replace(vscode.workspace.asRelativePath(uri.fsPath),"") - const rootUri = rootDir+dirArr[0] + const directory = vscode.workspace.asRelativePath(uri.fsPath) + let splitChar = '/' + if(!directory.includes(splitChar)) + splitChar = '\\' + const dirArr = directory.split(splitChar); + const rootDir = vscode.workspace.getWorkspaceFolder(uri).uri.fsPath; + const rootUri = rootDir + '/' + dirArr[0] let tmpUri = vscode.Uri.file(rootUri); var file :vscode.TestItem = null; @@ -272,8 +275,7 @@ async function createDirectoryItems( controller:vscode.TestController, uri: vsco var tmpData = null for(var i =1;i