Skip to content

Commit f2b21bd

Browse files
committed
Manually set the python class method definition lines to not executable
1 parent 96098b8 commit f2b21bd

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

cls/TestCoverage/Data/CodeUnit.cls

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,19 @@ ClassMethod GetCurrentByName(pInternalName As %String, pSourceNamespace As %Stri
125125
Set pCodeUnit.Type = tType
126126
Set pCodeUnit.Hash = tHash
127127

128-
Set tBitString = ""
129-
For tLine=1:1:$Get(tCodeArray,0) {
130-
Set $Bit(tBitString,tLine) = $Get(tExecutableFlags(tLine),0)
131-
}
132-
Set pCodeUnit.ExecutableLines = tBitString
128+
133129

134130
If (tType = "CLS") {
135131
Set pCodeUnit.Generated = ($$$comClassKeyGet(tName,$$$cCLASSgeneratedby) '= "")
136132
}
137133

138134

139135
If (tType = "PY") {
136+
#; set tPointer = 0
137+
#; While $ListNext(pDocumentText, tPointer, tCurLine) {
138+
#; do pCodeUnit.Lines.Insert(tCurLine)
139+
#; }
140+
140141
Set ClassName = $Piece(tName,".", *)
141142
Set tMethodInfo = ##class(TestCoverage.Utils).GetPythonMethodMapping(pDocumentText, ClassName)
142143
Set tLineToMethodInfo = tMethodInfo."__getitem__"(0)
@@ -152,6 +153,7 @@ ClassMethod GetCurrentByName(pInternalName As %String, pSourceNamespace As %Stri
152153
Set tStartLine = tStartEnd."__getitem__"(0)
153154
Set tEndLine = tStartEnd."__getitem__"(1)
154155
Do pCodeUnit.MethodMap.SetAt(tStartLine,tMethod)
156+
Set tExecutableFlags(tStartLine) = 0
155157
Do pCodeUnit.MethodEndMap.SetAt(tEndLine, tMethod)
156158

157159
Set tMethodMask = ""
@@ -209,7 +211,13 @@ ClassMethod GetCurrentByName(pInternalName As %String, pSourceNamespace As %Stri
209211
}
210212
}
211213

212-
214+
Set tBitString = ""
215+
For tLine=1:1:$Get(tCodeArray,0) {
216+
Set $Bit(tBitString,tLine) = $Get(tExecutableFlags(tLine),0)
217+
}
218+
Set pCodeUnit.ExecutableLines = tBitString
219+
220+
213221
Set tSC = pCodeUnit.%Save()
214222
If $$$ISERR(tSC) && $System.Status.Equals(tSC,$$$ERRORCODE($$$IDKeyNotUnique)) {
215223
// Some other process beat us to it.

0 commit comments

Comments
 (0)