summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authorClément DAVID <clement.david@esi-group.com>2020-10-15 14:12:04 +0200
committerCédric DELAMARRE <cdl@esi-group.com>2020-10-15 17:13:51 +0200
commit3a60f726f69b32c9dbd809eb4ac02bc859493f0f (patch)
tree7fa1a62ef71f986b8957fa567331c70c056d5cfd /scilab
parente50643345711b45e84722acd5e20db0be3da36d2 (diff)
downloadscilab-3a60f726f69b32c9dbd809eb4ac02bc859493f0f.zip
scilab-3a60f726f69b32c9dbd809eb4ac02bc859493f0f.tar.gz
coverage: various bug fixes and simpler usage
Change-Id: Idec51de34280de0d3f3fb6124324750f20999384
Diffstat (limited to 'scilab')
-rw-r--r--scilab/CHANGES.md5
-rw-r--r--scilab/modules/coverage/help/en_US/covStart.xml75
-rw-r--r--scilab/modules/coverage/sci_gateway/cpp/sci_covStart.cpp9
-rw-r--r--scilab/modules/coverage/src/cpp/CoverModule.cpp76
-rw-r--r--scilab/modules/coverage/src/cpp/CoverResult.cpp2
-rw-r--r--scilab/modules/coverage/tests/unit_tests/covStart.tst27
6 files changed, 166 insertions, 28 deletions
diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md
index 891403f..b093213 100644
--- a/scilab/CHANGES.md
+++ b/scilab/CHANGES.md
@@ -291,6 +291,7 @@ Bug Fixes
291* [#14488](https://bugzilla.scilab.org/14488): The `frameflag=9` and `strf=".9."` values of these `plot2d` options were no longer accepted. Their documentation was ambiguous. 291* [#14488](https://bugzilla.scilab.org/14488): The `frameflag=9` and `strf=".9."` values of these `plot2d` options were no longer accepted. Their documentation was ambiguous.
292* [#14718](https://bugzilla.scilab.org/14718): `user` is removed for a while but was still documented. 292* [#14718](https://bugzilla.scilab.org/14718): `user` is removed for a while but was still documented.
293* [#14873](https://bugzilla.scilab.org/14873): `setfield` page: The output and the 6.0 history were documented only on the en_US version. The input was wrongly restricted to matrices, while any Scilab object is acceptable. The specific role of `setfield` for mlists was not really described nor illustrated. The example did not include any call to setfield. 293* [#14873](https://bugzilla.scilab.org/14873): `setfield` page: The output and the 6.0 history were documented only on the en_US version. The input was wrongly restricted to matrices, while any Scilab object is acceptable. The specific role of `setfield` for mlists was not really described nor illustrated. The example did not include any call to setfield.
294* [#15012](https://bugzilla.scilab.org/15012): `covStart(["isempty" ; "isscalar"])` crashed Scilab.
294* [#15163](https://bugzilla.scilab.org/15163): `getdate` page: The time referential was obscure: a) UTC for Unix Time Convention vs Coordinated Universal Time. b) unclear influence of the time zone. 295* [#15163](https://bugzilla.scilab.org/15163): `getdate` page: The time referential was obscure: a) UTC for Unix Time Convention vs Coordinated Universal Time. b) unclear influence of the time zone.
295* [#15280](https://bugzilla.scilab.org/15280): `gsort` was unable to sort any hypermatrix along dimensions > "r"|"c". 296* [#15280](https://bugzilla.scilab.org/15280): `gsort` was unable to sort any hypermatrix along dimensions > "r"|"c".
296* [#15839](https://bugzilla.scilab.org/15839): `gsort`: the only sparse possible input were real or complex vectors, and only with the `g` method. 297* [#15839](https://bugzilla.scilab.org/15839): `gsort`: the only sparse possible input were real or complex vectors, and only with the `g` method.
@@ -300,6 +301,8 @@ Bug Fixes
300* [#16106](https://bugzilla.scilab.org/16106): Xcos sciblk4 user-defined blocks did not handle opar and odstate/oz correctly. 301* [#16106](https://bugzilla.scilab.org/16106): Xcos sciblk4 user-defined blocks did not handle opar and odstate/oz correctly.
301* [#16122](https://bugzilla.scilab.org/16122): concat polynomials with <> var did not raise an error. 302* [#16122](https://bugzilla.scilab.org/16122): concat polynomials with <> var did not raise an error.
302* [#16151](https://bugzilla.scilab.org/16151): `isequal(1:$, 2:$)` returned `%T`. 303* [#16151](https://bugzilla.scilab.org/16151): `isequal(1:$, 2:$)` returned `%T`.
304* [#16193](https://bugzilla.scilab.org/16193): `covStart()` clear previous coverage information. `profileEnable()` could be use to append a macro later on.
305* [#16196](https://bugzilla.scilab.org/16196): `covStart()` help page was incomplete about the API usage.
303* [#16274](https://bugzilla.scilab.org/16274): assert_checkequal() did not considered equal matching Nan or void elements in (nested) containers. 306* [#16274](https://bugzilla.scilab.org/16274): assert_checkequal() did not considered equal matching Nan or void elements in (nested) containers.
304* [#16337](https://bugzilla.scilab.org/16337): The 3rd output of `[U,km,ku] = unique(..)` was not implemented. 307* [#16337](https://bugzilla.scilab.org/16337): The 3rd output of `[U,km,ku] = unique(..)` was not implemented.
305* [#16342](https://bugzilla.scilab.org/16342): `strcat()` was much slower in Scilab 6.0.2. 308* [#16342](https://bugzilla.scilab.org/16342): `strcat()` was much slower in Scilab 6.0.2.
@@ -326,7 +329,7 @@ Bug Fixes
326* [#16465](https://bugzilla.scilab.org/16465): Scinotes OpenRecent menu was not updated when it should. 329* [#16465](https://bugzilla.scilab.org/16465): Scinotes OpenRecent menu was not updated when it should.
327* [#16473](https://bugzilla.scilab.org/16473): Deleting rows in a sparse squared the matrix with padding zeros (Scilab 6 regression). 330* [#16473](https://bugzilla.scilab.org/16473): Deleting rows in a sparse squared the matrix with padding zeros (Scilab 6 regression).
328* [#16474](https://bugzilla.scilab.org/16474): `imult(%z)` crashed Scilab. 331* [#16474](https://bugzilla.scilab.org/16474): `imult(%z)` crashed Scilab.
329* [#16496](https://bugzilla.scilab.org/16496): The `getdate` page should be rewritten: a) `getdate("s")` does NOT take leap seconds into account. b) `D=getdate(X)` is vectorized, accepts fractional seconds and returns them in [0,1) in D(10) instead of milliseconds. Moreover, the time referential of the result was unclear (time zone, daylight saving offset). 332* [#16496](https://bugzilla.scilab.org/16496): The `getdate` page should be rewritten: a) `getdate("s")` does NOT take leap seconds into account. b) `D=getdate(X)` is vectorized, accepts fractional seconds and returns them in `[0,1)` in D(10) instead of milliseconds. Moreover, the time referential of the result was unclear (time zone, daylight saving offset).
330* [#16512](https://bugzilla.scilab.org/16512): 1 ./ uint8(0) crashes Scilab (idem with int8, uint16, int16, uint32, int32, uint64, int64). 333* [#16512](https://bugzilla.scilab.org/16512): 1 ./ uint8(0) crashes Scilab (idem with int8, uint16, int16, uint32, int32, uint64, int64).
331* [#16517](https://bugzilla.scilab.org/16517): `getdate("s")` truncated the actual time to integer seconds. `getdate(u)(10)` returned fractional seconds instead of milliseconds as `getdate()`. 334* [#16517](https://bugzilla.scilab.org/16517): `getdate("s")` truncated the actual time to integer seconds. `getdate(u)(10)` returned fractional seconds instead of milliseconds as `getdate()`.
332* [#16522](https://bugzilla.scilab.org/16522): `bitget(x,pos)` and `bitset(x,pos)` results could be wrong when `pos` is an encoded integer. 335* [#16522](https://bugzilla.scilab.org/16522): `bitget(x,pos)` and `bitset(x,pos)` results could be wrong when `pos` is an encoded integer.
diff --git a/scilab/modules/coverage/help/en_US/covStart.xml b/scilab/modules/coverage/help/en_US/covStart.xml
index 764224c..bbe2416 100644
--- a/scilab/modules/coverage/help/en_US/covStart.xml
+++ b/scilab/modules/coverage/help/en_US/covStart.xml
@@ -13,38 +13,43 @@
13 <refsynopsisdiv> 13 <refsynopsisdiv>
14 <title>Syntax</title> 14 <title>Syntax</title>
15 <synopsis> 15 <synopsis>
16 covStart(paths
17 covStart(lib)
18 covStart([path ; lib])
19 covStart(macro) 16 covStart(macro)
20 covStart("all") 17 covStart([dirs names])
18 covStart(lib), covStart("all")
19 counters = covStart(...)
21 </synopsis> 20 </synopsis>
22 </refsynopsisdiv> 21 </refsynopsisdiv>
23 <refsection> 22 <refsection>
24 <title>Arguments</title> 23 <title>Arguments</title>
25 <variablelist> 24 <variablelist>
26 <varlistentry> 25 <varlistentry>
27 <term>paths</term> 26 <term>macro</term>
28 <listitem> 27 <listitem>
29 <para>string paths to identify macros</para> 28 <para>a specific function (as a string name or a function value).</para>
30 </listitem> 29 </listitem>
31 </varlistentry> 30 </varlistentry>
32 <varlistentry> 31 <varlistentry>
33 <term>lib</term> 32 <term>dirs</term>
34 <listitem> 33 <listitem>
35 <para>a library or a string which is a library name</para> 34 <para>a column vector of strings. Directory paths to identify macros. All <literal>.sci</literal> file stored in these directories and loaded within Scilab are instrumented.</para>
36 </listitem> 35 </listitem>
37 </varlistentry> 36 </varlistentry>
38 <varlistentry> 37 <varlistentry>
39 <term>macro</term> 38 <term>names</term>
40 <listitem> 39 <listitem>
41 <para>a specific function (as a string name or a function value)</para> 40 <para>a column vector of strings. Per directory name to display on the HTML output.</para>
42 </listitem> 41 </listitem>
43 </varlistentry> 42 </varlistentry>
44 <varlistentry> 43 <varlistentry>
45 <term>"all"</term> 44 <term>lib</term>
46 <listitem> 45 <listitem>
47 <para>special argument to instrument all the loaded macros</para> 46 <para>a library or a string which is a Scilab library name for instrumenting a Scilab-provided library. Can be <literal>"all"</literal> to instrument all the currently loaded Scilab-provided libraries.</para>
47 </listitem>
48 </varlistentry>
49 <varlistentry>
50 <term>counters</term>
51 <listitem>
52 <para>Count of all the instrumentation points.</para>
48 </listitem> 53 </listitem>
49 </varlistentry> 54 </varlistentry>
50 </variablelist> 55 </variablelist>
@@ -52,10 +57,13 @@
52 <refsection> 57 <refsection>
53 <title>Description</title> 58 <title>Description</title>
54 <para> 59 <para>
55 Instruments the passed arguments to store runtime informations on execution. These informations can be latter exported by calling <literal>covWrite</literal>. To remove any instrumentation data <literal>covStop</literal> can be used. 60 Instruments the passed arguments to store runtime informations on execution. These informations can be latter exported by calling <literal>covWrite</literal> or <literal>profileGetInfo</literal>. To remove any instrumentation data <literal>covStop</literal> can be used.
61 </para>
62 <para>
63 You can either select a single function, user-defined libraries (as macros directories) or Scilab-provided libraries. The <literal>"all"</literal> analysis is useful to have a global overview and later specific informations can be produced for one or a set of identified functions.
56 </para> 64 </para>
57 <para> 65 <para>
58 You can either select a set of function or all the available one on a specific call. The <literal>"all"</literal> analysis is useful to have a global overview and later specific informations can be produced for one or a set of identified functions. 66 Each time the function is called, it clears the previous instrumented counters. The associated <literal>profileEnable</literal> and <literal>profileDisable</literal> functions could be used to fine-tune your selection without clearing everything.
59 </para> 67 </para>
60 </refsection> 68 </refsection>
61 <refsection> 69 <refsection>
@@ -66,6 +74,36 @@ for i=1:1e5; isempty(i); end // run
66covWrite("html", "TMPDIR/coverage") // write runtime information to a directory 74covWrite("html", "TMPDIR/coverage") // write runtime information to a directory
67covStop(); // remove any instrumentation 75covStop(); // remove any instrumentation
68 ]]></programlisting> 76 ]]></programlisting>
77 <programlisting role="example"><![CDATA[
78// load the libraries before instrumeting them
79loadXcosLibs();
80loadScicos();
81
82// Pass [dirs names] to list the libraries and associate names
83covStart(["SCI\modules\xcos\macros" "xcos" ; ..
84 "SCI\modules\scicos\macros\scicos_auto" "scicos_auto" ; ..
85 "SCI\modules\scicos\macros\scicos_scicos" "scicos_scicos" ; ..
86 "SCI\modules\scicos\macros\scicos_utils" "scicos_utils"]);
87
88// run the bench
89importXcosDiagram("modules\xcos\demos\Cont.Disc-Observer.zcos");
90scicos_simulate(scs_m, list(), "nw");
91
92// write the output
93covWrite("html", "TMPDIR/coverage2");
94covStop();
95 ]]></programlisting>
96 <programlisting role="example"><![CDATA[
97// instrument the Scilab "elementary_functions" library
98covStart("elementary_functions")
99
100// run
101ones(100,200) .\. ones(1000,2000)
102
103// write the output as HTML
104covWrite("html", "TMPDIR/coverage3")
105covStop();
106 ]]></programlisting>
69 </refsection> 107 </refsection>
70 <refsection role="see also"> 108 <refsection role="see also">
71 <title>See also</title> 109 <title>See also</title>
@@ -76,6 +114,15 @@ covStop(); // remove any instrumentation
76 <member> 114 <member>
77 <link linkend="covWrite">covWrite</link> 115 <link linkend="covWrite">covWrite</link>
78 </member> 116 </member>
117 <member>
118 <link linkend="profileGetInfo">profileGetInfo</link>
119 </member>
120 <member>
121 <link linkend="profileEnable">profileEnable</link>
122 </member>
123 <member>
124 <link linkend="profileDisable">profileDisable</link>
125 </member>
79 </simplelist> 126 </simplelist>
80 </refsection> 127 </refsection>
81</refentry> 128</refentry>
diff --git a/scilab/modules/coverage/sci_gateway/cpp/sci_covStart.cpp b/scilab/modules/coverage/sci_gateway/cpp/sci_covStart.cpp
index b3a6af8..71d3332 100644
--- a/scilab/modules/coverage/sci_gateway/cpp/sci_covStart.cpp
+++ b/scilab/modules/coverage/sci_gateway/cpp/sci_covStart.cpp
@@ -39,13 +39,13 @@ types::Function::ReturnValue sci_covStart(types::typed_list &in, int _iRetCount,
39{ 39{
40 if (in.size() != 1) 40 if (in.size() != 1)
41 { 41 {
42 Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "covStart" , 1); 42 Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "covStart", 1);
43 return types::Function::Error; 43 return types::Function::Error;
44 } 44 }
45 45
46 if (!in[0]->isMacro() && !in[0]->isMacroFile() && (!in[0]->isString() || (in[0]->getAs<types::String>()->getCols() != 2 && in[0]->getAs<types::String>()->getCols() != 1))) 46 if (!in[0]->isMacro() && !in[0]->isMacroFile() && (!in[0]->isString() || (in[0]->getAs<types::String>()->getCols() != 2 && in[0]->getAs<types::String>()->getCols() != 1)))
47 { 47 {
48 Scierror(999, _("%s: Wrong type for input argument #%d: A two-columns string matrix expected.\n"), "covStart" , 1); 48 Scierror(999, _("%s: Wrong type for input argument #%d: A two-columns string matrix expected.\n"), "covStart", 1);
49 return types::Function::Error; 49 return types::Function::Error;
50 } 50 }
51 51
@@ -54,7 +54,7 @@ types::Function::ReturnValue sci_covStart(types::typed_list &in, int _iRetCount,
54 types::String * strs = in[0]->getAs<types::String>(); 54 types::String * strs = in[0]->getAs<types::String>();
55 const unsigned int rows = strs->getRows(); 55 const unsigned int rows = strs->getRows();
56 56
57 if (strs->getSize() == 2) 57 if (strs->getCols() == 2)
58 { 58 {
59 std::vector<std::pair<std::wstring, std::wstring>> paths_mods; 59 std::vector<std::pair<std::wstring, std::wstring>> paths_mods;
60 paths_mods.reserve(rows); 60 paths_mods.reserve(rows);
@@ -91,5 +91,8 @@ types::Function::ReturnValue sci_covStart(types::typed_list &in, int _iRetCount,
91 } 91 }
92 } 92 }
93 93
94 coverage::CoverModule* const instance = coverage::CoverModule::getInstance();
95 out.emplace_back(new types::Double(instance->getCounters().size()));
96
94 return types::Function::OK; 97 return types::Function::OK;
95} 98}
diff --git a/scilab/modules/coverage/src/cpp/CoverModule.cpp b/scilab/modules/coverage/src/cpp/CoverModule.cpp
index 6e748ec..1bd135a 100644
--- a/scilab/modules/coverage/src/cpp/CoverModule.cpp
+++ b/scilab/modules/coverage/src/cpp/CoverModule.cpp
@@ -20,6 +20,8 @@
20#include <libxml/xmlreader.h> 20#include <libxml/xmlreader.h>
21#include <libxml/xpath.h> 21#include <libxml/xpath.h>
22 22
23#include <algorithm>
24
23#include "CovHTMLCodePrinter.hxx" 25#include "CovHTMLCodePrinter.hxx"
24#include "CoverModule.hxx" 26#include "CoverModule.hxx"
25#include "allexp.hxx" 27#include "allexp.hxx"
@@ -46,6 +48,18 @@ extern "C"
46#define DEFAULT_FILESPEC L"*" 48#define DEFAULT_FILESPEC L"*"
47#endif 49#endif
48 50
51namespace
52{
53std::wstring expandPathVariable(const std::wstring& p )
54{
55
56 wchar_t* localPath = expandPathVariableW((wchar_t*)p.c_str());
57 std::wstring l(localPath);
58 FREE(localPath);
59 return l;
60}
61}
62
49namespace coverage 63namespace coverage
50{ 64{
51 65
@@ -85,13 +99,53 @@ CoverModule::~CoverModule()
85 99
86const std::vector<std::pair<std::wstring, std::wstring>> CoverModule::getModule(const std::vector<std::wstring>& moduleNames) 100const std::vector<std::pair<std::wstring, std::wstring>> CoverModule::getModule(const std::vector<std::wstring>& moduleNames)
87{ 101{
102 if (moduleNames.size() == 0)
103 {
104 // nothing to do, return empty
105 return {};
106 }
107
108 if (std::all_of(moduleNames.begin(), moduleNames.end(),
109 [](const std::wstring & p)
110{
111 return isdirW(expandPathVariable(p).c_str()) == TRUE;
112 }))
113 {
114 // all the provided modulesNames are directories, name them and remove "\macros"
115 std::vector<std::pair<std::wstring, std::wstring>> paths;
116
117 // remove any potential "\macros" suffix
118 for (const auto& name : moduleNames)
119 {
120 const std::wstring remove(std::wstring(DIR_SEPARATORW) + std::wstring(L"macros"));
121 std::wstring localName;
122 size_t n = name.rfind(remove);
123 if (n > 0)
124 {
125 localName = name.substr(0, n) + name.substr(n + remove.length());
126 }
127 else
128 {
129 localName = name;
130 }
131 n = localName.rfind(DIR_SEPARATORW);
132 if (n > 0)
133 {
134 localName = localName.substr(n + 1, localName.length() - n);
135 }
136
137 paths.emplace_back(expandPathVariable(name), std::move(localName));
138 }
139 return paths;
140 }
141
142 // Look for the names as Scilab-related libraries
88 const std::wstring _path = std::wstring(L"SCI") + DIR_SEPARATORW + L"modules" + DIR_SEPARATORW; 143 const std::wstring _path = std::wstring(L"SCI") + DIR_SEPARATORW + L"modules" + DIR_SEPARATORW;
89 wchar_t* __path = expandPathVariableW((wchar_t*)_path.c_str()); 144 const std::wstring path(expandPathVariable(_path));
90 const std::wstring path(__path);
91 FREE(__path);
92 145
93 if (moduleNames.size() == 1 && moduleNames.back() == L"all") 146 if (moduleNames.size() == 1 && moduleNames.back() == L"all")
94 { 147 {
148 // "all" keyword, parse all the Scilab library files
95 int size = -1; 149 int size = -1;
96 wchar_t** files = findfilesW(path.c_str(), DEFAULT_FILESPEC, &size, FALSE); 150 wchar_t** files = findfilesW(path.c_str(), DEFAULT_FILESPEC, &size, FALSE);
97 if (size > 0 && files) 151 if (size > 0 && files)
@@ -113,6 +167,7 @@ const std::vector<std::pair<std::wstring, std::wstring>> CoverModule::getModule(
113 } 167 }
114 else 168 else
115 { 169 {
170 // a list of Scilab libraries
116 std::vector<std::pair<std::wstring, std::wstring>> paths; 171 std::vector<std::pair<std::wstring, std::wstring>> paths;
117 for (const auto& name : moduleNames) 172 for (const auto& name : moduleNames)
118 { 173 {
@@ -126,14 +181,15 @@ void CoverModule::getMacros(const std::vector<std::pair<std::wstring, std::wstri
126{ 181{
127 for (const auto& p : paths_mods) 182 for (const auto& p : paths_mods)
128 { 183 {
129 std::wstring _path = p.first + DIR_SEPARATORW + L"macros"; 184 getMacrosFromDir(p.first, p.second);
130 getMacrosFromDir(_path, p.second);
131 } 185 }
132} 186}
133 187
134void CoverModule::getMacrosFromDir(const std::wstring& path, const std::wstring& module) 188void CoverModule::getMacrosFromDir(const std::wstring& path, const std::wstring& module)
135{ 189{
136 std::wstring _path = path + DIR_SEPARATORW + L"lib"; 190 const std::wstring resolvedPath(expandPathVariable(path));
191
192 std::wstring _path = resolvedPath + DIR_SEPARATORW + L"lib";
137 getMacros(_path, module); 193 getMacros(_path, module);
138 194
139 int size = -1; 195 int size = -1;
@@ -157,9 +213,7 @@ void CoverModule::getMacrosFromDir(const std::wstring& path, const std::wstring&
157void CoverModule::getMacros(const std::wstring& path, const std::wstring& module) 213void CoverModule::getMacros(const std::wstring& path, const std::wstring& module)
158{ 214{
159 std::unordered_set<std::wstring> _macros; 215 std::unordered_set<std::wstring> _macros;
160 wchar_t* pwstPathLib = expandPathVariableW((wchar_t*)path.c_str()); 216 std::wstring libPath(expandPathVariable(path));
161 std::wstring libPath(pwstPathLib);
162 FREE(pwstPathLib);
163 217
164 char* libFile = wide_string_to_UTF8(libPath.c_str()); 218 char* libFile = wide_string_to_UTF8(libPath.c_str());
165 219
@@ -312,7 +366,9 @@ std::vector<Counter>::const_iterator CoverModule::lower_bound(const std::vector<
312 for (auto it = first; it < last; it++) 366 for (auto it = first; it < last; it++)
313 { 367 {
314 if (it->getMacro() == value) 368 if (it->getMacro() == value)
369 {
315 return it; 370 return it;
371 }
316 } 372 }
317 373
318 return last; 374 return last;
@@ -324,7 +380,9 @@ std::vector<Counter>::const_iterator CoverModule::upper_bound(const std::vector<
324 for (auto it = lower_bound(first, last, value); it < last; it++) 380 for (auto it = lower_bound(first, last, value); it < last; it++)
325 { 381 {
326 if (it->getMacro() != value) 382 if (it->getMacro() != value)
383 {
327 return it; 384 return it;
385 }
328 } 386 }
329 387
330 return last; 388 return last;
diff --git a/scilab/modules/coverage/src/cpp/CoverResult.cpp b/scilab/modules/coverage/src/cpp/CoverResult.cpp
index c3f95d9..77d7263 100644
--- a/scilab/modules/coverage/src/cpp/CoverResult.cpp
+++ b/scilab/modules/coverage/src/cpp/CoverResult.cpp
@@ -556,7 +556,7 @@ std::wstring CoverResult::getStringTime(const uint64_t time) const
556 { 556 {
557 // between 0 and 10^6 ns 557 // between 0 and 10^6 ns
558 std::wostringstream out; 558 std::wostringstream out;
559 out << ((double)time / 1000.) << L" µs"; 559 out << ((double)time / 1000.) << L" &mu;s";
560 return out.str(); 560 return out.str();
561 } 561 }
562 else if (time < 1000000000UL) 562 else if (time < 1000000000UL)
diff --git a/scilab/modules/coverage/tests/unit_tests/covStart.tst b/scilab/modules/coverage/tests/unit_tests/covStart.tst
new file mode 100644
index 0000000..7aa1b1e
--- /dev/null
+++ b/scilab/modules/coverage/tests/unit_tests/covStart.tst
@@ -0,0 +1,27 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2020 - ESI Group - Clement DAVID
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7//
8// <-- CLI SHELL MODE -->
9// <-- NO CHECK REF -->
10//
11
12// only check API there and ensure there is some instrumentation in progress
13
14info = covStart("SCI/modules/xcos");
15assert_checktrue(info > 0);
16
17info = covStart(["SCI/modules/xcos/macros" "xcoslib" ; ..
18 "SCI/modules/scicos/macros/scicos_auto" "scicos_autolib" ; ..
19 "SCI/modules/scicos/macros/scicos_scicos" "scicos_scicoslib" ; ..
20 "SCI/modules/scicos/macros/scicos_utils" "scicos_utilslib"]);
21assert_checktrue(info > 0);
22
23info = covStart("elementary_functions");
24assert_checktrue(info > 0);
25
26info = covStart("all");
27assert_checktrue(info > 0);