diff --git a/CHANGELOG.md b/CHANGELOG.md index 0055d888..5947cb44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Mock SQL tables - Mock batch file I/O +## \[0.2.12\] 2024-10-07 +- Reverted unit test result twice fix and fixed the windows run tests script instead. This should fix double output error and missing output errors. +- Bumped versions to properly release vscode extension that uses new cobol-check. + ## \[0.2.11\] 2024-05-13 - Fixing bug when cobolcheck.test.program.name was ending with white spaces. diff --git a/README.md b/README.md index 732efc73..0fe64509 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ As of March 2022 we could use help with: ## Downloads -Version 0.2.10 pre-release is available! +Version 0.2.12 pre-release is available! [//]: # (- Find the download on the project home page on the [Neo Pragma site](https://neopragma.com/projects/cobol-check/).) - Find distributions here: [Cobol Check Ditributions](https://github.com/openmainframeproject/cobol-check/tree/Developer/build/distributions). diff --git a/build.gradle b/build.gradle index b8cc7b05..3e95befb 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { id 'jacoco' } -def productVersion = '0.2.11' +def productVersion = '0.2.12' def productName = 'cobol-check' group = 'org.openmainframeproject' description = 'Unit testing framework for Cobol' diff --git a/build/distributions/cobol-check-0.2.12.zip b/build/distributions/cobol-check-0.2.12.zip new file mode 100644 index 00000000..28750345 Binary files /dev/null and b/build/distributions/cobol-check-0.2.12.zip differ diff --git a/scripts/windows_gnucobol_run_tests.cmd b/scripts/windows_gnucobol_run_tests.cmd index d04a599c..c28b75b6 100644 --- a/scripts/windows_gnucobol_run_tests.cmd +++ b/scripts/windows_gnucobol_run_tests.cmd @@ -6,5 +6,4 @@ rem rem GnuCOBOL 3.+ is installed and on the path. Its executable or alias or symlink is named "cobc". %~d1 cd %~p1 -cobc -xj %* -%~n1 +cobc -xj %* \ No newline at end of file diff --git a/src/main/java/org/openmainframeproject/cobolcheck/features/launcher/ProcessOutputWriter.java b/src/main/java/org/openmainframeproject/cobolcheck/features/launcher/ProcessOutputWriter.java index b11d6d8d..3ec14691 100644 --- a/src/main/java/org/openmainframeproject/cobolcheck/features/launcher/ProcessOutputWriter.java +++ b/src/main/java/org/openmainframeproject/cobolcheck/features/launcher/ProcessOutputWriter.java @@ -61,42 +61,20 @@ public void writeProcessOutputToTestResultsFile(Process proc, TestOutputFormat f private void getProcessOut(Process proc) { StringBuilder processErrorBuilder = new StringBuilder(); + StringBuilder processInputBuilder = new StringBuilder(); final Object lock = new Object(); // For synchronizing access if necessary Thread inputThread = new Thread(() -> { - Reader reader = new InputStreamReader(proc.getInputStream()); - int maxBytesToReadFromCobolCheck = 25000; - char tempReadBuffer[] = new char[maxBytesToReadFromCobolCheck]; - int writeOffset = 0; - int numberOfCharsRead = 0; - char cobolCheckOutput[] = null; - try { - synchronized (lock) { - numberOfCharsRead = reader.read(tempReadBuffer, writeOffset, maxBytesToReadFromCobolCheck); - if(numberOfCharsRead > 0) { - if(numberOfCharsRead == maxBytesToReadFromCobolCheck) { - int largeMaxBytesToReadFromCobolCheck = 100000; - char largeTempReadBuffer[] = new char[maxBytesToReadFromCobolCheck + largeMaxBytesToReadFromCobolCheck]; - System.arraycopy(tempReadBuffer, 0, largeTempReadBuffer, 0, tempReadBuffer.length); - int largeNumberOfCharsRead = reader.read(largeTempReadBuffer, tempReadBuffer.length, largeMaxBytesToReadFromCobolCheck); - numberOfCharsRead += largeNumberOfCharsRead; - cobolCheckOutput = new char[numberOfCharsRead]; - System.arraycopy(largeTempReadBuffer, 0, cobolCheckOutput, 0, numberOfCharsRead); - } - else { - cobolCheckOutput = new char[numberOfCharsRead]; - System.arraycopy(tempReadBuffer, 0, cobolCheckOutput, 0, numberOfCharsRead); - } + try (BufferedReader stdOut = new BufferedReader(new InputStreamReader(proc.getInputStream()))) { + String s; + while ((s = stdOut.readLine()) != null) { + synchronized (lock) { + processInputBuilder.append(s).append(Constants.NEWLINE); } - reader.close(); } } catch (IOException e) { Log.warn(Messages.get("WRN007")); } - processInput = ""; - for (int i = 0; i < numberOfCharsRead; i++) { - processInput += cobolCheckOutput[i]; - } }); Thread errorThread = new Thread(() -> { @@ -125,7 +103,7 @@ private void getProcessOut(Process proc) { } // Convert StringBuilder to String, removing the last NEWLINE if necessary - processInput = StringHelper.removeLastIndex(processInput.toString()); + processInput = StringHelper.removeLastIndex(processInputBuilder.toString()); processError = StringHelper.removeLastIndex(processErrorBuilder.toString()); } diff --git a/vs-code-extension/CHANGELOG.md b/vs-code-extension/CHANGELOG.md index 126d1ac7..c15c3519 100644 --- a/vs-code-extension/CHANGELOG.md +++ b/vs-code-extension/CHANGELOG.md @@ -1,6 +1,10 @@ # Change Log All notable changes to the "cobol-unit-test" extension will be documented in this file. Versioning according to SemVer: https://semver.org/ + +## [0.4.5] 04.04.2024 +- Now using COBOL Check version 0.2.12 + ## [0.4.4] 04.04.2024 - Now using COBOL Check version 0.2.9 diff --git a/vs-code-extension/Cobol-check/bin/cobol-check-0.2.11.jar b/vs-code-extension/Cobol-check/bin/cobol-check-0.2.12.jar similarity index 89% rename from vs-code-extension/Cobol-check/bin/cobol-check-0.2.11.jar rename to vs-code-extension/Cobol-check/bin/cobol-check-0.2.12.jar index 9e31f8e5..a1753523 100644 Binary files a/vs-code-extension/Cobol-check/bin/cobol-check-0.2.11.jar and b/vs-code-extension/Cobol-check/bin/cobol-check-0.2.12.jar differ diff --git a/vs-code-extension/client/src/extension.ts b/vs-code-extension/client/src/extension.ts index 6aead5b7..b3d25da5 100644 --- a/vs-code-extension/client/src/extension.ts +++ b/vs-code-extension/client/src/extension.ts @@ -20,7 +20,7 @@ import { getContentFromFilesystem, MarkdownTestData, TestCase, testData, TestFil let externalVsCodeInstallationDir = vscode.extensions.getExtension("openmainframeproject.cobol-check-extension").extensionPath; let configPath = appendPath(externalVsCodeInstallationDir, 'Cobol-check/config.properties'); let defaultConfigPath = appendPath(externalVsCodeInstallationDir, 'Cobol-check/default.properties'); -let cobolCheckJarPath = appendPath(externalVsCodeInstallationDir, 'Cobol-check/bin/cobol-check-0.2.11.jar'); +let cobolCheckJarPath = appendPath(externalVsCodeInstallationDir, 'Cobol-check/bin/cobol-check-0.2.12.jar'); let currentPlatform = getOS(); diff --git a/vs-code-extension/client/src/services/TestTree.ts b/vs-code-extension/client/src/services/TestTree.ts index bffc334a..728def86 100644 --- a/vs-code-extension/client/src/services/TestTree.ts +++ b/vs-code-extension/client/src/services/TestTree.ts @@ -10,7 +10,7 @@ import { handleCobolCheckOut } from '../Helpers/ExtensionHelper'; const textDecoder = new TextDecoder('utf-8'); let externalVsCodeInstallationDir = vscode.extensions.getExtension("openmainframeproject.cobol-check-extension").extensionPath; let configPath = appendPath(externalVsCodeInstallationDir, 'Cobol-check/config.properties'); -let cobolCheckJarPath = appendPath(externalVsCodeInstallationDir, 'Cobol-check/bin/cobol-check-0.2.11.jar'); +let cobolCheckJarPath = appendPath(externalVsCodeInstallationDir, 'Cobol-check/bin/cobol-check-0.2.12.jar'); diff --git a/vs-code-extension/package.json b/vs-code-extension/package.json index 1f857f95..83596dd3 100644 --- a/vs-code-extension/package.json +++ b/vs-code-extension/package.json @@ -8,7 +8,7 @@ "Snippets" ], "description": "Extension for running unit tests in Cobol", - "version": "0.4.4", + "version": "0.4.5", "icon": "images/cobol-check-logo-small.png", "repository": { "type": "git", @@ -40,7 +40,7 @@ } ], "description": "Extension for running unit tests in Cobol", - "version": "0.4.4", + "version": "0.4.5", "icon": "images/cobol-check-logo-small.png", "repository": { "type": "git",