GithubHelp home page GithubHelp logo

Upgrade test engine about typecobol HOT 3 CLOSED

typecobolteam avatar typecobolteam commented on August 22, 2024
Upgrade test engine

from typecobol.

Comments (3)

osmedile avatar osmedile commented on August 22, 2024

In order to ease tests writing, it should be useful to have only one file to describe tests cases.
In this file you could write the statements to test, if this statement is expected to be parsed correctly and then the expected processed statement.
Ex:
Ok: add a to b -> add a to b *> the test statement and processed statement are identical
Ok: add a to b *> same test as above. In this case the expected statement will be equals to the statement to test
Ko: add to b *> Parsing error expected
OK: add toto titi tata to X -> add toto titi tata to X *> in the processed statement all redundant spaces are trimmed

This kind of test could be written by Cobol developper without knowledge of the TypeCobol parser.

from typecobol.

wiztigers avatar wiztigers commented on August 22, 2024

I think the form given to a specific result file could be given by its name.
For example, corresponding to source cobol file named ADD.cbl (put in Samples\Statements folder), could be (in ResultFiles\Statements folder) :

  • ADDCodeElements.txt, containing the CodeElement.ToString() calls as we know it
  • ADDRPN.txt, containing the conversion to Reverse Polish Notation strings
  • ADDNY.txt, containing just "Y" or "N" depending of the correct (or incorrect) parsing of each line
  • whatever else we think of

For a given cobol file, the test engine could find all files beginning with ADD, deciding wich comparison happens by looking at the suffix, and defaulting to CodeElement comparison if it only finds ADD.txt as a result file.
If no result file is to be found, an error would be thrown.

This solution is more flexible that what we have (even considering today's improvements), but would prevent having for example the files ADD.cbl and ADDErrors.cbl in the same folder. We should have ADDSuccesses.cbl and ADDErrors.cbl instead.

from typecobol.

wiztigers avatar wiztigers commented on August 22, 2024

Since a few months, test engine automatically test files in subfolders of TypeCobol.Test/Compiler/Parser/Samples and compare results with expected result files in subfolders of TypeCobol.Test/Compiler/Parser.
Different comparators can be used, depending of the name of a given result file.
You can create more than one expected result file for a given sample file if you want to run different comparators for the same sample.

Let's say it's enough to close this issue.
Create other issue if additional needs arise.

from typecobol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.