Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2023.0.0 - Português


covStart

Instruments some macros to store runtime information on code coverage and execution time

Syntax

covStart(macro)
covStart([dirs names])
covStart(lib)
covStart(libnames)
covStart("all") // deprecated, use covStart(librarieslist())
counters = covStart(...)

Arguments

macro

a specific function (as a string name or a function value).

dirs

a column vector of strings. Directory paths to identify macros. All .sci file stored in these directories and loaded within Scilab are instrumented.

names

a column vector of strings. Per directory name to display on the HTML output.

lib

a library or a string which is a Scilab library name for instrumenting a Scilab-provided library. Can be "all" to instrument all the currently loaded Scilab-provided libraries.

counters

Count of all the instrumentation points.

Description

Instruments the passed arguments to store runtime informations on execution. These informations can be latter exported by calling covWrite or profileGetInfo. To remove any instrumentation data covStop can be used.

You can either select a single function, user-defined libraries (as macros directories) or Scilab-provided libraries. The "all" analysis is useful to have a global overview and later specific informations can be produced for one or a set of identified functions.

Each time the function is called, it clears the previous instrumented counters. The associated profileEnable and profileDisable functions could be used to fine-tune your selection without clearing everything.

Examples

covStart(isempty)                      // instrument isempty by macro value
for i=1:1e5; isempty(i); end           // run
covWrite("html", "TMPDIR/coverage")    // write runtime information to a directory
covStop();                             // remove any instrumentation
// load the libraries before instrumeting them
loadXcosLibs();
loadScicos();

// Pass [dirs names] to list the libraries and associate names
covStart(["SCI\modules\xcos\macros"                 "xcos" ; ..
          "SCI\modules\scicos\macros\scicos_auto"   "scicos_auto" ; ..
          "SCI\modules\scicos\macros\scicos_scicos" "scicos_scicos" ; ..
          "SCI\modules\scicos\macros\scicos_utils"  "scicos_utils"]);

// run the bench
importXcosDiagram("modules\xcos\demos\Cont.Disc-Observer.zcos");
scicos_simulate(scs_m, list(), "nw");

// write the output
covWrite("html", "TMPDIR/coverage2");
covStop();
// instrument the Scilab "elementary_functions" library
covStart("elementary_functions")

// run
ones(100,200) .\. ones(1000,2000)

// write the output as HTML
covWrite("html", "TMPDIR/coverage3")
covStop();

See also

  • covStop — Removes all instrumentation data
  • covWrite — Exports runtime information to files
  • profileGetInfo — Retrieve instrumentation information as a Scilab value
  • profileEnable — Add instrumentation to a function, a library or all available functions
  • profileDisable — Remove instrumentation from a function, a library or remove all instrumentation
Report an issue
<< covMerge Coverage covStop >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Mar 27 09:50:00 GMT 2023