Skip to content

Commit

Permalink
Merge branch 'Developer' of https://github.com/openmainframeproject/c…
Browse files Browse the repository at this point in the history
…obol-check into Prepare-new-version
  • Loading branch information
Rune Christensen committed Oct 23, 2023
2 parents 37236b6 + b0b39da commit bc64fe3
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 21 deletions.
8 changes: 6 additions & 2 deletions config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ cobolcheck.decimalPointIsComma = false
cobolcheck.append.rules = null

#---------------------------------------------------------------------------------------------------------------------
# Path for the generated Cobol test code
# Path for the generated Cobol test code and the executeable file
# On Linux begin the path with a / to make it absolute and an x:\\ or x:/ to do he same on Windows.
# Default: ./
#---------------------------------------------------------------------------------------------------------------------
# cobolcheck.test.program.path = /home/myName/temp
# cobolcheck.test.program.path = c:\\Developer\\temp
# cobolcheck.test.program.path = c:/Developer/temp
cobolcheck.test.program.path = ./

#---------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -200,4 +204,4 @@ osx.process = linux_gnucobol_run_tests
freebsd.process = linux_gnucobol_run_tests
windows.process = windows_gnucobol_run_tests.cmd
zos.process =
unix.process = linux_gnucobol_run_tests
unix.process = linux_gnucobol_run_tests
5 changes: 3 additions & 2 deletions scripts/linux_gnucobol_run_tests
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#
# GnuCOBOL 2.2 or later is installed and on the path. Its executable or alias or symlink is named "cobc".

cobc -x $@
cd "$(dirname $1)"
cobc -xj $@
name=$(echo "$1" | cut -f 1 -d '.')
"${name}"
"${name}"
5 changes: 4 additions & 1 deletion scripts/windows_gnucobol_run_tests.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ rem
rem Assumptions:
rem
rem GnuCOBOL 3.+ is installed and on the path. Its executable or alias or symlink is named "cobc".
cobc -x %* && "%~dpn1"
%~d1
cd %~p1
cobc -xj %*
%~n1
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ private static String getCorrectRunContext(String path){
if (path.startsWith(".") && path.length() > 0){
path = path.substring(1);
}
if (path.length() > 0 && (path.startsWith("/") || path.substring(1,3).equals(":\\") || path.substring(1,3).equals(":/"))){
return StringHelper.adjustPathString(path);
}
return StringHelper.adjustPathString(PathHelper.endWithFileSeparator(runDirectory) + path);
}
return StringHelper.adjustPathString(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class FileNameMatcher extends SimpleFileVisitor<Path> {
private boolean defaultToAllFiles = false;

public FileNameMatcher(String pattern) {
if (pattern.length() == 0) {
if (pattern.length() == 0 || pattern.equals("null")) {
defaultToAllFiles = true;
}
matcher = FileSystems.getDefault().getPathMatcher("glob:" + pattern);
Expand Down
8 changes: 6 additions & 2 deletions vs-code-extension/Cobol-check/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ cobolcheck.decimalPointIsComma = false
cobolcheck.append.rules = null

#---------------------------------------------------------------------------------------------------------------------
# Path for the generated Cobol test code
# Path for the generated Cobol test code and the executeable file
# On Linux begin the path with a / to make it absolute and an x:\\ or x:/ to do he same on Windows.
# Default: ./
#---------------------------------------------------------------------------------------------------------------------
cobolcheck.test.program.path = ./
# cobolcheck.test.program.path = /home/myName/temp
# cobolcheck.test.program.path = c:\\Developer\\temp
# cobolcheck.test.program.path = c:/Developer/temp
cobolcheck.test.program.path = Cobol-check

#---------------------------------------------------------------------------------------------------------------------
# Suffix to append to the name of each program under test to produce the name of the corresponding
Expand Down
14 changes: 9 additions & 5 deletions vs-code-extension/Cobol-check/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ cobolcheck.decimalPointIsComma = false
cobolcheck.append.rules = null

#---------------------------------------------------------------------------------------------------------------------
# Path for the generated Cobol test code
# Path for the generated Cobol test code and the executeable file
# On Linux begin the path with a / to make it absolute and an x:\\ or x:/ to do he same on Windows.
# Default: ./
#---------------------------------------------------------------------------------------------------------------------
cobolcheck.test.program.path = Cobol-check
# cobolcheck.test.program.path = /home/myName/temp
# cobolcheck.test.program.path = c:\\Developer\\temp
# cobolcheck.test.program.path = c:/Developer/temp
cobolcheck.test.program.path = ./

#---------------------------------------------------------------------------------------------------------------------
# Suffix to append to the name of each program under test to produce the name of the corresponding
Expand All @@ -67,7 +71,7 @@ cobolcheck.test.program.name = CC##99.CBL
# Path for the generated testsuite parse error log
# Default: ./
#---------------------------------------------------------------------------------------------------------------------
testsuite.parser.error.log.path = Cobol-check
testsuite.parser.error.log.path = ./

#---------------------------------------------------------------------------------------------------------------------
# Name of the generated testsuite parse error log file - with extension
Expand Down Expand Up @@ -120,7 +124,7 @@ test.suite.directory = src/test/cobol
#---------------------------------------------------------------------------------------------------------------------
# Location of test output. File extension is determined by a given format.
#---------------------------------------------------------------------------------------------------------------------
test.results.file = Cobol-check/output/testResults
test.results.file = vs-code-extension/Cobol-check/output/testResults

#---------------------------------------------------------------------------------------------------------------------
# Determines the format of the test results written to the output file.
Expand All @@ -147,7 +151,7 @@ application.source.filename.suffix = CBL,cbl,COB,cob
# If application copybook filenames have a suffix, specify it here without the period or dot
# e.g. application.copybook.filename.suffix = CBL
#---------------------------------------------------------------------------------------------------------------------
application.copybook.filename.suffix = CBL,cbl,COB,cob
application.copybook.filename.suffix = CBL,cbl,COB,cob,CPY,cpy

#---------------------------------------------------------------------------------------------------------------------
# Optional override of system default Locale for log messages and exception messages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
# GnuCOBOL 2.2 or later is installed and on the path.
# Its executable or alias or symlink is named "cobc".

cd "$(dirname $1)"
cobc -xj $@
name=$(echo "$1" | cut -f 1 -d '.')
"${name}"
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
@echo off
:: Windows - compile and execute a test Cobol program
::
:: Assumptions:
::
:: GnuCOBOL 2.2 or later is installed and on the path.
:: Its executable or alias or symlink is named "cobc".

cobc -xj %* && %~n1
rem Windows - compile and execute a test Cobol program
rem
rem Assumptions:
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

0 comments on commit bc64fe3

Please sign in to comment.