-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add stresstesting scripts #31
Conversation
We have to add the latex to include the changes in the pdf. Do we want to keep the examples in the repository? Having them in the pdf doesn't make sense. @dp1 is it okay for you to keep these files in the |
I like this PR, it seems quite involved to get stresstesting for all the booklet code, but it's good to have specific algorithms (e.g. geometry, maths) stresstested on a case by case basis. |
@DannyAntonelli I'm not sure what you mean with changes to the PDF, intuitively stresstesting shouldn't influence the final booklet. Am I missing something? I'd also like to keep unit tests and stress tests as logically separate things, so maybe we could move this out into a |
One more thing, the examples are ok to have, but maybe we should have "real" stresstests as examples like we're starting to do in #30 |
@alls-cpp's idea is to put it in the booklet so that during the competition you can test the solution and see where it fails. That's how he usually uses these scripts, isn't it? |
Oh I see, I got the intent of this pr wrong. Yeah if this is to be used during the contest, we need to add some latex in |
\item compare the outputs of two solutions of a problem, checking if they give the same outputs | ||
\end{itemize} | ||
|
||
\lstinputlisting{source/stresstest/compare.sh} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would \snippet not work here?
|
||
\subsection{Stress test} | ||
\subsubsection{Compare two solutions} | ||
\texttt{compare.sh wrong slow generator numTests} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\texttt{compare.sh wrong slow generator numTests} | |
\texttt{./compare.sh wrong slow generator numTests} |
\lstinputlisting{source/stresstest/compare.sh} | ||
|
||
\subsubsection{Validate a solution} | ||
\texttt{validate.sh solution validator generator numTests} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\texttt{validate.sh solution validator generator numTests} | |
\texttt{./validate.sh solution validator generator numTests} |
@@ -7,3 +7,30 @@ \subsection{Compiling with sanitize options} | |||
\begin{lstlisting}[breakatwhitespace=true] | |||
g++ -std=gnu++17 -g -fsanitize=address -fsanitize=undefined -fno-sanitize-recover file.cpp -o file | |||
\end{lstlisting} | |||
|
|||
\subsection{Stress test} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move this section to the end of the booklet, since it's not something we're going to use in all contests or at the start of one. We could add a misc
section containing this code and potentially more in the future
compare.sh wrong slow generator numTests
wrong, slow and generator are respectively the executables of the two solutions and of the testcases generator
compare the outputs of two solutions of a problem, checking if they give the same outputs
for generate test case use uid(a, b) that generate a randomic number from [a, b]
#define uid(a, b) uniform_int_distribution(a, b)(rng)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
validate.sh solution validator generator numTests