summary refs log tree commit diff
path: root/tests/run-make/rustdoc-test-args/rmake.rs
blob: c8edfb6370e5015799bb85a33ea734b98f278caa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate run_make_support;

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

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 = tmp_dir().join("args");
    generate_a_lot_of_cfgs(&arg_file);

    rustdoc().out_dir(tmp_dir()).input("foo.rs").arg_file(&arg_file).arg("--test").run();
}