{"id":19680998,"url":"https://github.com/codewars/cobol-test","last_synced_at":"2026-03-19T11:03:55.936Z","repository":{"id":73889977,"uuid":"425421693","full_name":"codewars/cobol-test","owner":"codewars","description":"Codewars test framework for COBOL","archived":false,"fork":false,"pushed_at":"2021-11-14T02:22:12.000Z","size":53,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-27T07:12:21.766Z","etag":null,"topics":["code-runner","test-framework"],"latest_commit_sha":null,"homepage":"","language":"COBOL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codewars.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-07T05:33:43.000Z","updated_at":"2024-06-07T16:46:12.000Z","dependencies_parsed_at":"2023-04-09T04:16:55.551Z","dependency_job_id":null,"html_url":"https://github.com/codewars/cobol-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codewars/cobol-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewars%2Fcobol-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewars%2Fcobol-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewars%2Fcobol-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewars%2Fcobol-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codewars","download_url":"https://codeload.github.com/codewars/cobol-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewars%2Fcobol-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30072542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-runner","test-framework"],"created_at":"2024-11-11T18:06:42.690Z","updated_at":"2026-03-04T05:32:43.569Z","avatar_url":"https://github.com/codewars.png","language":"COBOL","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Codewars Test Framework for COBOL\n\n### Project setup\n\n`src` contains the preprocessor `preprocessor.py` and two copybooks `tdata.cpy` and `tproc.cpy` which are imported by the preprocessed test code.\n\nAll COBOL projects contain the following files: `solution.cbl` and `tests.cbl`. `preloaded.cpy` is an optional copybook.\n\n### Running examples\n\n```\npython3 src/preprocessor.py example_hello/tests.cbl\n```\n\nThis command creates `example_hello/tests-out.cbl`.\n\n```\ncobc -x -std=ibm -O2 -fstatic-call -ffold-copy=lower -I src -I example_hello -o out example_hello/tests-out.cbl example_hello/solution.cbl\n```\n\nThis command compiles the source code and creates the executable `out`. The following options are used:\n- `-x`: build an executable program\n- `-std=ibm`: use warnings/features for the IBM COBOL (alternatively, `-std=ibm-strict` may be used but it lacks many useful intrinsic functions such as `trim`, `abs`).\n- `-fstatic-call`: all literal function calls are static.\n- `-ffold-copy=lower`: all copybook file names are converted to lower-case. So it is possible to write `copy preloaded` or `COPY PRELOADED`.\n- `-I`: the path to copybooks. \n- `-o`: the name of the output executable file.\n\n```\n./out\n```\n\nThe script `run` executes all these commands automatically:\n```\n./run example_hello\n```\n\n### Test code\n\nAll statements listed below (except those which start with `perform`) must begin on a separate line.\n\n#### `testsuite (identifier | literal)+.`\nStarts a group of tests. Examples:\n```\ntestsuite 'Group 1'.\ntestsuite 'Group ' n.\n```\nNote: the period at the end is mandatory. This period does not affect the statement scope. The maximum group title length is 100 characters.\n\n#### `testcase (identifier | literal)+.`\nStarts a test case. Examples:\n```\ntestcase 'Test 1'.\ntestcase 'Testing n = ' n.\n```\nNote: the period at the end is mandatory. This period does not affect the statement scope. The maximum test case title length is 100 characters.\n\n#### `expect (identifier | literal) to be (identifier | literal).`\nCompares the first indentifier with the second identifier (or literal) and reports a failure if they are different. Examples:\n```\nexpect result to be expected.\nexpect result to be '1. Hello, World!'.\nexpect field1 of result to be field1 of expected.\nexpect result(3) to be 1.0.\n```\nNote: the period at the end is mandatory. This period does not affect the statement scope.\n\n#### `end tests.`\nThis statement should be placed at the end of test code. It is possible to define subroutines after this statement. Note: the period at the end is mandatory.\n\n#### `assert-true`\nPrints a passed test message. Example:\n```cobol\nif result \u003e 0\n  move 'the result is positive' to assertion-message\n  perform assert-true\nend-if\n```\n\n#### `assert-false`\nPrints a failed test message. Example:\n```cobol\nif result \u003c= 0\n  move 'the result should be positive' to assertion-message\n  perform assert-false\nend-if\n```\n\n#### `set-random-seed`\nInitializes the random seed. The seed value is provided in the variable `random-seed`. If the value of `random-seed` is zero (the default value) then the random seed is initialized with the current time value. Example:\n```\nperform set-random-seed\n```\n\n#### `line-feed`\nThis constant can be used to display the line feed in test group or test case titles. Example:\n```cobol\ntestcase 'Fixed test' line-feed '(case 1)'.\n```\nIt also works with log messages:\n```cobol\ndisplay 'n = ' n line-feed 'm = ' m\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewars%2Fcobol-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewars%2Fcobol-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewars%2Fcobol-test/lists"}