[IronPython] InvalidProgramException exception with NUnit
Fernando Correia
fernandoacorreia at gmail.com
Tue Sep 30 16:19:57 CEST 2008
2008/9/29 Curt Hagenlocher <curt at hagenlocher.org>:
> Does it work correctly under NUnit if you disable shadow copying?
The sample test I provided runs without problem when it is executed
directly by NUnit, but fails if NUnit is being called by some other
layer, like the TestDriven.NET plugin for Visual Studio or the NCover
code coverage tool.
This behavior happens in both my desktop and in our build server, and
both within Visual Studio and in our command-line based build.
The use of the /noshadow parameter did not affect the results.
This behavior is probably linked to some difference in process or
AppDomain when NUnit is executed within another tool. I wouldn't be
able to tell what is the difference, though.
It only affects testing of IronPython code, and only when the "import"
command is used in the script.
The exception is raised at line 276 of CallSite.cs:
result = caller(ruleTarget, site, args);
In the stack trace it appears as (line breaks added):
Microsoft.Scripting.Core.dll!Microsoft.Scripting.Actions.CallSite
<Microsoft.Func<Microsoft.Scripting.Actions.CallSite,Microsoft.Scripting.Runtime.CodeContext,
object,string,Microsoft.Scripting.IAttributesCollection,Microsoft.Scripting.IAttributesCollection,
IronPython.Runtime.PythonTuple,object>>.UpdateAndExecute(object[] args
= {object[6]}) Line 276 C#
"caller" is:
- caller {Method = {System.Object
Call6[CodeContext,Object,String,IAttributesCollection,IAttributesCollection,PythonTuple,Object](Microsoft.Func`8[Microsoft.Scripting.Actions.CallSite,Microsoft.Scripting.Runtime.CodeContext,
System.Object,System.String,Microsoft.Scripting.IAttributesCollection,Microsoft.Scripting.IAttributesCollection,
IronPython.Runtime.PythonTuple,System.Object],
Microsoft.Scripting.Actions.CallSite,
System.Object[])}} Microsoft.Scripting.Actions.MatchCallerTarget<Microsoft.Func<Microsoft.Scripting.Actions.CallSite,
Microsoft.Scripting.Runtime.CodeContext,object,string,Microsoft.Scripting.IAttributesCollection,
Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.PythonTuple,object>>
And the Call6 function is:
/// Matchcaller - arity 6
internal static object Call6<T0, T1, T2, T3, T4, T5,
TRet>(Func<CallSite, T0, T1, T2, T3, T4, T5, TRet> target, CallSite
site, object[] args) {
return (object)target(site, (T0)args[0], (T1)args[1],
(T2)args[2], (T3)args[3], (T4)args[4], (T5)args[5]);
}
But a breakpoint set at Call6 never is reached while debugging this issue.
More information about the Ironpython-users
mailing list