From a6101b99da1b046cd7c1cf3bb6e019dc0e842c20 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 21 Sep 2019 14:58:08 +0200 Subject: [PATCH] Document ert test selectors in batch mode * doc/misc/ert.texi (Running Tests in Batch Mode): Document test selectors. --- doc/misc/ert.texi | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index d2d86555e3..e853faf323 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi @@ -337,10 +337,20 @@ Running Tests in Batch Mode In quiet mode ERT prints only unexpected results and summary. -If ERT is not part of your Emacs distribution, you may need to use +You can specify selectors to only run a subset of your tests +(@pxref{Test Selectors}). For example, the following would run all +tests where the name of the test matches the string ``to-match''. + +@example +emacs -batch -l ert -l my-tests.el \ + -eval '(ert-run-tests-batch-and-exit "to-match")' +@end example + +If you are using a version of Emacs older than 24.1, ERT is not part +of your Emacs distribution. In this case, you may need to use @code{-L /path/to/ert/} so that Emacs can find it. You may need -additional @code{-L} flags to ensure that @code{my-tests.el} and all the -files that it requires are on your @code{load-path}. +additional @code{-L} flags to ensure that @code{my-tests.el} and all +the files that it requires are on your @code{load-path}. @node Test Selectors -- 2.20.1