{"id":19045734,"url":"https://github.com/bigwhite/cbehave","last_synced_at":"2025-04-24T00:20:42.655Z","repository":{"id":7779023,"uuid":"9148661","full_name":"bigwhite/cbehave","owner":"bigwhite","description":"A Behavior Driven Development Framework for C","archived":false,"fork":false,"pushed_at":"2013-07-12T02:14:11.000Z","size":566,"stargazers_count":26,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-18T08:39:40.815Z","etag":null,"topics":["bdd","c","unit-testing"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigwhite.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-01T14:30:11.000Z","updated_at":"2022-12-02T03:51:42.000Z","dependencies_parsed_at":"2022-09-18T13:01:57.849Z","dependency_job_id":null,"html_url":"https://github.com/bigwhite/cbehave","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/bigwhite%2Fcbehave","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigwhite%2Fcbehave/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigwhite%2Fcbehave/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigwhite%2Fcbehave/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigwhite","download_url":"https://codeload.github.com/bigwhite/cbehave/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250536036,"owners_count":21446664,"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":["bdd","c","unit-testing"],"created_at":"2024-11-08T22:51:15.504Z","updated_at":"2025-04-24T00:20:42.617Z","avatar_url":"https://github.com/bigwhite.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"cbehave - A Behavior Driven Development Framework for C\n=======\n\nRecent News\n-----------\n - 2013-04-02 fork a copy to https://github.com/bigwhite/cbehave.git.\n - 2012-04-16 cbehave 0.2.0 released.\n - 2011-08-14 cbehave 0.1.0 version released.\n\nIntroduction\n-------------\nCBehave - A Behavior Driven Development Framework for C.\n\nMain Features\n-------------\n\n - use the \"feature + scenario\" structure which is (inspired by Cucumber)\n - use classical \"given-when-then\" template to describe the behavior scenario\n - support mock\n\nA Typical Example\n-------------\n\nAn example:\n\n    #include \u003cstdio.h\u003e\n    #include \u003cerrno.h\u003e\n    #include \"cbehave.h\"\n\n    FEATURE(1, \"strstr\")\n      SCENARIO(\"The strstr finds the first occurrence of the substring in the source string\")\n \n         GIVEN(\"A source string: [Lionel Messi is a great football player]\")\n             char *str = \"Lionel Messi is a great football player\";\n         GIVEN_END\n \n         WHEN(\"we use strstr to find the first occurrence of [football]\")\n             char *p = strstr(str, \"football\");\n         WHEN_END\n\n         THEN(\"We should get the string: [football player]\")\n             SHOULD_STR_EQUAL(p, \"football player\");\n         THEN_END\n     SCENARIO_END\n\n     SCENARIO(\"If strstr could not find the first occurrence of the substring, it will return NULL\")\n\n        GIVEN(\"A source string: FC Barcelona is a great football club.\")\n            char *str = \"FC Barcelona is a great football club\";\n        GIVEN_END\n\n        WHEN(\"we use strstr to find the first occurrence of [AC Milan]\")\n            char *p = strstr(buf, \"AC Milan\");\n        WHEN_END\n\n        THEN(\"We should get no string but a NULL\")\n            SHOULD_STR_EQUAL(p, NULL);\n        THEN_END\n     SCENARIO_END\n    FEATURE_END\n\n    int main() {\n        cbehave_feature strstr_features[] = {\n           {feature_idx(1)},\n        };\n\n        return cbehave_runner(\"Strstr Features are as belows:\", strstr_features);\n    }\n   \nThe result of the example could be seen like：\n\n   *******************************************************************\n       CBEHAVE -- A Behavior Driven Development Framework for C\n                By Tony Bai\n   *******************************************************************\n    Strstr Features are as belows:\n    Feature: strstr\n     Scenario: The strstr finds the first occurrence of the substring in the source string\n         Given: A source string: Lionel Messi is a great football player\n         When: we use strstr to find the first occurrence of [football]\n         Then: We should get the string: [football player]\n     Scenario: If strstr could not find the first occurrence of the substring, it will return NULL\n         Given: A source string: FC Barcelona is a great football club.\n         When: we use strstr to find the first occurrence of [AC Milan]\n         Then: We should get no string but a NULL\n     Summary:\n     total features: [1]\n     failed features: [0]\n     total scenarios: [2]\n     failed scenarios: [0]\n\nBuild\n------\n - Download the source code package\n - unzip the package\n - configure-\u003emake-\u003emake install\n \nif you want to compile in 64-bit mode, pass \"CPPFLAGS=-m64 LDFLAGS=-m64\" to configure.\n\nsometimes, you may encounter such error:\n\n     mv: cannot stat `.deps/cbehave.Tpo': No such file or directory\n     make[1]: *** [cbehave.lo] Error 1\n\t\na solution for this is execute \"libtoolize -f\" before \"configure\".\n\n\nUser Guide\n-------------\nFor more information, please open and read the project wiki. cbehave user guide is ready for you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigwhite%2Fcbehave","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigwhite%2Fcbehave","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigwhite%2Fcbehave/lists"}