@@ -471,3 +471,53 @@ Some methodology notes about what rustdoc counts in this metric:
471
471
472
472
Public items that are not documented can be seen with the built-in ` missing_docs ` lint. Private
473
473
items that are not documented can be seen with Clippy's ` missing_docs_in_private_items ` lint.
474
+
475
+ ### ` --enable-per-target-ignores ` : allow ` ignore-foo ` style filters for doctests
476
+
477
+ Using this flag looks like this:
478
+
479
+ ``` bash
480
+ $ rustdoc src/lib.rs -Z unstable-options --enable-per-target-ignores
481
+ ```
482
+
483
+ This flag allows you to tag doctests with compiltest style ` ignore-foo ` filters that prevent
484
+ rustdoc from running that test if the target triple string contains foo. For example:
485
+
486
+ ``` rust
487
+ /// ```ignore-foo,ignore-bar
488
+ /// assert!(2 == 2);
489
+ /// ```
490
+ struct Foo ;
491
+ ```
492
+
493
+ This will not be run when the build target is ` super-awesome-foo ` or ` less-bar-awesome ` .
494
+ If the flag is not enabled, then rustdoc will consume the filter, but do nothing with it, and
495
+ the above example will be run for all targets.
496
+ If you want to preserve backwards compatibility for older versions of rustdoc, you can use
497
+
498
+ ``` rust
499
+ /// ```ignore,ignore-foo
500
+ /// assert!(2 == 2);
501
+ /// ```
502
+ struct Foo ;
503
+ ```
504
+
505
+ In older versions, this will be ignored on all targets, but on newer versions ` ignore-gnu ` will
506
+ override ` ignore ` .
507
+
508
+ ### ` --runtool ` , ` --runtool-arg ` : program to run tests with; args to pass to it
509
+
510
+ Using thses options looks like this:
511
+
512
+ ``` bash
513
+ $ rustdoc src/lib.rs -Z unstable-options --runtool runner --runtool-arg --do-thing --runtool-arg --do-other-thing
514
+ ```
515
+
516
+ These options can be used to run the doctest under a program, and also pass arguments to
517
+ that program. For example, if you want to run your doctests under valgrind you might run
518
+
519
+ ``` bash
520
+ $ rustdoc src/lib.rs -Z unstable-options --runtool valgrind
521
+ ```
522
+
523
+ Another use case would be to run a test inside an emulator, or through a Virtual Machine.
0 commit comments