chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Answers. Here you can ask and receive answers from other community members. And if you liked or disliked an answer or thread: react with an up- or downvote Enjoy!
0 votes
Hi,

I try to run Isolator unit tests using Gallio.
Versions: Isolator 5.4.3.0, Gallio v3.1 Update 1 build 367 (i.e. got them today)

Trying Gallio Icarus (gui) or Gallio Echo (cli), but getting the following error:

TypeMock.TypeMockException: 
*** Typemock Isolator is not currently enabled. 
To enable do one of the following:

* To run Typemock Isolator as part of an automated process you can:
   - run tests via TMockRunner.exe command line tool
   - use 'TypeMockStart' tasks for MSBuild or NAnt

* To work with Typemock Isolator inside Visual Studio.NET:
        set Tools->Enable Typemock Isolator from within Visual Studio

For more information consult the documentation (see 'Running' topic)
   at TypeMock.MockManager.i()
   at TypeMock.MockManager.Init(Boolean collectAllCalls)
   at TypeMock.MockManager.g(Type A_0)
   at TypeMock.MockManager.Mock(Type type, Constructor mockConstructors)
   at TypeMock.MockManager.MockObject(Type type, Constructor mockConstructors, Object[] args)
   at TypeMock.MockManager.MockObject[TMockedType](Constructor mockConstructors)
   at TypeMock.ArrangeActAssert.InstanceFakerBase`1.g()
   at TypeMock.ArrangeActAssert.InstanceFakerBase`1.e()
   at f7.CreateFakeInstance[T](Members behavior, Constructor constructorFlag, Constructor baseConstructorFlag, Type baseType, Object[] ctorArgs)
   at f7.Instance[T](Members behavior)
   at Axiom.UnitTests.Fonts.FontManagerRegressionTests.SetUp()


I tried the test runners run standalone or under TMockRunner.exe like this:
C:\Tests>"C:\Program Files\Typemock\Isolator\5.4\TMockRunner.exe" -first "C:\Program Files\Gallio\bin\Gallio.Echo.exe" UnitTests.dll


The -first option was necessary otherwise I was getting a Gallio.Runtime.RuntimeException with System.AccessViolationException inner exception when a Gallio runner was initializing the tests. But I hope that there's some simple problem as to why the TypeMockException first, can you help?

Thanks
asked by (1.8k points)

5 Answers

0 votes
Hi

I checked it out and you are right.
However we fixed this issue and I'm sending you a patch.
Please try it and let me know if it helps.

Note: you should not use the -first argument since it's intended to work when linking the Isolator with some other profiler.
answered by (35.5k points)
0 votes
Great, I got your patch and it worked, at least with Gallio.Echo, I can now run the tests like this (if Typemock and Gallio are in path).
>TMockRunner Gallio.Echo.exe UnitTests.dll

Note: you should not use the -first argument since it's intended to work when linking the Isolator with some other profiler.

Thanks, I guessed that, but without -first the Gallio.Icarus throws the following while loading tests:
A fatal exception occurred while exploring tests.  Possible causes include invalid test runner parameters.
Gallio.Runtime.RuntimeException: Could not resolve instance of component 'MbUnit.TestFramework'. ---> Gallio.Runtime.RuntimeException: Could not resolve the component handler of component 'MbUnit.TestFramework'. ---> Gallio.Runtime.RuntimeException: Could not resolve the component type of component 'MbUnit.TestFramework'. ---> Gallio.Common.Reflection.ReflectionResolveException: Could not resolve type 'MbUnit.Core.MbUnitTestFramework, MbUnit'. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName)
   at Gallio.Common.Reflection.TypeName.Resolve()
   --- End of inner exception stack trace ---
   at Gallio.Common.Reflection.TypeName.Resolve()
   at Gallio.Runtime.Extensibility.ComponentDescriptor.ResolveComponentType()
   --- End of inner exception stack trace ---
   at Gallio.Runtime.Extensibility.ComponentDescriptor.ResolveComponentType()
   at Gallio.Runtime.Extensibility.ComponentDescriptor.ResolveComponentHandler()
   --- End of inner exception stack trace ---
   at Gallio.Runtime.Extensibility.ComponentDescriptor.ResolveComponentHandler()
   at Gallio.Runtime.Extensibility.ComponentDescriptor.ResolveComponent()
   --- End of inner exception stack trace ---
   at Gallio.Runtime.Extensibility.ComponentDescriptor.ResolveComponent()
   at Gallio.Runtime.Extensibility.ComponentHandle`2.<GetComponent>b__0()
   at Gallio.Common.Memoizer`1.Memoize(Func`1 populator)
   at Gallio.Runtime.Extensibility.ComponentHandle`2.GetComponent()
   at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.ForEachDriver[T](MultiMap`2 testFrameworkPartitions, Func`4 func)
   at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.ExploreImpl(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, IMessageSink messageSink, IProgressMonitor progressMonitor)
   at Gallio.Model.BaseTestDriver.Explore(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, IMessageSink messageSink, IProgressMonitor progressMonitor)
   at Gallio.Runner.DefaultTestRunner.Explore(TestPackage testPackage, TestExplorationOptions testExplorationOptions, IProgressMonitor progressMonitor)

Prior to applying the patch you sent me, Gallio.Echo was having just the same problem.
answered by (1.8k points)
0 votes
I can solve the above exception by adding Gallio.Icarus.exe to the namespaces.dat file, then tests can be run in Icarus too. But not sure if that's a correct fix.
answered by (1.8k points)
0 votes
Hi,
Yes it is :)
answered by (35.5k points)
0 votes
Thanks for the help :)
answered by (1.8k points)
...