Skip to content

Commit a00bc80

Browse files
committed
txs auto checkin
1 parent e56cf1e commit a00bc80

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

rust.tex

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,8 +1848,22 @@ \section{Writing Automated Tests}
18481848

18491849
\begin{frame}[fragile]
18501850
\frametitle{Controlling How Tests Are Run}
1851-
1852-
\end{frame}\
1851+
\begin{itemize}
1852+
\item \mintinline{shell}|cargo test| compiles your code in test mode and runs the resulting test binary. The default behavior of the binary produced by cargo test is to \textbf{run all the tests in parallel} and capture output generated during test runs,\textbf{ preventing the output from being displayed} and making it easier to read the output related to the test results. You can, however, specify command line options to change this default behavior.
1853+
\item If you don’t want to run the tests in parallel or if you want more fine-grained control over the number of threads used, you can send the \mintinline{shell}|--test-threads| flag and the number of threads you want to use to the test binary (ex: \mintinline{shell}|cargo test -- --test-threads=1| ).
1854+
\item If we call \mintinline{rust}|println!| in a test, we won’t see the \mintinline{rust}|println!| output in the terminal. If we want to see printed values for passing tests, we can tell Rust to also show the output of successful tests with \mintinline{shell}|cargo test -- --show-output|.
1855+
\end{itemize}
1856+
\end{frame}
1857+
1858+
\begin{frame}[fragile]
1859+
\frametitle{Controlling How Tests Are Run}
1860+
\begin{itemize}
1861+
\item Sometimes, running a full test suite can take a long time.
1862+
If we run the tests without passing any arguments, all the tests will run in parallel
1863+
We can pass the name of any test function to \mintinline{shell}|cargo test| to run only that test
1864+
\end{itemize}
1865+
\end{frame}
1866+
18531867

18541868
\section{An I/O Project: Building a Command Line Program}
18551869
\section{Functional Language Features: Iterators and Closures}

0 commit comments

Comments
 (0)