{"id":49583953,"url":"https://github.com/ishbguy/leptunit","last_synced_at":"2026-05-03T21:37:28.638Z","repository":{"id":191655698,"uuid":"110319217","full_name":"ishbguy/leptunit","owner":"ishbguy","description":"A light weight C unit test library.","archived":false,"fork":false,"pushed_at":"2018-02-03T15:46:42.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-03T21:37:17.448Z","etag":null,"topics":["light-weight","unit-testing"],"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/ishbguy.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":"2017-11-11T04:56:53.000Z","updated_at":"2018-03-06T14:21:36.000Z","dependencies_parsed_at":"2023-08-31T00:38:11.294Z","dependency_job_id":null,"html_url":"https://github.com/ishbguy/leptunit","commit_stats":null,"previous_names":["ishbguy/leptunit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ishbguy/leptunit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ishbguy%2Fleptunit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ishbguy%2Fleptunit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ishbguy%2Fleptunit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ishbguy%2Fleptunit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ishbguy","download_url":"https://codeload.github.com/ishbguy/leptunit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ishbguy%2Fleptunit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32586187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: 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":["light-weight","unit-testing"],"created_at":"2026-05-03T21:37:27.732Z","updated_at":"2026-05-03T21:37:28.623Z","avatar_url":"https://github.com/ishbguy.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LeptUnit\n\n[![Build Status](https://travis-ci.org/ishbguy/leptunit.svg?branch=master)](https://travis-ci.org/ishbguy/leptunit) [![codecov](https://codecov.io/gh/ishbguy/leptunit/branch/master/graph/badge.svg)](https://codecov.io/gh/ishbguy/leptunit)\n\nLeptUnit is a light weight C unit test library which is inspired by [miloyip](https://github.com/miloyip)'s [json-tutorial](https://github.com/miloyip/json-tutorial).\n\n## Features\n\n+ Basic type test, such as: int, double, str, ptr\n+ Simple usage\n+ No dependency\n+ ANSI C\n\n## Installation\n\n### Without build tool, only make\nIn Linux with gcc, make:\n\n```\n$ cd /path/to/leptunit\n$ make\n```\nThis make will generate `libleptunit.so` and `test-leptunit`, `libleptunit.so` is the dynamic shared library, `test-leptunit` is a simple test for leptunit. If you just want to generate one of it you can do like this:\n```\n$ cd /path/to/leptunit\n$ make lib\n```\nor\n```\n$ cd /path/to/leptunit\n$ make test\n```\n\n### With cmake build tool\n\n```\n$ mkdir build\n$ cd build\n$ cmake ..\n```\n**Don't run `cmake` in the repo root directory for it will generate a new Makefile to over-write the repo's default Makefile!**\n\n## Configuration\n\nAfter generate the dynamic shared library, you can copy it to the standard library directory in Linux, or:\n```\n$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/could/ld/find\n```\n\n## Usage\n\nWrite test.c:\n\n```C\n#include \"/path/to/leptunit.h\"\n\nLEPTUNIT_TEST_CASE(test_case)\n{\n    /*\n     * Test bool\n     */\n    EXPECT_TRUE(1);\n    EXPECT_FLASE(0);\n\n    /*\n     * Test equal\n     */\n    EXPECT_EQ_INT(1, 1);\n    EXPECT_EQ_DOUBLE(1.0, 1.0);\n    EXPECT_EQ_DOUBLE_PREC(1.0, 1.0, 0.000001);\n    EXPECT_EQ_STR(\"leptunit\", \"leptunit\");\n    EXPECT_EQ_NSTR(\"leptunit\", \"leptunit\", strlen(\"leptunit\"));\n    EXPECT_EQ_PTR(\"leptunit\", \"leptunit\");\n    EXPECT_EQ_NULL(NULL);\n\n    /*\n     * Test not equal\n     */\n    EXPECT_NE_INT(1, 2);\n    EXPECT_NE_DOUBLE(1.0, 2.0);\n    EXPECT_NE_DOUBLE_PREC(1.0, 2.0, 0.000001);\n    EXPECT_NE_STR(\"leptunit\", \"leptunit.h\");\n    EXPECT_NE_NSTR(\"leptunit\", \"hello world\", strlen(\"leptunit\"));\n    EXPECT_NE_PTR(\"leptunit\", \"hello world\");\n    EXPECT_NE_NULL(\"leptunit\");\n}\n\nint main(int argc, char *argv[])\n{\n    leptunit_suit_t *suit = leptunit_new() ;\n    leptunit_add(suit, test_case);\n    leptunit_run(suit);\n    leptunit_summary(suit);\n    leptunit_free(\u0026suit);\n    return 0;\n}\n```\n\nThen compile it like this:\n```\n$ gcc -lm -lleptunit -L/path/to/leptunit/dynamic/lib -o test test.c\n$ ./test\n```\n\nIf you use `EXPECT_EQ_DOUBLE`, `EXPECT_NE_DOUBLE`, `EXPECT_EQ_DOUBLE_PREC` and `EXPECT_NE_DOUBLE_PREC`, you must compile you test with -lm option.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Authors\n\n+ [ishbguy](https://github.com/ishbguy)\n\n## License\n\nFor public used.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fishbguy%2Fleptunit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fishbguy%2Fleptunit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fishbguy%2Fleptunit/lists"}