{"id":16190051,"url":"https://github.com/brson/ctrs","last_synced_at":"2025-04-07T14:19:10.071Z","repository":{"id":18578254,"uuid":"21781320","full_name":"brson/ctrs","owner":"brson","description":"A Rust language conformance test suite","archived":false,"fork":false,"pushed_at":"2015-11-04T02:23:19.000Z","size":2212,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-13T16:48:12.622Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/brson.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-07-13T02:32:21.000Z","updated_at":"2023-08-23T05:50:06.000Z","dependencies_parsed_at":"2022-07-28T23:18:52.610Z","dependency_job_id":null,"html_url":"https://github.com/brson/ctrs","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/brson%2Fctrs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fctrs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fctrs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fctrs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brson","download_url":"https://codeload.github.com/brson/ctrs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247666016,"owners_count":20975788,"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-10T07:38:23.617Z","updated_at":"2025-04-07T14:19:10.029Z","avatar_url":"https://github.com/brson.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/brson/ctrs.svg?branch=master)](https://travis-ci.org/brson/ctrs)\n\n# Conformance Tests for Rust (CTRS)\n\nThis is an implementation-independent test suite for The Rust\nProgramming Language. It is intended as a regression test for\nthe reference implementation, as well as a tool for testing\nconformance of alternate implementations.\n\nIt differs from the RI test suite in several ways:\n\n* It only covers stable features.\n* It has a simple implementation-independent test runner.\n* It draws test cases from a wide range of sources.\n* It categorizes test cases by language revision, so that multiple\n  levels of conformance may be established.\n\nCTRS is not a curated test of the specification - this probably isn't\ncode you want to read for fun. Rather, it is simply a massive corpus\nof valid Rust code that is known to work against the reference\ncompiler. The test suite will evolve over time as bugs are shaken\nout of the RI.\n\nExecute with `./run.py` to test your Rust compiler.\nSet the `RUSTC` environment variable if you must.\n\n## Criteria for inclusion\n\nCriteria will expand over time.\nCurrently:\n\n* Must pass 'rustc -F deprecated -F unstable_features'\n* Must pass 'rustc -F deprecated -F unstable_features --test'\n* No 'extern crate' (i.e. only std)\n* Single-file test cases only\n\nRun `./stab.py` on a Rust file to see if it is a candidate.\n\n## Organization\n\nAll tests are under the `test` directory. Immediately under `test` are\ndirectories for Rust language/compiler versions. Under each version\nare directories for test 'groups'. Test groups are drawn from many\nsources, and are licensed individually.\n\nNote that even tests categorized under a later language revision may\nwork under previous revisions. When tests are added for a new language\nversion they are not first checked against previous versions.\n\n## Current coverage\n\nCurrent focus is pulling tests out of the reference implementation that\nmeet the criteria, as well as sourcing single-file examples from\nother places.\n\n- 1.4.0\n  - doc - Extracts from the RI 'doc' directory\n  - doc-collections - Extracts from the RI collections API docs\n  - doc-core - Extracts from the RI core library API docs\n  - doc-std - Extracts from the RI std library API docs\n  - run-pass - Tests from the RI test suite's 'run-pass' directory\n- 1.3.0\n  - doc - Extracts from the RI 'doc' directory\n  - doc-collections - Extracts from the RI collections API docs\n  - doc-core - Extracts from the RI core library API docs\n  - doc-std - Extracts from the RI std library API docs\n  - too-many-lists - Extracts from *[Learn Rust by writing Entirely Too Many Linked Lists][lists]*\n  - run-pass - Tests from the RI test suite's 'run-pass' directory\n  - rust-by-example - Extracts from [www.rustbyexample.com]\n- 1.2.0\n  - doc - Extracts from the RI 'doc' directory\n  - doc-collections - Extracts from the RI collections API docs\n  - doc-core - Extracts from the RI core library API docs\n  - doc-std - Extracts from the RI std library API docs\n  - pretty - Tests from the RI test suite's 'pretty' directory\n  - run-pass - Tests from the RI test suite's 'run-pass' directory\n  - rust-by-example - Extracts from [www.rustbyexample.com]\n- 1.1.0\n  - doc - Extracts from the RI 'doc' directory\n  - doc-collections - Extracts from the RI collections API docs\n  - doc-core - Extracts from the RI core library API docs\n  - doc-std - Extracts from the RI std library API docs\n  - pretty - Tests from the RI test suite's 'pretty' directory\n  - run-pass - Tests from the RI test suite's 'run-pass' directory\n  - rust-by-example - Extracts from [www.rustbyexample.com]\n\n[lists]: https://github.com/Gankro/too-many-lists\n[www.rustbyexample.com]: http://www.rust-by-example.com\n\n## Compiler interface requirements\n\nRunning the test suite requires a Rust compiler that generally behaves\nlike the reference compiler. Currently the test suite expects the\ncompiler to support the `-o` flag. In the future it will expect more\nflags to work.\n\n## Licensing\n\nFor test cases, any OSI-approved license accepted. Non-free licenses\nalso welcome, but in another repo.\n\nThe way this is tracked currently is in a LICENSE file in each\ndirectory of code that didn't originate from The Rust Project itself,\nalong with an ORIGIN file indicating where it came from.\n\nOther code in CTRS is MIT/Apache-2.0.\n\n## Scripts\n\nThis test suite is a bunch of python scripts for wrangling Rust code\nfrom various places and into a form that is runnable.\n\n* `dupes.py` - Lists files in the repo with identical hashes.\n* `delete_dupes.py` - Deletes duplicates from git.\n* `run.py` - The test suite runner. Just needs a `rustc` command\n  available or the `RUSTC` environment variable to be set.\n* `slurp.py` - Copies all Rust files that pass `stab.py` from one dir to another.\n* `slurp_docs.py` - Extracts stable docs from one dir to another.\n* `undoc_dir.py` - Recursively extracts doc tests from all .rs/.md files to a dir.\n* `stab.py` - Checks whether a crate meets the criteria for inclusion.\n* `undoc.py` - Extracts doc tests from a single file.\n\n## Future directions\n\n* Improve accuracy of staby.py\n* Add support for reference compile-fail tests\n* Support aux-build tests\n* Support should-panic doc tests\n* Support run-fail tests\n* Add support for Makefile tests?\n* FFI tests, like rust_test_helpers\n* Sources\n  * compile-fail, run-fail, run-make tests\n  * In-tree std crate docs\n  * Popular blog posts\n  * rustforrubyists.com\n  * euler-rust https://github.com/gifnksm/ProjectEulerRust\n  * http://www.programming-idioms.org/about#about-block-language-coverage\n  * https://github.com/geraldstanje/rust_snippets\n  * guidelines\n  * http://blog.burntsushi.net/rust-error-handling/\n  * Dependency-free libs e.g. math, quickcheck\n  * coretest\n  * automatic extraction of #[test] cases\n  * tool to extract build plans from cargo graphs\n  * https://www.ralfj.de/projects/rust-101/main.html\n  * error index examples!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrson%2Fctrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrson%2Fctrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrson%2Fctrs/lists"}