aboutsummaryrefslogtreecommitdiffstats
path: root/doc/usage.tex
diff options
context:
space:
mode:
authorshmibs <shmibs@gmail.com>2015-12-19 01:44:56 -0700
committershmibs <shmibs@gmail.com>2015-12-19 01:44:56 -0700
commit8aea0b1ca3f59106363207cb412fba8fafdeefee (patch)
treed9c01f7b7aaf7b52def62e9400b896eef6d762e8 /doc/usage.tex
parent502bcf5794d4b8533b0d76826fc11a95fb1ed023 (diff)
downloadsimple-test-8aea0b1ca3f59106363207cb412fba8fafdeefee.tar.gz
update usage pdf
Diffstat (limited to 'doc/usage.tex')
-rw-r--r--doc/usage.tex112
1 files changed, 17 insertions, 95 deletions
diff --git a/doc/usage.tex b/doc/usage.tex
index 6494ee5..f8cde5d 100644
--- a/doc/usage.tex
+++ b/doc/usage.tex
@@ -8,13 +8,7 @@
\usepackage[usenames,x11names,table]{xcolor}
\usepackage{listings}
-\usepackage{enumitem}
-\usepackage{graphicx}
\usepackage{framed}
-\usepackage{calc}
-\usepackage{ifthenx}
-\usepackage{tabularx}
-\usepackage{soul}
%%% -------------------------------------------------------
%%% universal formatting
@@ -50,18 +44,6 @@
}
}
-\newcommand{\myhl}[1]{
- {
- \color{Snow1}
- \sethlcolor{Red1}
- \hl{#1}
- }
-}
-
-\newcommand{\mymacrow}[2]{
- \footnotesize\textcolor{DarkOrchid3}{\textbf{#1}}: & \small #2 \\[8pt]
-}
-
\newcommand{\mytermrow}[2]{
\tt\bf\small #1 & \tt\small #2 \\
}
@@ -102,16 +84,15 @@
\hrule
\pagebreak
- If both tests above succeed, the output will look like this:\\
+ If the second test was ommited, the ouput would look like this:\\
\hrule
\vspace{8pt}
% successful output
+ {\tt\bf\small a\_simple\_example.c}\\
\begin{tabular*}{\textwidth}{r@{\ \tt\bf :: }l}
- \mytermrow{1}{\color{Yellow4}description of the first test}
- \mytermrow{2}{\color{Yellow4}this is the second test}
- \mytermrow{ }{\color{DodgerBlue2}grabbing heap string...}
+ \mytermrow{1}{\color{Yellow4}check add()'s return value}
\mytermrow{ }{\color{SpringGreen4}success!}
\end{tabular*}
@@ -119,89 +100,30 @@
\hrule
\vspace{20pt}
- If the first test fails, it will look something like this:\\
+ If the second test was included, it would look like this:\\
+
\hrule
\vspace{8pt}
% failed output
+ {\tt\bf\small a\_simple\_example.c}\\
\begin{tabular*}{\textwidth}{r@{\ \tt\bf :: }l}
- \mytermrow{1}{\color{Yellow4}description of the first test}
- \mytermrow{ }{\color{Red1}FAIL: error message shown on failing}
- \mytermrow{ }{\textcolor{SpringGreen4}{\textbf{\ \ expected:}}6}
- \mytermrow{ }{\textcolor{Red1}{\textbf{\ \ \ \ actual:}}0}
+ \mytermrow{1}{\color{Yellow4}check add()'s return value}
+ \mytermrow{2}{\color{Yellow4}compare two arrays of strings}
+ \mytermrow{ }{\color{DodgerBlue2}checking strs at i == 0...}
+ \mytermrow{ }{\color{DodgerBlue2}checking strs at i == 1...}
+ \mytermrow{ }{\color{DodgerBlue2}checking strs at i == 2...}
+ \mytermrow{ }{\textbf{a\_simple\_example.c:40: \textcolor{Red1}{fail:}} strings unequal}
+ \mytermrow{ }{\ \ \textbf{array1[i]} == `str3'}
+ \mytermrow{ }{\ \ \textbf{array2[i]} == `different'}
\end{tabular*}
\vspace{8pt}
\hrule
+ \vspace{20pt}
- \pagebreak
-
- \myheading{defined macros}
- \begin{tabularx}{\textwidth}{r@{\ }X}
- \mymacrow{BEGIN\_TEST}{
- must appear before all tests and
- after all global variable declarations
- }
- \mymacrow{END\_TEST}{
- must appear at the end of your test
- program
- }
- \mymacrow{CLEANUP(statements)}{
- this defines a list of statements to run
- when the test exits, either successfully or
- on a failure. it isn't necessary for a test
- to run, but, if it does appear, it must be
- after the declaration of all variables to
- which it makes reference.
- }
- \mymacrow{RETURN()}{
- place at the end of a test which uses
- CLEANUP to ensure it is called before the
- test exits. i couldn't find any way around
- this without using more than just one
- header file, so i hope it isn't too annoying.
- }
- \mymacrow{STATE(description)}{
- show a prettily-formatted description of the
- program's state during a test. takes printf-style
- arguments.
- }
- \mymacrow{EXPECT\_ZERO(summary, arg)}{
- fail if \texttt{arg} does not resolve to 0
- }
- \mymacrow{EXPECT\_ONE(summary, arg)}{
- fail if \texttt{arg} does not resolve to 1
- }
- \mymacrow{EXPECT\_GREATER\_THAN\_ZERO(summary, arg)}{
- fail if \texttt{arg} does not resolve to a value
- greater than 0. this will be replaced with more
- generic integer comparisons soon.
- }
- \mymacrow{EXPECT\_INT(summary, arg1, arg2)}{
- fail if \texttt{arg2} does not match the
- expected integer value \texttt{arg1}
- }
- \mymacrow{EXPECT\_EQUAL\_INT(summary, arg1, arg2)}{
- fail if \texttt{arg1} and \texttt{arg2} are
- not equal
- }
- \mymacrow{EXPECT\_UNEQUAL\_INT(summary, arg1, arg2)}{
- fail if \texttt{arg1} and \texttt{arg2} are
- equal
- }
- \mymacrow{EXPECT\_STR(summary, arg1, arg2)}{
- fail if string \texttt{arg2} does not match the
- expected string value \texttt{arg1}
- }
- \mymacrow{EXPECT\_EQUAL\_STR(summary, arg1, arg2)}{
- fail if \texttt{arg1} and \texttt{arg2} are
- not equivalent strings
- }
- \mymacrow{EXPECT\_UNEQUAL\_STR(summary, arg1, arg2)}{
- fail if \texttt{arg1} and \texttt{arg2} are
- equivalent strings
- }
- \end{tabularx}
+ For detailed descriptions of all available tests, see the included man page
+ or README.md .
\end{document}