32\documentclass[10pt]{article}
34\usepackage[a4paper,total={170mm,260mm},left=20mm,top=20mm,]{geometry}
37\usepackage{fancyhdr} % entêtes et pieds de pages personnalisés
40\fancyhead[L]{\scriptsize \textsc{Test suite report}} % À changer
41\fancyhead[R]{\scriptsize \textsc{\textsc{SHAMROCK}}} % À changer
42\fancyfoot[C]{ \thepage}
47\setlength{\droptitle}{-4\baselineskip} % Move the title up
49\pretitle{\begin{center}\Huge\bfseries} % Article title formatting
50\posttitle{\end{center}} % Article title closing formatting
51\title{\textsc{SHAMROCK} test suite report} % Article title
53\textsc{Timothée David--Cléris}\thanks{timothee.david--cleris@ens-lyon.fr} \\[1ex] % Your name
54\normalsize CRAL ENS de Lyon \\ % Your institution
59\definecolor{linkcolor}{rgb}{0,0,0.6}
64\usepackage[ pdftex,colorlinks=true,
65pdfstartview=ajustementV,
78\definecolor{GREEN}{rgb}{0,.7,0}
79\definecolor{RED}{rgb}{.8,0,0}
82\def\OK{\textcolor{GREEN}{OK}}
83\def\FAIL{\textcolor{RED}{FAIL}}
103 output << R
"(\section{Unittests})"
108 std::unordered_map<std::string, u32> assert_test_count;
109 std::unordered_map<std::string, u32> assert_test_count_success;
112 if (res.type == Unittest) {
113 assert_test_count[res.name] = 0;
118 if (res.type == Unittest) {
119 assert_test_count[res.name] += res.asserts.get_assert_count();
120 assert_test_count_success[res.name] += res.asserts.get_assert_success_count();
124 std::vector<std::string> strings;
125 for (
auto &[key, value] : assert_test_count) {
126 strings.push_back(key);
128 std::sort(strings.begin(), strings.end());
130 std::string table_header = R
"==(
132 \begin{tabular}{|l|c|c|}
134 Test name & Status & Asserts \\ \hline \hline
137 std::string table_footer = R"==(
139 \end{tabular}\end{center}
142 output << table_header;
145 for (std::string key : strings) {
146 u32 cnt = assert_test_count[key];
147 u32 cnt_suc = assert_test_count_success[key];
149 if (table_cnt > 50) {
150 output << table_footer <<
"\n\n" << table_header;
156 if (cnt == cnt_suc) {
157 output << R
"(\OK & )";
159 output << R
"(\FAIL & )";
162 output << shambase::format(R"({}/{} \\)", cnt_suc, cnt);
168 output << table_footer;
173 if (res.asserts.get_assert_success_count() != res.asserts.get_assert_count()) {
174 output <<
"Test : " << res.name <<
"\n\n";
176 for (
unsigned int j = 0; j < res.asserts.asserts.size(); j++) {
179 " - Assert [%d/%zu] \n\n", j + 1, res.asserts.asserts.size());
181 output << R
"(\verb|)" << res.asserts.asserts[j].name << "| : ";
183 if (res.asserts.asserts[j].value) {
186 output << R
"(\FAIL)";
189 if ((!res.asserts.asserts[j].value)
190 && !res.asserts.asserts[j].comment.empty()) {
191 output <<
"\n\n $\\rightarrow$ failed assert logs :\n\n";
192 output << R
"(\begin{verbatim})" << res.asserts.asserts[j].comment
193 << R"(\end{verbatim})";
206 output << R
"(\section{Tex report})";
209 std::string &tex_out = res.tex_output;
211 if (!tex_out.empty()) {
214 \cprotect\subsection{ \verb+)=="
226 sycl::device d = q.get_device();
227 output <<
"device name : " << d.get_info<sycl::info::device::name>() <<
"\n";
228 output <<
"platform name : " << d.get_platform().get_info<sycl::info::platform::name>()
230 output <<
"device property : \n";
231 output <<
"global_mem_size : "
234 output <<
"global_mem_cache_size : "
237 output <<
"global_mem_cache_line_size : "
239 d.get_info<sycl::info::device::global_mem_cache_line_size>())
241 output <<
"local_mem_size : "
244 output <<
"is_endian_little : " << d.get_info<sycl::info::device::is_endian_little>()
251 std::string cxxflags = compile_arg;
254 output << R
"(\section{Shamrock config})";
256 output << R
"(\subsection{Git info})"
258 output << R
"(\begin{verbatim})"
260 output << git_info_str;
261 output << R
"(\end{verbatim})"
263 output << R
"(\subsection{c++ flags})"
265 output << R
"(\begin{verbatim})"
268 output << R
"(\end{verbatim})"
271 output << R
"(\subsection{MPI status})"
273 output << R
"(\begin{verbatim})"
276 output << R
"(\end{verbatim})"
279 output << R
"(\subsection{NodeInstance Status})"
281 output <<
"compute queue : "
283 output << R
"(\begin{verbatim})"
286 output << R
"(\end{verbatim})"
288 output <<
"alt queue : "
290 output << R
"(\begin{verbatim})"
293 output << R
"(\end{verbatim})"
302 std::stringstream output;
306 output <<
"Global status : ";
309 output << R
"(\FAIL)";
315 output << R
"(\tableofcontents)";
Header file describing a Node Instance.
header describing return type of a test, and the type of the test
std::uint32_t u32
32 bit unsigned integer
Namespace for internal details of the logs module.
std::string trunc_str_start(std::string s, u32 max_len)
Truncate a string to a specified length, adding an ellipsis at the start if necessary.
std::string readable_sizeof(double size)
given a sizeof value return a readble string Example : readable_sizeof(1024*1024*1024) -> "1....
void replace_all(std::string &inout, std::string_view what, std::string_view with)
replace all occurence of a search string with another
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
i32 world_size()
Gives the size of the MPI communicator.
implementation details of the test library
void add_tex_output_section(std::stringstream &output, std::vector< TestResult > &results)
Add tex outputs from the tests to the report.
void add_config_section(std::stringstream &output)
Document details about the Shamrock status in the report.
void add_queue_section(std::stringstream &output, sycl::queue &q)
Document details about the SYCL queues status in the report.
void add_unittest_section(std::stringstream &output, std::vector< TestResult > &results)
Add the unittest section to the Tex report.
std::string make_test_report_tex(std::vector< TestResult > &results, bool mark_fail)
Make the tex report.
std::string tex_template_end
Footer of the document.
std::string tex_template
Tex report template to be used.