anchor.diff:  	<cfinclude template="plugins/injection.cfm">
   
   	<cfset variables.WHEELS_TESTS_BASE_COMPONENT_PATH = "">
  -	<cfset variables.WHEELS_TESTS_BASE_ROOT_PATH = "">
   
   	<!---
   		Instanciate all components in specified package and call their runTest()
  
positive.code: 		<cfargument name="options" type="struct" required="false" default="#structnew()#">
  		<cfset var loc = {}>
  		<cfset var q = "">
  		<cfset loc.s = {}>
  		<cfset loc.s.testPackage = "">
  		<cfset loc.s.resultKey = "WheelsTests">
  		<cfset loc.loadenv = false>
  		<cfset loc.savedenv = {}>
  
  		<cfset loc.package = "">
  		<cfset loc.type = "core">
  
  		<cfif structkeyexists(arguments.options, "package")>
  			<cfset loc.packages = arguments.options.package>
  		</cfif>
  
  		<cfif structkeyexists(arguments.options, "type")>
  			<cfset loc.type = arguments.options.type>
  		</cfif>
  
  		<cfset loc.componentpath = "#application.wheels.rootComponentPath#.#application.wheels.pluginComponentPath#.#loc.type#">
  
  		<!--- core test --->
  		<cfif loc.type eq "core">
  			<cfset loc.componentpath = application.wheels.wheelsComponentPath>
  		<cfelseif loc.type eq "app">
  			<cfset loc.componentpath = application.wheels.rootComponentPath>
  		</cfif>
  
  		<cfset loc.componentpath = listappend("#loc.componentpath#.tests", loc.package, ".")>
  
  		<!--- clean up componentpath --->
  		<cfset loc.componentpath = listchangedelims(loc.componentpath, ".", ".")>
  		<!--- convert to regular path --->
  		<cfset loc.path = "/" & listchangedelims(loc.componentpath, "/", ".")>
  		<cfset loc.epath = expandPath(loc.path)>
  
  		<!---
  		if env.cfm files exists, call to override enviroment settings so tests can run.
  		when overriding, save the original env so we can put it back later.
  		 --->
  		<cfif FileExists(loc.epath & "/env.cfm")>
  			<cfset loc.loadenv = true>
  			<cfset loc.savedenv = duplicate(application)>
  			<cfinclude template="#loc.path & '/env.cfm'#">
  		</cfif>
  
  		<!---  --->
  		<cfset variables.WHEELS_TESTS_BASE_COMPONENT_PATH = loc.componentpath>
  		<cfset variables.WHEELS_TESTS_BASE_ROOT_PATH = loc.epath>
  
  		<cfdirectory directory="#loc.epath#" action="list" recurse="true" name="q" filter="*.cfc" />
  
  		<!--- run tests --->
  		<cfloop query="q">
  			<cfset loc.testname = listchangedelims(removechars(directory, 1, len(variables.WHEELS_TESTS_BASE_ROOT_PATH)), ".", "\/")>
  			<cfset loc.testname = listprepend(loc.testname, variables.WHEELS_TESTS_BASE_COMPONENT_PATH, ".")>
  			<cfset loc.testname = listappend(loc.testname, listfirst(name, "."), ".")>
  			<cfif isValidTest(loc.testname)>
  				<cfset loc.instance = createObject("component", loc.testname)>
  				<cfset loc.instance.runTest(loc.s.resultKey)>
  			</cfif>
  		</cfloop>
  
  		<!--- swap back the enviroment if overwritten --->
  		<cfif loc.loadenv>
  			<cfset application = duplicate(loc.savedenv)>
  		</cfif>
  
  		<cfreturn HTMLFormatTestResults(loc.s.resultKey)>
  
  	</cffunction>
  
  
negative.code: 			</cfif>
  
  		</cfloop>
  
  		<cfif structKeyExists(this, "_teardown")>
  			<cfset _teardown()>
  		</cfif>
  