Skip to content

Commit

Permalink
Fixed build/test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Egeberg Hansen committed Oct 20, 2023
1 parent 88305e8 commit 993e361
Show file tree
Hide file tree
Showing 8 changed files with 228 additions and 5 deletions.
Binary file modified build/distributions/cobol-check-0.2.8.zip
Binary file not shown.
202 changes: 202 additions & 0 deletions config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
# Configuration settings for Cobol Check

#---------------------------------------------------------------------------------------------------------------------
# This configuration - echoed to console when Cobol Check is executed, for information only.
#---------------------------------------------------------------------------------------------------------------------
config.loaded = production

#---------------------------------------------------------------------------------------------------------------------
# Prefix for field names and paragraph names in the test management code that cobol-check
# inserts into programs to be tested. The default is "UT-". If this conflicts with names
# in the programs to be tested, you can override it with a value you specify here.
# The value must be 3 characters or less. Cannot be empty.
#---------------------------------------------------------------------------------------------------------------------
cobolcheck.prefix = UT-

#---------------------------------------------------------------------------------------------------------------------
# Tags written in the generated test code in the form of a comment, when a code injection starts and ends.
# Default is null, which will prevent the tags from appearing. Any other value will appear as comments
# surrounding the injected code.
# Examples:
# cobolcheck.injectedCodeTag.start = ###INJECT START###
# cobolcheck.injectedCodeTag.end = ###INJECT END###
#---------------------------------------------------------------------------------------------------------------------
cobolcheck.injectedCodeTag.start = null
cobolcheck.injectedCodeTag.end = null

#---------------------------------------------------------------------------------------------------------------------
# A tag written at the start of entities stubbed by default. Recommended value-length <= 4.
# Note: The tag will appear only when cobolcheck stubs lines by default.
# This is the case for CALLs and batch file IO verbs.
# Default is null, which will prevent the tag from appearing.
#---------------------------------------------------------------------------------------------------------------------
cobolcheck.stub.comment.tag = null

#---------------------------------------------------------------------------------------------------------------------
# Determines if cobolcheck should generate code, such that decimal point is comma.
# The default is "false". The value should be set to "true" if the compiler is set to
# read decimal points as commas. If the cobol source program sets DECIMAL-POINT IS COMMA,
# this configuration will be overwritten.
# Example: 1,385,481.00 (decimalPointIsComma = false)
# Example: 1.385.481,00 (decimalPointIsComma = true)
#---------------------------------------------------------------------------------------------------------------------
cobolcheck.decimalPointIsComma = false

#---------------------------------------------------------------------------------------------------------------------
# If the source program contains rules as the first line follwed by CBL, the given value will be appended
# to this.
# If no CBL is found in source, it will be added along with the given value
# default is null, which will make no changes.
#---------------------------------------------------------------------------------------------------------------------
cobolcheck.append.rules = null

#---------------------------------------------------------------------------------------------------------------------
# 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 = Cobol-check

#---------------------------------------------------------------------------------------------------------------------
# Suffix to append to the name of each program under test to produce the name of the corresponding
# test program that contains the merged test code.
# Example: For program ABCXYZ4, if suffix is T.CBL then the test program name will be ABCXYZ4T.CBL.
#---------------------------------------------------------------------------------------------------------------------
cobolcheck.test.program.name = CC##99.CBL

#---------------------------------------------------------------------------------------------------------------------
# Path for the generated testsuite parse error log
# Default: ./
#---------------------------------------------------------------------------------------------------------------------
testsuite.parser.error.log.path = Cobol-check

#---------------------------------------------------------------------------------------------------------------------
# Name of the generated testsuite parse error log file - with extension
# Default: ParserErrorLog.txt
#---------------------------------------------------------------------------------------------------------------------
testsuite.parser.error.log.name = ParserErrorLog.txt

#---------------------------------------------------------------------------------------------------------------------
# The charset that cobolcheck will use when reading- and writing to files.
# See https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html, for a list of
# valid values.
# Default value for each OS is <default>, which will use the default encoding for the OS.
#---------------------------------------------------------------------------------------------------------------------
cobolcheck.file.encoding.linux = default
cobolcheck.file.encoding.macosx = default
cobolcheck.file.encoding.windows = default
cobolcheck.file.encoding.zos = default
cobolcheck.file.encoding.unix = default

#---------------------------------------------------------------------------------------------------------------------
# Sets permissions for all files generated by Cobol Check, for all users.
# If read, write and execute permissions are set, all users can perform said actions on all files
# that Cobol Check generates.
# Value can be any permutation of the letters: 'rwx' (read, write, execute) or none - meaning no permissions.
# Default value: rx
#---------------------------------------------------------------------------------------------------------------------
generated.files.permission.all = rx

#---------------------------------------------------------------------------------------------------------------------
# Determines if Cobol Check should run the generated test program.
# Default is true.
# If set to false, Cobol Check will generate the code, but not run it. If more than one program
# is given as a command line option, the generated test file will be overwritten. Thus if set to false,
# only one program should be given at a time.
#---------------------------------------------------------------------------------------------------------------------
cobolcheck.test.run = true

#---------------------------------------------------------------------------------------------------------------------
# These settings are to locate the application code under test in *your* Cobol project directory tree.
# Can be absolute path or relative to project root.
#---------------------------------------------------------------------------------------------------------------------
application.source.directory = src/main/cobol
application.copybook.directory = src/main/cobol/copy

#---------------------------------------------------------------------------------------------------------------------
# Location of test suite input file(s). This can also be passed on command-line option --test-suite-path.
#---------------------------------------------------------------------------------------------------------------------
test.suite.directory = src/test/cobol

#---------------------------------------------------------------------------------------------------------------------
# Location of test output. File extension is determined by a given format.
#---------------------------------------------------------------------------------------------------------------------
test.results.file = vs-code-extension/Cobol-check/output/testResults

#---------------------------------------------------------------------------------------------------------------------
# Determines the format of the test results written to the output file.
# Supported formats: txt, xml, html.
#---------------------------------------------------------------------------------------------------------------------
test.results.format = html

#---------------------------------------------------------------------------------------------------------------------
# Determines the format style of the test results written to the output file.
# The style controls the hierarchy and structure of data and naming of the 'object' that is written
# in a given format. Format: txt and style: directOutput are exclusive. txt cannot use any other style
# than directOutput, and directOutput cannot be used with any other format than txt.
# Other formats and styles can be used interchangeably.
# Supported styles: directOutput, JUnit, tableDocument, tableEmbed
#---------------------------------------------------------------------------------------------------------------------
test.results.format.style = tableDocument

#---------------------------------------------------------------------------------------------------------------------
# If application source filenames have a suffix, specify it here without the period or dot.
#---------------------------------------------------------------------------------------------------------------------
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,CPY,cpy

#---------------------------------------------------------------------------------------------------------------------
# Optional override of system default Locale for log messages and exception messages.
#---------------------------------------------------------------------------------------------------------------------
#locale.language = ja
#locale.country =
#locale.variant =

#---------------------------------------------------------------------------------------------------------------------
# Cobol Check concatenates multiple test suite input files into a single file for the Generator.
# This is the relative or absolute path of the concatenated file. If not specified, the default
# is "./ALLTESTS" relative to the directory in which Cobol Check was started.
#---------------------------------------------------------------------------------------------------------------------
concatenated.test.suites = Cobol-check/ALLTESTS

#---------------------------------------------------------------------------------------------------------------------
# The GnuCOBOL compiler has a lot of different compile options.
# Some of these options are gathered in a dialect file (default: default.conf)
# and are located in the "GnuCOBOL-installationfolder/config"-folder.
# If you need any specific dialect file or other GnuCOBOL-specific compile options, you can add them here.
# If not specified, the default will be the normal GnuCOBOL compile setup.
# Separate options with a comma. Set the value to 'null' for default compile options
# Example:
# gnucobol.compile.options = -std=ibm,-fsingle-quote
#---------------------------------------------------------------------------------------------------------------------
gnucobol.compile.options = -std=ibm,-fsingle-quote,-fnot-reserved=EVENT

#---------------------------------------------------------------------------------------------------------------------
# Shell scripts and JCL files for executing your test suites.
# Cobol Check will invoke one of these after creating the copy of the program under test that contains
# test code generated from your test suites.
# Unix and Mac OS X are both treated as unix. Most unices can run the linux script.
# Unix is the default.
# You can write custom scripts/JCL for your environment, for instance if you are using a different Cobol compiler.
# The first element in these names reflects the first few characters returned by Java's System.getProperty("os.name").
# Cobol Check will select one of these entries based on which platform it thinks it's running on.
#---------------------------------------------------------------------------------------------------------------------

cobolcheck.script.directory = Cobol-check/scripts
linux.process = linux_gnucobol_run_tests
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
cobol_run_tests
cobol_run_tests

11 changes: 11 additions & 0 deletions scripts/linux_gnucobol_run_tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
# Linux - 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".

cd "$(dirname $1)"
cobc -xj $@
name=$(echo "$1" | cut -f 1 -d '.')
"${name}"
10 changes: 10 additions & 0 deletions scripts/windows_gnucobol_run_tests.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off
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
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void it_returns_empty_string_when_application_copybook_filenames_have_no_
@Test
public void it_returns_list_of_specified_application_copybook_filename_suffixes() {
Config.load("testconfig.properties");
List<String> expected = new ArrayList(Arrays.asList( ".CBL", ".cbl", ".COB", ".cob" ));
List<String> expected = new ArrayList(Arrays.asList( ".CBL", ".cbl", ".COB", ".cob", ".CPY", ".cpy"));
assertEquals(expected, Config.getCopybookFilenameSuffixes());
}
}
2 changes: 1 addition & 1 deletion testconfig.properties
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,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
4 changes: 2 additions & 2 deletions vs-code-extension/Cobol-check/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -124,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 @@ -151,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
2 changes: 1 addition & 1 deletion vs-code-extension/Cobol-check/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -124,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 Down

0 comments on commit 993e361

Please sign in to comment.