otterkit-cobol icon indicating copy to clipboard operation
otterkit-cobol copied to clipboard

We need to add few unit tests to ensure the functionality not broken with PR

Open birojnayak opened this issue 1 year ago • 6 comments

**Is your feature request related to a problem? ** As a first step towards CI/CD for every check in, we need to establish some unit tests for each components here.

**Is your feature request related to another COBOL dialect? ** A clear and concise description of what the feature is, and which COBOL dialect currently implements it.

**If the feature request is related to another COBOL dialect: Is the requested feature compatible with our current implementation and does it conform to the latest COBOL standard? **

Describe the solution you'd like I would like us to create a folder Tests and have unit test projects to address any bug injection to improve the code quality.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

birojnayak avatar May 17 '23 21:05 birojnayak

I would like us to create a folder Tests and have unit test projects to address any bug injection to improve the code quality.

We could create a new testing package in the Libraries directory (Libraries/Otterkit.Testing), what do you think?

I say testing package so that we can keep it separate from the compiler itself, and use it to test other parts of Otterkit.

The libraries directory has both the runtime library and decimal arithmetic library, those could also benefit from automated testing for PRs: https://github.com/otterkit/otterkit/tree/main/Libraries

KTSnowy avatar May 17 '23 21:05 KTSnowy

Generally the test package folder are kept under each project and eventually when we set up each CI/CD we will run those project. E:g:- here and here . See if you can keep like that, we might restructure in future.

birojnayak avatar May 18 '23 15:05 birojnayak

I'll add test folders for each. Should we have one Tests folder for the whole compiler, or one folder for each part of it (Tokenizer, Analyzer, etc.)?

Oh also, I'll open a new issue on manual memory allocation. COBOL has the ALLOCATE and FREE statements, as well as ADDRESS OF identifiers. We need to figure out the memory allocation method for these, and how to get the address of a data item (C# doesn't allow this, I think).

KTSnowy avatar May 18 '23 16:05 KTSnowy

I'll add test folders for each. Should we have one Tests folder for the whole compiler, or one folder for each part of it (Tokenizer, Analyzer, etc.)?

One folder for each part of it.. so that we will know which part tests failed...

birojnayak avatar May 18 '23 17:05 birojnayak

Hey @birojnayak, GitHub doesn't let me commit empty folders, so I should probably add something in them to add the folders to the repo.

Which testing framework would you recommend for us to use?

KTSnowy avatar May 19 '23 17:05 KTSnowy

You may opt to autofonce.

GitMensch avatar Aug 14 '23 21:08 GitMensch