{"id":28444084,"url":"https://github.com/assemblyscript/libc-test","last_synced_at":"2025-08-24T10:14:29.886Z","repository":{"id":66051013,"uuid":"126750207","full_name":"AssemblyScript/libc-test","owner":"AssemblyScript","description":"Mirror of git://nsz.repo.hu:45100/repo/libc-test","archived":false,"fork":false,"pushed_at":"2021-06-01T15:42:19.000Z","size":2659,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-24T22:39:55.727Z","etag":null,"topics":["libc","musl"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":false,"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/AssemblyScript.png","metadata":{"files":{"readme":"README","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":"2018-03-25T23:46:24.000Z","updated_at":"2024-11-04T09:25:55.000Z","dependencies_parsed_at":"2023-03-13T20:31:02.277Z","dependency_job_id":null,"html_url":"https://github.com/AssemblyScript/libc-test","commit_stats":{"total_commits":398,"total_committers":12,"mean_commits":"33.166666666666664","dds":0.03768844221105527,"last_synced_commit":"a0c28c7673121dcb9305d1ea21aa5a42a5d9929d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AssemblyScript/libc-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyScript%2Flibc-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyScript%2Flibc-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyScript%2Flibc-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyScript%2Flibc-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AssemblyScript","download_url":"https://codeload.github.com/AssemblyScript/libc-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyScript%2Flibc-test/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262608458,"owners_count":23336500,"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":["libc","musl"],"created_at":"2025-06-06T08:40:40.817Z","updated_at":"2025-06-29T14:30:48.253Z","avatar_url":"https://github.com/AssemblyScript.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"libc-test is developed as part of the musl project\nhttp://www.musl-libc.org/\n\nconfiguring:\n\tcp config.mak.def config.mak\n\tedit config.mak\nbuild and run tests:\n\tmake\nclean up:\n\tmake clean\n\nmake builds all test binaries and runs them to create\na REPORT file that contains all build and runtime errors\n(this means that make does not stop at build failures)\n\ncontributing tests:\n\ndesign goals:\n\n- tests should be easy to run and build even a single test in isolation\n(so test should be self contained if possible)\n- failure of one test should not interfere with others\n(build failure, crash or unexpected results are all failures)\n- test output should point to the cause of the failure\n- test results should be robust\n- the test system should have minimal dependency\n(libc, posix sh, gnu make)\n- the test system should run on all archs and libcs\n- tests should leave the system in a clean state\n\nconventions:\n\neach test is in a separate file at a path like src/directory/file.c with\nits own main\n\nthe test should return 0 on success and non-0 on failure, on failure it\nshould print error messages to standard out if possible, on success no\nmessage should be printed\n\nto help with the above test protocol use t_error function for printing\nerrors and return t_status from main, see src/common/test.h\n(t_error allows standard printf formatting, outputs at most 512bytes\nin a single write call to fd 1, so there is no buffering, long outputs\nare truncated, it sets the global t_status to 1)\n\nit is common to do many similar checks in a test, in such cases macros\nmay be used to simplify the code like\n#define T1(a,b) (check(a,b) || (t_error(\"check(%s,%s) failed\\n\", a, b),0))\n#define T2(f,w) (result=(f), result==(w) || (t_error(\"%s failed: got %s, want %s\\n\", #f, result, w),0))\n\nbinaries should be possible to run from arbitrary directory.\nthe build system runs the tests using the src/common/runtest tool which\nkills the test process after a timeout and reports the exit status\nin case of failure\n\ndirectories:\n\nsrc/api: interface tests, build time include header tests\nsrc/common: common utilities compiled into libtest.a\nsrc/functional: functional tests aiming for large coverage of libc\nsrc/math: tests for each math function with input-output test vectors\nsrc/regression: regression tests aiming for testing particular bugs\n\ninitial set of functional tests are derived from the libc-testsuit of\nRich Felker, regression tests should contain reference of the bug\n(musl commit hash, glibc bug tracker url, etc)\n\nbuild system:\n\nthe main non-file make targets are all, run, clean and cleanall.\n(cleanall removes the reports unlike clean, run reruns the dynamically\nlinked executables)\n\nmake variable can be overridden from config.mak or the make command line,\nthe variable B sets the build directory which is src by default\n\nfor each directory under src there are targets like $(B)/directory/all,\n$(B)/directory/run and $(B)/directory/clean to make only the contents\nof that directory, each directory has its own Makefile set up so it\ninvokes the top level make with B=src src/directory/foo for the foo\ntarget, so it is possible to work only under a specific test directory\n\nthe build and runtime errors of each target are accumulated into a\ntarget.err file and in the end they are concatenated into a REPORT\n\neach .c file in src/functional and src/regression are built into a\ndynamic linked and a static linked executable test binary by default,\nthis behaviour can be changed by a similarly named .mk file changing\nmake variables and specifying additional rules:\n\n$(B)/$(N) is the name of the binary target (the file name without the .c)\n$(B)/$(N)-static is the name of the static binary target\n$(B)/$(D) is the build directory\n$(N).CFLAGS are added to the CFLAGS at compilation\n$(N).LDFLAGS are added to the LDFLAGS at linking\n$(N).LDLIBS are added to the LDLIBS at linking\n$(N).BINS are the targets (if empty no binaries are built)\n$(N).LIBS are the non-executable targets (shared objects may use it)\n\nif a binary is linked together from several .o files then they\nhave to be specified as prerequisits for the binary targets and\nadded to the $(N).LDLIBS as well\n\nif a binary depends on a file at runtime (eg. a .so opened by dlopen)\nthen the $(N).err target should depend on that file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemblyscript%2Flibc-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassemblyscript%2Flibc-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemblyscript%2Flibc-test/lists"}