{"id":16642077,"url":"https://github.com/artskydj/robotc-tap","last_synced_at":"2025-03-12T05:29:15.158Z","repository":{"id":21678022,"uuid":"24999203","full_name":"ArtskydJ/robotc-tap","owner":"ArtskydJ","description":"testing framework for robotc","archived":false,"fork":false,"pushed_at":"2018-09-28T14:25:50.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-18T15:53:34.481Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArtskydJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-09T16:53:59.000Z","updated_at":"2018-09-28T14:25:53.000Z","dependencies_parsed_at":"2022-07-23T15:47:11.332Z","dependency_job_id":null,"html_url":"https://github.com/ArtskydJ/robotc-tap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Frobotc-tap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Frobotc-tap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Frobotc-tap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Frobotc-tap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtskydJ","download_url":"https://codeload.github.com/ArtskydJ/robotc-tap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243165289,"owners_count":20246721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-12T07:48:48.552Z","updated_at":"2025-03-12T05:29:15.136Z","avatar_url":"https://github.com/ArtskydJ.png","language":"C","readme":"robotc-tap\r\n==========\r\n\r\n[Test Anything Protocol](http://testanything.org/tap-version-13-specification.html) for [RobotC](http://robotc.net). Basically a bunch of unit test helper functions, that outputs to the debug stream.\r\n\r\n# How To\r\n\r\n1. Click [Download Zip](https://github.com/ArtskydJ/robotc-tap/archive/master.zip).\r\n2. Copy the `tap.c` file to the directory that you want to test.\r\n3. Create a unit test file, maybe `test.c`, or `run_Tests.c`.\r\n4. In the file, write `#include \"tap.c\"`.\r\n5. Use the [Functions](#functions) provided.\r\n6. Compile and run your unit test file.\r\n\r\n\r\n# Example\r\n\r\n```c\r\n#include \"tap.c\"\r\n\r\ntask main() {\r\n\r\n\ttTest(\"the test suite works\");\r\n\t\ttOk(true);\r\n\t\ttNotOk(false, \"not ok ever!\");\r\n\t\ttEqual(17, 83-66, \"83-56=17\");\r\n\t\ttNotEqual(10, 100, \"ten ain't a hundred!\");\r\n\t\ttPass(\"oh yes\");\r\n\r\n\ttTest(\"this is the second test\");\r\n\t\ttFail(\"failing # TODO make this not fail\");\r\n\t\ttFail(\"skipping # SKIP make this skip\");\r\n\r\n\ttTest(\"the test suite works\");\r\n\t\ttEqual(17, 17, \"17=17\");\r\n\t\ttEqual(10, 10, \"ten ain't a hundred!\");\r\n\t\ttPass(\"such win\");\r\n\ttEnd(); //Only run this at the end\r\n}\r\n```\r\n\r\n# Functions\r\n\r\nFor a quick and dirty namespace solution, internal global variables and functions start with \"_\", and user functions start with \"t\" (for test).\r\n\r\n## `tTest(string msg)`\r\n\r\nThis starts a new set of tests, and resets some internal counters. This also ends the previous set of tests, if there was one.\r\n\r\nCode:\r\n```c\r\ntTest(\"my function is awesome\");\r\n```\r\nOutput:\r\n```\r\n# my function is awesome\r\n```\r\n\r\n## `tOk(bool test, string message)`\r\n\r\nThis checks if `test` is `true`.\r\n\r\nCode:\r\n```c\r\ntOk(bLcdBacklight, \"the backlight is on\");\r\n```\r\nOutput:\r\n```\r\nok 1 the backlight is on\r\n```\r\n\r\n## `tNotOk(bool test, string message)`\r\n\r\nThis checks if `test` is `false`.\r\n\r\nCode:\r\n```c\r\ntNotOk(bLcdBacklight, \"the backlight is off\");\r\n```\r\nOutput:\r\n```\r\nok 2 the backlight is off\r\n```\r\n\r\n## `tEqual(int test, int expected, string message)`\r\n\r\nThis checks if `test` equals `expected`.\r\n\r\nCode:\r\n```c\r\ntEqual(motor[MY_MOTOR], 127, \"MY_MOTOR is running full speed.\");\r\n```\r\nOutput:\r\n```\r\nok 3 MY_MOTOR is running full speed.\r\n```\r\n\r\n## `tNotEqual(int test, int unexpected, string message)`\r\n\r\nThis checks if `test` does not equal `unexpected`.\r\n\r\nCode:\r\n```c\r\ntNotEqual(motor[MY_MOTOR2], 0, \"MY_MOTOR is not still\");\r\n```\r\nOutput:\r\n```\r\nok 4 MY_MOTOR2 is not still\r\n```\r\n\r\n## `tPass(string message)`\r\n\r\nThis is a test that always passes.\r\n\r\nCode:\r\n```c\r\ntPass(\"yay this works\")\r\n```\r\nOutput:\r\n```\r\nok 5 yay this works\r\n```\r\n\r\n## `tFail(string message)`\r\n\r\nThis is a test that always fails.\r\n\r\nCode:\r\n```c\r\ntFail(\"that was predictable\")\r\n```\r\nOutput:\r\n```\r\nnot ok 6 that was predictable\r\n  ---\r\n  got: 0\r\n  expected: 1\r\n  ...\r\n```\r\n\r\n## `tEnd(string message)`\r\n\r\nThis ends the *last* set of tests. Use `tTest()` to end any set that isn't last.\r\n\r\n# License\r\n\r\n[MIT](https://choosealicense.com/licenses/mit/)\r\n\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartskydj%2Frobotc-tap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartskydj%2Frobotc-tap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartskydj%2Frobotc-tap/lists"}