Skip to content

Commit e12696d

Browse files
authored
Merge pull request #446 from cse-sim/expression-coverage
Expression coverage
2 parents 51ebe66 + 120a9c9 commit e12696d

File tree

11 files changed

+836
-55
lines changed

11 files changed

+836
-55
lines changed

doc/src/records/top-members.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,18 @@ Allows passing an input value to ad-hoc debugging code. No permanent use; no im
10621062
required: "No",
10631063
variability: "subhourly") %>
10641064

1065+
**doCoverage=*choice***
1066+
1067+
Enables expression code coverage reporting. Development aid.
1068+
1069+
<%= member_table(
1070+
units: "",
1071+
legal_range: "NO, YES",
1072+
default: "*NO*",
1073+
required: "No",
1074+
variability: "constant") %>
1075+
1076+
10651077
**Related Probes:**
10661078

10671079
- @[top](#p_top)

src/CNRECS.DEF

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ RECORD TOPRAT "top" *RAT /* top level RAT: contains control info and all once-on
291291
*i INT tp_dbgPrintMaskC // debug print mask constant portion (value known during setup)
292292
*declare "int tp_SetDbMask();" // combine tp_dbgPrintMask and tp_dbgPrintMaskC, call DbSetMask
293293
*s INT tp_dbgFlag // debug flag value for passing testing info to code; normally no effect
294+
*i NOYESCH tp_doCoverage // track expression processing code coverage / report to log
295+
// (testing/development aid)
294296

295297
//TOP: inputs: autoSizing
296298
*i FRAC_GZ auszTol // autosizing result tolerance, dfl .005

src/cncult.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,6 +2812,7 @@ CULT cnTopCult[] = // Top level table, points to all other tables, used in cal
28122812
CULT( "dbgPrintMask",DAT, TOPRAT_DBGPRINTMASK,0, 0, VHRLY, TYINT, 0, 0, N, N),
28132813
CULT( "dbgPrintMaskC",DAT, TOPRAT_DBGPRINTMASKC,0, 0, VEOI, TYINT, 0, 0, N, N),
28142814
CULT( "dbgFlag", DAT, TOPRAT_DBGFLAG, 0, 0, VSUBHRLY,TYINT,0, 0, N, N),
2815+
CULT( "doCoverage", DAT, TOPRAT_DOCOVERAGE, 0, 0, VEOI, TYCH, 0, C_NOYESCH_NO, N, N),
28152816
CULT( "ventAvail", DAT, TOPRAT_VENTAVAIL, 0, 0, VHRLY, TYCH, 0, nc( C_VENTAVAILVC_WHOLEBLDG), N, N),
28162817

28172818
// TOP autosizing

src/cse.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
#include "timer.h" // tmrInit
7878
#include "tdpak.h" // tddtis
7979
#include "cuparse.h" // showProbeNames
80+
#include "cueval.h"
8081
#include "cnguts.h"
8182

8283
#include "csevrsn.h" // version #
@@ -1161,6 +1162,10 @@ LOCAL int cse3( int argc, const char* argv[])
11611162
// reports: "Unspool" virtual reports from this run into report/export output files
11621163
screen( NONL|QUIETIF, " Reports\n"); // progress indicator. follows last month name on screen (if no errMsgs).
11631164
// Is final message, so end with newline.
1165+
1166+
if (Top.tp_doCoverage == C_NOYESCH_YES)
1167+
CoverageReport( VrLog);
1168+
11641169
if (UnspoolInfo) // if UnspoolInfo got set up (in cncult.cpp).
11651170
// If not (early input error), ermsgs will be unspooled below via PriRep info.
11661171
{

0 commit comments

Comments
 (0)