forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression test for rust-lang#122722
- Loading branch information
1 parent
5fab016
commit bc4f169
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
//! ``` | ||
//! let x = 12; | ||
//! ``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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(100_000).collect::<String>(); | ||
fs::write(path, content.as_bytes()).expect("failed to create args file"); | ||
} | ||
|
||
fn main() { | ||
let arg_file = out_dir().join("args"); | ||
generate_a_lot_of_cfgs(&arg_file); | ||
|
||
let arg_file = format!("@{}", arg_file.display()); | ||
rustdoc().arg("--test").arg(&arg_file).arg("foo.rs").run(); | ||
} |