otterkit / otterkit-cobol

A free and open source Standard COBOL compiler for 64-bit environments
https://otterkit.com
Apache License 2.0
249 stars 15 forks source link

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

Open birojnayak opened 1 year ago

birojnayak commented 1 year ago

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.

KTSnowy commented 1 year ago

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

birojnayak commented 1 year ago

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.

KTSnowy commented 1 year ago

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).

birojnayak commented 1 year ago

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...

KTSnowy commented 1 year ago

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?

GitMensch commented 1 year ago

You may opt to autofonce.