openmainframeproject / cobol-check

A testing framework for Cobol applications
Apache License 2.0
78 stars 28 forks source link

Enable COBOL Check to issue warnings/errors when a call statement is not mocked. #288

Closed Rune-Christensen closed 12 months ago

Rune-Christensen commented 1 year ago

To enable truly isolated unit tests, we want to provide an option to trigger errors or warnings, when a call statement is not mocked. A call statement in a mocked section or paragraph should not throw an error.

AkashKumar7902 commented 1 year ago

@Rune-Christensen Hey, Just to confirm, do you want a behaviour where unmocked call statement inside section/paragraph will raise a warning and unmocked call statement not inside section/paragraph will raise an error ?

PROCEDURE DIVISION
UNMOCKED SECTION.
CALL 'PROG'.

the above should raise a warning.

PROCEDURE DIVISION.
CALL 'PROG'.

This would raise an error

Rune-Christensen commented 1 year ago

Hi @AkashKumar7902 I would like a behavior where all unmocked call statements raise an error or warning. Whether it should be an error or warning, should be determined by a configuration variable. The configuration variable should default to warning.

When a call statement is inside a section/paragraph, where the section/paragraph is mocked, the call statement should be considered mocked.

I hope that clears up the issue :-)

AkashKumar7902 commented 1 year ago

@Rune-Christensen can you please assign me this issue ?

AkashKumar7902 commented 12 months ago

Hey @Rune-Christensen Please close this issue.