{"id":21058025,"url":"https://github.com/rust-gcc/testing","last_synced_at":"2025-05-15T23:34:03.770Z","repository":{"id":37863086,"uuid":"468806553","full_name":"Rust-GCC/testing","owner":"Rust-GCC","description":"Testing gccrs in the wild","archived":false,"fork":false,"pushed_at":"2023-12-26T22:56:56.000Z","size":300,"stargazers_count":5,"open_issues_count":9,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-03T17:39:00.233Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rust-GCC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-03-11T15:39:00.000Z","updated_at":"2024-08-19T19:51:29.000Z","dependencies_parsed_at":"2023-12-26T23:44:30.299Z","dependency_job_id":null,"html_url":"https://github.com/Rust-GCC/testing","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/Rust-GCC%2Ftesting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rust-GCC%2Ftesting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rust-GCC%2Ftesting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rust-GCC%2Ftesting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rust-GCC","download_url":"https://codeload.github.com/Rust-GCC/testing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442429,"owners_count":22071864,"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":["hacktoberfest"],"created_at":"2024-11-19T17:06:06.664Z","updated_at":"2025-05-15T23:34:03.724Z","avatar_url":"https://github.com/Rust-GCC.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# testing\n\nTesting gccrs in the wild\n\n## Requirements\n\n### [ftf](https://github.com/CohenArthur/ftf) \u003e= 0.4\n\n`cargo install ftf`\n\n### submodules\n\nEither clone the repository using the `--recursive` flag, or initialize the submodules afterwards\nusing the following command:\n\n`git submodule update --init`\n\n## Generate the parsing test-suite\n\nThe test-suite adaptor is a simple program in charge of generating a sensible test-suite for gccrs from rustc's test-suite, as well as making sure our testsuite is valid rust code. For now, there are two \"passes\" available: \n\n1. A parsing test-suite, where the application launches `rustc` with the `-Z parse-only` flag and keeps track of the exit code, in order to make sure that gccrs with the `-fsyntax-only` flag has the same behavior.\n\n2. A validation test-suite, where we make sure that rustc can compile gccrs' dejagnu test-suite. This helps in ensuring that our tests are proper rust code.\n\nRunning the adaptor is time consuming: It takes roughly 5 minutes to generate the parsing test-suite on a powerful machine.\n\nIt also absolutely hammers your computer by launching `$(nproc)` instances of rustc to create the test-suite baseline.\n\nYou can run the application either in debug or release mode: As it is extremely IO-intensive, it does not benefit a lot from the extra optimizations (for now!).\n\nYou can generate a testsuite using the following arguments:\n\n### --gccrs,-g\n\nThe gccrs executable you want to test. The command will be launched similarly to how an executable is launched from the shell, so you can either specify a relative path to an executable, an absolute path, or simply the name of an executable present in your path.\n\nOne way to do this is to copy a freshly built `rust1` from your `gccrs` local copy, and pass `--gccrs './rust1'` as an argument. If you've copied your whole build directory, the argument would look something like `--gccrs './build/gcc/rust1`.\n\nIf you have `gccrs` installed on your system, you can also simply pass `--gccrs gccrs`. Be careful in that running the testsuite with a full compiler driver will obviously be much longer.\n\n### --rustc,-r\n\n`rustc` executable to use and test. Similar rules apply.\n\n### --rust-path\n\nPath to the cloned rustc repository to extract test cases from.\n\n### --gccrs-path\n\nPath to the cloned gccrs repository to extract test cases from.\n\n### --output-dir,-o\n\nDirectory to create and in which to store the adapted test cases. The directory will be created by the application.\n\n### --yaml,-y\n\nPath of the `ftf` test-suite file to create.\n\n### --pass,-p\n\nPass to run and generate a test suite from. The currently available passes are\n\n|Pass|Description|\n|---|---|\n|gccrs-parsing|Tests `gccrs`'s parser. This allows testing `gccrs` against `rustc` in parsing-mode (`-Z parse-only` and `-fsyntax-only`)|\n|rustc-dejagnu|Launch `rustc` against our dejagnu testsuite. This allows validating `gccrs`'s testsuite, making sure that tests are proper rust code|\n|gccrs-rustc-success|Launch `gccrs` against all successful testcases in the `rustc` testsuite|\n|gccrs-rustc-success-no-std|Launch `gccrs` against all successful testcases in the `rustc` testsuite in `#[no_std]` mode|\n|gccrs-rustc-success-no-core|Launch `gccrs` against all successful testcases in the `rustc` testsuite in `#[no_core]` mode|\n|blake3|Launch `gccrs` on the Blake3 cryptography project|\n|libcore|Launch `gccrs` on various version of the core library|\n|ast-export| Make sure `gccrs` exports valid Rust code|\n\n## Running the test-suite\n\nIf everything went smoothly, you should simply be able to run `ftf` on the generated YAML file:\n\n`ftf -f \u003cgenerated_yaml\u003e`\n\n## Typical first invocation\n\n```sh\n\u003e cargo run -- \\\n\t--gccrs 'path/to/crab1' --rustc rustc \\\n\t--gccrs-path path/to/gccrs/ --rust-path path/to/rust/ \\\n\t--output-dir sources/ --yaml testsuite.yml \\\n\t--pass gccrs-parsing\n\u003e ftf -f testsuite.yml -j$(nproc)\n```\n\nRunning `ftf` on a single thread (default behavior if you do not pass a `-j/--jobs` argument) is not recommended as running through the whole parsing test-suite will easily take tens of minutes.\n\n## Re-running the test-suite with an updated compiler\n\nIf you have already generated a test-suite and would simply like to run an updated version of `gccrs`, you can reuse the same YAML file.\n\n```sh\n\u003e cp \u003cyour-gccrs-build-dir\u003e/gcc/rust1 ./rust1\n\u003e ftf -f testsuite.yml -j$(nproc)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-gcc%2Ftesting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-gcc%2Ftesting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-gcc%2Ftesting/lists"}