Can't get "debug" to show in my output

184 views
Skip to first unread message

David Harris

unread,
Feb 28, 2011, 1:16:06 PM2/28/11
to mxunit
Hi Everyone,

I am running MXUnit on CF9.0.1 and have a call to "debug()" in one of
my tests.

From what I can see this output should be shown on the results page,
but it isn't.

My test is:

<cffunction name="testadd" access="public" returnType="void"
output="true">

<cfscript>

var stMetaData = this.oComponent.functionThatReturnsAStruct();
debug( stMetaData);

</cfscript>
</cffunction>

My runner is just the sample on from the download.

What am I doing wrong?

Cheers,

David

Alex Sante

unread,
Feb 28, 2011, 2:15:55 PM2/28/11
to mxu...@googlegroups.com
First thing I would do is make sure your function is ACTUALLY returning something and not a null value.


--
You received this message because you are subscribed to the Google Groups "mxunit" group.
To post to this group, send email to mxu...@googlegroups.com.
To unsubscribe from this group, send email to mxunit+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mxunit?hl=en.


David Harris

unread,
Feb 28, 2011, 2:26:52 PM2/28/11
to mxunit
Hi Alex,

Thanks for the suggestion, and yes, the function is returning a
struct.

I tried putting:
debug("here is some debug");

and nothing shows on that either...

I'm using MXUnit 2.0 too.

Cheers,

David


On Mar 1, 8:15 am, Alex Sante <alexandersa...@gmail.com> wrote:
> First thing I would do is make sure your function is ACTUALLY returning
> something and not a null value.
>

Mark Mandel

unread,
Feb 28, 2011, 2:37:09 PM2/28/11
to mxu...@googlegroups.com

If you are running the html runner, you have to explicitly click the debug (bug) icon.

Mark

David Harris

unread,
Feb 28, 2011, 3:52:47 PM2/28/11
to mxunit
Hey Mark,

Thanks for the suggestion, but I'm not using the html runner.

I've created my own runner based on the "mxunit/samples/
SimpleRunSkeleton.cfm" template

Code Below:

------------------------------------------------------------------------------------------

<cfparam name="URL.output" default="extjs">

<cfset dir = expandPath(".")>
<cfoutput><h1>#dir#</h1></cfoutput>

<cfset DTS =
createObject("component","mxunit.runner.DirectoryTestSuite")>
<cfset excludes = "">

<cfinvoke component="#DTS#"
method="run"
directory="#dir#"
recurse="true"
excludes="#excludes#"
returnvariable="Results"
componentpath="unitTests.common.cache">


<cfif NOT StructIsEmpty(DTS.getCatastrophicErrors())>
<cfdump var="#DTS.getCatastrophicErrors()#" expand="false"
label="#StructCount(DTS.getCatastrophicErrors())# Catastrophic
Errors">
</cfif>

<cfsetting showdebugoutput="true">
<cfoutput>#results.getResultsOutput(URL.output)#</cfoutput>

<meta http-equiv="refresh" content="5" />

------------------------------------------------------------------------------------------------------


Is the HTML runner: /mxunit/runner/index.cfm ?
I don't see a debug option there.

Also: MXUnit 2.0.2 , not 2.0 as mentioned before...

Cheers,

David


On Mar 1, 8:37 am, Mark Mandel <mark.man...@gmail.com> wrote:
> If you are running the html runner, you have to explicitly click the debug
> (bug) icon.
>
> Mark

Bob Silverberg

unread,
Feb 28, 2011, 3:59:56 PM2/28/11
to mxu...@googlegroups.com
Try dumping results.getResults() and/or results.getDebug()

Cheers,
Bob

--
Bob Silverberg
www.silverwareconsulting.com

David Harris

unread,
Feb 28, 2011, 4:20:01 PM2/28/11
to mxunit
Hi Bob,

I did that.

The results.getResults() contained an array of structs, and the stucts
did have a "debug" key with the data from my "debug()" calls in them,
which is nice to know it makes it there.

dumping results.getDebug() just returned an empty array.

Maybe the getResultsOutput() function is missing something? - or is it
still something I'm going?

Cheers,

David

Mark Mandel

unread,
Feb 28, 2011, 5:01:41 PM2/28/11
to mxu...@googlegroups.com
I'd have a look at the HTMLRunner - there may be something that needs to be turned on to enable debugging to be recorded.

Mark


Cheers,

David

--
You received this message because you are subscribed to the Google Groups "mxunit" group.
To post to this group, send email to mxu...@googlegroups.com.
To unsubscribe from this group, send email to mxunit+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mxunit?hl=en.




--
E: mark....@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

cf.Objective(ANZ) - Nov 17, 18 - Melbourne Australia
http://www.cfobjective.com.au

Hands-on ColdFusion ORM Training
www.ColdFusionOrmTraining.com

David Harris

unread,
Feb 28, 2011, 5:16:18 PM2/28/11
to mxunit
Ok, I missed the bug on the right...
The URL param "&debug=true" is added and I can see my debug() calls,
so that's all good.

Thankyou all for your help!

On Mar 1, 11:01 am, Mark Mandel <mark.man...@gmail.com> wrote:
> I'd have a look at the HTMLRunner - there may be something that needs to be
> turned on to enable debugging to be recorded.
>
> Mark
>
> On Tue, Mar 1, 2011 at 8:20 AM, David Harris <david.har...@shift.co.nz>wrote:
>
>
>
>
>
>
>
>
>
> > Hi Bob,
>
> > I did that.
>
> > The results.getResults() contained an array of structs, and the stucts
> > did have a "debug" key with the data from my "debug()" calls in them,
> > which is nice to know it makes it there.
>
> > dumping results.getDebug() just returned an empty array.
>
> > Maybe the getResultsOutput() function is missing something? - or is it
> > still something I'm going?
>
> > Cheers,
>
> > David
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "mxunit" group.
> > To post to this group, send email to mxu...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > mxunit+un...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/mxunit?hl=en.
>
> --
> E: mark.man...@gmail.com
Reply all
Reply to author
Forward
0 new messages