{"id":22097465,"url":"https://github.com/b-jure/stest","last_synced_at":"2025-03-24T01:20:15.998Z","repository":{"id":179758524,"uuid":"647415961","full_name":"b-jure/stest","owner":"b-jure","description":"s(imple)test C library for easy unit testing.","archived":false,"fork":false,"pushed_at":"2023-06-14T11:49:18.000Z","size":165,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T07:42:45.074Z","etag":null,"topics":["c","c-testing","library","unit-testing"],"latest_commit_sha":null,"homepage":"","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/b-jure.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,"governance":null}},"created_at":"2023-05-30T18:28:21.000Z","updated_at":"2023-09-01T05:37:54.000Z","dependencies_parsed_at":"2023-09-19T21:07:28.032Z","dependency_job_id":null,"html_url":"https://github.com/b-jure/stest","commit_stats":null,"previous_names":["sigmabale/stest","b-jure/stest"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-jure%2Fstest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-jure%2Fstest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-jure%2Fstest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-jure%2Fstest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b-jure","download_url":"https://codeload.github.com/b-jure/stest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245191817,"owners_count":20575288,"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":["c","c-testing","library","unit-testing"],"created_at":"2024-12-01T04:15:36.636Z","updated_at":"2025-03-24T01:20:15.977Z","avatar_url":"https://github.com/b-jure.png","language":"C","readme":"# stest\n`stest` is small compact simple to understand and navigate\nC library for running unit tests.\nLibrary is C99 standard compliant and requires no dependencies.\n\n## Getting started\nClone the repository, and run `make` to build from source.\nIf you want to install the lib, use `make install`.\nDefault installation path:\n - `.so -\u003e /usr/local/lib`\n - `.h  -\u003e /usr/local/include`\n\nIf you wish to change directory for header file and/or .so,\nthen modify the `LIB_DIR_INSTALL` and `HEADER_DIR_INSTALL`\ndirectories in Makefile.\n\nMake sure the instalation path for the shared library (.so) is\nin the linker runtime path.\nNow for good measure do: `sudo ldconfig`\n\n## Example\n\n```c\n#include \u003cstest.h\u003e\n#include \u003cstring.h\u003e\n\n// expands to 'void int_test(void);'\nTEST(int_test);\nTEST(int_test_2);\nTEST(string_test);\nTEST(string_test_2);\nTEST(string_test_3);\n\nint\nmain(void)\n{\n    ssuite* suite_str = ssuite_new(\"string_tests\");\n    ssuite* suite_int = ssuite_new(\"int_tests\");\n\n    ssuite_add_test(suite_str, string_test);\n    ssuite_add_test(suite_str, string_test_2);\n    ssuite_add_test(suite_str, string_test_3);\n\n    ssuite_add_test(suite_int, int_test);\n    ssuite_add_test(suite_int, int_test_2);\n\n    srunner* runner = srunner_new();\n    srunner_add_suite(runner, suite_str);\n    srunner_add_suite(runner, suite_int);\n\n    srunner_run(runner);\n    srunner_free(runner);\n}\n\nTEST(int_test)\n{\n    int x = 5;\n    int y = 6;\n\n    ASSERT_EQ(sizeof(x), sizeof(y));\n\n    ASSERT(x == y);\n}\n\nTEST(int_test_2)\n{\n    int x = 5;\n    int y = 6;\n\n    ASSERT_NEQ(x, y);\n    ASSERT(6 == y);\n}\n\nTEST(string_test)\n{\n    const char* first  = \"We are equal\";\n    const char* second = \"We are equal\";\n\n    ASSERT_STR_EQ(first, second);\n}\n\nTEST(string_test_2)\n{\n    const char* first  = \"We are equal\";\n    const char* second = \"We are notequal\";\n\n    ASSERT_STR_NEQ(first, second);\n    ASSERT_STR_EQ(first, \"We are equal\");\n}\n\nTEST(string_test_3)\n{\n    const char* first  = \"We are equal\";\n    const char* second = \"We are notequal\";\n\n    ASSERT_STR_EQ(first, second);\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-jure%2Fstest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb-jure%2Fstest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-jure%2Fstest/lists"}