From 90f98b52950e2dda441475d0e25e1cadfb4359d5 Mon Sep 17 00:00:00 2001
From: Virgile Prevosto <virgile.prevosto@m4x.org>
Date: Wed, 24 Mar 2021 10:12:39 +0100
Subject: [PATCH] [devman] document new EXIT directive

---
 doc/developer/advance.tex | 15 ++++++++++++++-
 doc/developer/changes.tex |  5 +++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/doc/developer/advance.tex b/doc/developer/advance.tex
index d4a5f040cac..b8f1f53dde2 100644
--- a/doc/developer/advance.tex
+++ b/doc/developer/advance.tex
@@ -963,10 +963,14 @@ the configuration header of a test (or a test suite).
 & Add and remove options from the default set
 & \textit{None}
 \\
+& \texttt{EXIT}\nscodeidxdef{Test!Directive}{EXIT}
+& Indicate expected exit status if not 0.
+& \textit{None}
+\\
 & \texttt{LOG}\nscodeidxdef{Test!Directive}{LOG}
 & Add an additional file to compare against an oracle
 & \textit{None}
-\\ 
+\\
 & \texttt{EXECNOW}\nscodeidxdef{Test!Directive}{EXECNOW}
 & Run a command before the following commands. When specified in a configuration
 file, run it only once.
@@ -1078,6 +1082,15 @@ the sequence above is read in order and defines a configuration level
   configuration).
   After an \texttt{OPT} or \texttt{STDOPT} directive is encountered,
   the set of additional \texttt{LOG} files is reset to its default.
+\item By default, \framac is expected to return successfully (i.e., with
+  an exit status of 0). If a test is supposed to lead to an error, an
+  \texttt{EXIT} directive must be used. It takes as argument an integer
+  (typically 1 to denote a user error) representing the expected exit status
+  for the subsequent tests. All tests triggered by \texttt{OPT} or
+  \texttt{STDOPT} directives encountered after the \texttt{EXIT} directive
+  will be expected to exit with the corresponding status, until a new
+  \texttt{EXIT} directive is encountered. (\texttt{EXIT: 0} will thus
+  indicate that subsequent tests are expected to exit normally).
 \item If there are several directives \texttt{OPT} in the same
   configuration level, they correspond to different test cases. The
   \texttt{OPT} directive(s) of a given configuration level replace(s)
diff --git a/doc/developer/changes.tex b/doc/developer/changes.tex
index 66ae55f2ea7..42a4dfd7940 100644
--- a/doc/developer/changes.tex
+++ b/doc/developer/changes.tex
@@ -5,6 +5,11 @@
 This chapter summarizes the major changes in this documentation between each
 \framac release, from newest to oldest.
 
+\section*{dev}
+\begin{itemize}
+\item \textbf{Testing}: Document new directive \texttt{EXIT}.
+\end{itemize}
+
 \section*{22.0 Titanium}
 \begin{itemize}
 \item \textbf{Testing}: Document new directives \texttt{TIMEOUT} and
-- 
GitLab