|
1 | 1 | use std::collections::{BTreeSet, HashMap, HashSet};
|
2 |
| -use std::iter; |
3 | 2 | use std::process::Command;
|
4 | 3 | use std::sync::OnceLock;
|
| 4 | +use std::{iter, u32}; |
5 | 5 |
|
6 | 6 | use build_helper::git::GitConfig;
|
7 | 7 | use camino::{Utf8Path, Utf8PathBuf};
|
@@ -604,6 +604,107 @@ pub struct Config {
|
604 | 604 | }
|
605 | 605 |
|
606 | 606 | impl Config {
|
| 607 | + /// Incomplete config intended for `src/tools/rustdoc-gui-test` **only** as |
| 608 | + /// `src/tools/rustdoc-gui-test` wants to reuse `compiletest`'s directive -> test property |
| 609 | + /// handling for `//@ {compile,run}-flags`, do not use for any other purpose. |
| 610 | + /// |
| 611 | + /// FIXME(#143827): this setup feels very hacky. It so happens that `tests/rustdoc-gui/` |
| 612 | + /// **only** uses `//@ {compile,run}-flags` for now and not any directives that actually rely on |
| 613 | + /// info that is assumed available in a fully populated [`Config`]. |
| 614 | + pub fn incomplete_for_rustdoc_gui_test() -> Config { |
| 615 | + // FIXME(#143827): spelling this out intentionally, because this is questionable. |
| 616 | + // |
| 617 | + // For instance, `//@ ignore-stage1` will not work at all. |
| 618 | + Config { |
| 619 | + mode: TestMode::Rustdoc, |
| 620 | + |
| 621 | + // Dummy values. |
| 622 | + edition: Default::default(), |
| 623 | + bless: Default::default(), |
| 624 | + fail_fast: Default::default(), |
| 625 | + compile_lib_path: Utf8PathBuf::default(), |
| 626 | + run_lib_path: Utf8PathBuf::default(), |
| 627 | + rustc_path: Utf8PathBuf::default(), |
| 628 | + cargo_path: Default::default(), |
| 629 | + stage0_rustc_path: Default::default(), |
| 630 | + rustdoc_path: Default::default(), |
| 631 | + coverage_dump_path: Default::default(), |
| 632 | + python: Default::default(), |
| 633 | + jsondocck_path: Default::default(), |
| 634 | + jsondoclint_path: Default::default(), |
| 635 | + llvm_filecheck: Default::default(), |
| 636 | + llvm_bin_dir: Default::default(), |
| 637 | + run_clang_based_tests_with: Default::default(), |
| 638 | + src_root: Utf8PathBuf::default(), |
| 639 | + src_test_suite_root: Utf8PathBuf::default(), |
| 640 | + build_root: Utf8PathBuf::default(), |
| 641 | + build_test_suite_root: Utf8PathBuf::default(), |
| 642 | + sysroot_base: Utf8PathBuf::default(), |
| 643 | + stage: Default::default(), |
| 644 | + stage_id: String::default(), |
| 645 | + suite: Default::default(), |
| 646 | + debugger: Default::default(), |
| 647 | + run_ignored: Default::default(), |
| 648 | + with_rustc_debug_assertions: Default::default(), |
| 649 | + with_std_debug_assertions: Default::default(), |
| 650 | + filters: Default::default(), |
| 651 | + skip: Default::default(), |
| 652 | + filter_exact: Default::default(), |
| 653 | + force_pass_mode: Default::default(), |
| 654 | + run: Default::default(), |
| 655 | + runner: Default::default(), |
| 656 | + host_rustcflags: Default::default(), |
| 657 | + target_rustcflags: Default::default(), |
| 658 | + rust_randomized_layout: Default::default(), |
| 659 | + optimize_tests: Default::default(), |
| 660 | + target: Default::default(), |
| 661 | + host: Default::default(), |
| 662 | + cdb: Default::default(), |
| 663 | + cdb_version: Default::default(), |
| 664 | + gdb: Default::default(), |
| 665 | + gdb_version: Default::default(), |
| 666 | + lldb_version: Default::default(), |
| 667 | + llvm_version: Default::default(), |
| 668 | + system_llvm: Default::default(), |
| 669 | + android_cross_path: Default::default(), |
| 670 | + adb_path: Default::default(), |
| 671 | + adb_test_dir: Default::default(), |
| 672 | + adb_device_status: Default::default(), |
| 673 | + lldb_python_dir: Default::default(), |
| 674 | + verbose: Default::default(), |
| 675 | + format: Default::default(), |
| 676 | + color: Default::default(), |
| 677 | + remote_test_client: Default::default(), |
| 678 | + compare_mode: Default::default(), |
| 679 | + rustfix_coverage: Default::default(), |
| 680 | + has_html_tidy: Default::default(), |
| 681 | + has_enzyme: Default::default(), |
| 682 | + channel: Default::default(), |
| 683 | + git_hash: Default::default(), |
| 684 | + cc: Default::default(), |
| 685 | + cxx: Default::default(), |
| 686 | + cflags: Default::default(), |
| 687 | + cxxflags: Default::default(), |
| 688 | + ar: Default::default(), |
| 689 | + target_linker: Default::default(), |
| 690 | + host_linker: Default::default(), |
| 691 | + llvm_components: Default::default(), |
| 692 | + nodejs: Default::default(), |
| 693 | + npm: Default::default(), |
| 694 | + force_rerun: Default::default(), |
| 695 | + only_modified: Default::default(), |
| 696 | + target_cfgs: Default::default(), |
| 697 | + builtin_cfg_names: Default::default(), |
| 698 | + supported_crate_types: Default::default(), |
| 699 | + nocapture: Default::default(), |
| 700 | + nightly_branch: Default::default(), |
| 701 | + git_merge_commit_email: Default::default(), |
| 702 | + profiler_runtime: Default::default(), |
| 703 | + diff_command: Default::default(), |
| 704 | + minicore_path: Default::default(), |
| 705 | + } |
| 706 | + } |
| 707 | + |
607 | 708 | /// FIXME: this run scheme is... confusing.
|
608 | 709 | pub fn run_enabled(&self) -> bool {
|
609 | 710 | self.run.unwrap_or_else(|| {
|
|
0 commit comments