Skip to content

Commit

Permalink
add a test to verify that compile-flags are provided last
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Oct 25, 2022
1 parent 6457df3 commit 9546490
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/test/ui/compiletest-compile-flags-last.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Check that the arguments provided through `// compile-flags` are added last to the command line
// in UI tests. To ensure that we invoke rustc with a flag that expects an argument withut actually
// providing it. If the compile-flags are not last, the test will fail as rustc will interpret the
// next flag as the argument of this flag.
//
// compile-flags: --cap-lints
2 changes: 2 additions & 0 deletions src/test/ui/compiletest-compile-flags-last.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
error: Argument to option 'cap-lints' missing

2 changes: 1 addition & 1 deletion src/tools/tidy/src/ui_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::path::Path;

const ENTRY_LIMIT: usize = 1000;
// FIXME: The following limits should be reduced eventually.
const ROOT_ENTRY_LIMIT: usize = 948;
const ROOT_ENTRY_LIMIT: usize = 949;
const ISSUES_ENTRY_LIMIT: usize = 2117;

fn check_entries(path: &Path, bad: &mut bool) {
Expand Down

0 comments on commit 9546490

Please sign in to comment.