Skip to content

Commit

Permalink
Add regression test for rust-lang#122722
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 23, 2024
1 parent 5467af2 commit 08af772
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/run-make/rustdoc-test-args/foo.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//! ```
//! let x = 12;
//! ```
21 changes: 21 additions & 0 deletions tests/run-make/rustdoc-test-args/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
extern crate run_make_support;

use run_make_support::{out_dir, rustdoc};
use std::{fs, iter};
use std::path::Path;

fn generate_a_lot_of_cfgs(path: &Path) {
let content = iter::repeat("--cfg=a\n").take(75_000).collect::<String>();
fs::write(path, content.as_bytes()).expect("failed to create args file");
}

fn main() -> Result<(), ()> {
let arg_file = out_dir().join("args");
generate_a_lot_of_cfgs(&arg_file);

let arg_file = format!("@{}", arg_file.display());
if !rustdoc().arg("--test").arg(&arg_file).arg("foo.rs").run().status.success() {
return Err(());
}
Ok(())
}

0 comments on commit 08af772

Please sign in to comment.