Skip to content

Commit

Permalink
Added a way to hash .PY files in CodeUnit.GetCurrentHash()
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-cge committed Jun 27, 2024
1 parent b9845f8 commit d591894
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 5 additions & 2 deletions cls/TestCoverage/Data/CodeUnit.cls
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Index NameTypeHash On (Name, Type, Hash) [ Data = ExecutableLines, Unique ];
/// Name of the code unit
Property Name As %String(MAXLEN = 255) [ Required ];

/// Type (3-letter extension) of the code unit
/// Type (2 or 3-letter extension) of the code unit
Property Type As TestCoverage.DataType.RoutineType [ Required ];

/// Hash of the code unit; for methods for determining this, see <method>GetCurrentHash</method>
Expand Down Expand Up @@ -396,6 +396,10 @@ ClassMethod GetCurrentHash(pName As %String, pType As %String, Output pHash As %
// Skip header (lines 1-4) which, for .INT routines generated from classes,
// includes the class compilation signature.
Set pHash = ..HashArrayRange(.pCodeArray,5,pName_"."_pType,.tSizeHint)
} ElseIf (pType = "PY") {
Merge pCodeArray = ^ROUTINE(pName_".py",0)
set tSizeHint = ^ROUTINE(pName_".py",0,0)
set pHash = ..HashArrayRange(.pCodeArray, ,pName_".py", .pSizeHint)
} Else {
// Give standard descriptive error about the type being invalid.
$$$ThrowStatus(..TypeIsValid(pType))
Expand Down Expand Up @@ -492,4 +496,3 @@ Storage Default
}

}

3 changes: 1 addition & 2 deletions cls/TestCoverage/DataType/RoutineType.cls
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Class TestCoverage.DataType.RoutineType Extends %String [ ClassType = datatype ]

Parameter MAXLEN = 3;

Parameter VALUELIST = ",CLS,MAC,INT";
Parameter VALUELIST = ",CLS,MAC,INT,PY";

}

1 change: 0 additions & 1 deletion cls/TestCoverage/Manager.cls
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ Method StartCoverageTracking() As %Status [ Private ]
}
}
Set tMetrics = $ListBuild("RtnLine") _ $Select(..Timing:$ListBuild("Time","TotalTime"),1:"")
set ^IRIS.TEMPCG($i(^IRIS.TEMPCG)) = ..CoverageClasses
$$$ThrowOnError(..Monitor.StartWithScope(tRelevantTargets,tMetrics,tProcessIDs, ..CoverageClasses))
}
} Catch e {
Expand Down

0 comments on commit d591894

Please sign in to comment.