Last Comment Bug 382682 - Add Makefile target to launch solo xpcshell test for debugging (check-interactive)
: Add Makefile target to launch solo xpcshell test for debugging (check-interac...
Status: RESOLVED FIXED
: dev-doc-complete
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla1.9alpha6
Assigned To: Alex Vincent [:WeirdAl]
:
: Gregory Szorc [:gps]
Mentors:
: 369226 (view as bug list)
Depends on: 384235 384339
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-31 14:12 PDT by Alex Vincent [:WeirdAl]
Modified: 2007-09-20 13:16 PDT (History)
9 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch, v1 (11.49 KB, patch)
2007-05-31 14:12 PDT, Alex Vincent [:WeirdAl]
benjamin: review+
Details | Diff | Splinter Review
patch, v1.1 (11.52 KB, patch)
2007-06-06 11:34 PDT, Rob Campbell [:rc] (:robcee)
no flags Details | Diff | Splinter Review

Description Alex Vincent [:WeirdAl] 2007-05-31 14:12:53 PDT
Created attachment 266805 [details] [diff] [review]
patch, v1

Lately, while working on my xpcshell testcases, I've been thinking:  Wouldn't it be great if I could launch the testcase, load the files, but not execute it?  That way, I could attach a debugger, and step through when I spot something I don't expect.

This patch enables that.
Comment 1 Robert Sayre 2007-05-31 14:27:19 PDT
Comment on attachment 266805 [details] [diff] [review]
patch, v1

I'm psyched for this, but I can't review this. rcampbell is better.
Comment 2 Rob Campbell [:rc] (:robcee) 2007-06-05 10:36:48 PDT
Comment on attachment 266805 [details] [diff] [review]
patch, v1

this looks good to me, but I'd like a second opinion on the rules.mk content before giving it the green-light. bsmedberg, how's your queue?
Comment 3 Benjamin Smedberg [:bsmedberg] 2007-06-05 10:42:23 PDT
Comment on attachment 266805 [details] [diff] [review]
patch, v1

I like the concept but not the rule name. Can we call it check-interactive ?
Comment 4 Rob Campbell [:rc] (:robcee) 2007-06-05 10:44:59 PDT
yeah, I had slight issue with "solo" as well, thinking maybe "single" would be a better choice. "interactive" has a nice ring to it though.
Comment 5 Alex Vincent [:WeirdAl] 2007-06-05 10:53:25 PDT
So let's call it check-interactive.  I'm fine with that too.

robcee, I can't check this in (no CVS account, and not much time today anyway); do you want to make the trivial change and check it in?  I don't see this code requiring sr, as it's strictly for testing/debugging - and not in the build process.

I'll write a blog article about the new feature post-checkin (probably at night).
Comment 6 Rob Campbell [:rc] (:robcee) 2007-06-05 11:58:25 PDT
(In reply to comment #5)
> So let's call it check-interactive.  I'm fine with that too.
> 
> robcee, I can't check this in (no CVS account, and not much time today anyway);
> do you want to make the trivial change and check it in?  I don't see this code
> requiring sr, as it's strictly for testing/debugging - and not in the build
> process.

I'll try to get to this today and get it checked in for you. I'm not entirely sure about not requiring sr in this case as you're touching rules.mk. Ben, what's the word on this?
Comment 7 Benjamin Smedberg [:bsmedberg] 2007-06-05 12:03:38 PDT
r+sr, or whatever the rules are now. The build system has typically been exempt in any case
Comment 8 Rob Campbell [:rc] (:robcee) 2007-06-06 11:34:02 PDT
Created attachment 267463 [details] [diff] [review]
patch, v1.1

Updated to replace check-solo with check-interactive. Built on OSX and ran make check without problems from my objdir. Running make check-interactive from the objdir with no supplied arguments, seems to work, dropping into a js shell, but supplying arguments results in,

..objdir/> make SOLO_FILE=test_import.js -C ../js/src/xpconnect/tests/ check-interactive 

make: *** No rule to make target `check-interactive'.  Stop.

I need help validating this before I can check it in.
Comment 9 Rob Campbell [:rc] (:robcee) 2007-06-06 11:44:41 PDT
with further instructional aid from Alex, we were able to get this running with:

make SOLO_FILE=test_import.js -C js/src/xpconnect/tests/ check-interactive (from in objdir)

I'm going to check this in after reapplying to clean tree.
Comment 10 Rob Campbell [:rc] (:robcee) 2007-06-06 12:45:25 PDT
Checked in. CVS commit logs:

config rob$ cvs -d ":ext:rcampbell%mozilla.com@cvs.mozilla.org:/cvsroot" ci -m "Bug 382682, Add makefile target to launch interactive xpcshell for debugging. Patch by Alex Vincent"
cvs commit: Examining .
cvs commit: Examining Moz
cvs commit: Examining mkdepend
cvs commit: Examining nspr
cvs commit: Examining tests
Checking in rules.mk;
/cvsroot/mozilla/config/rules.mk,v  <--  rules.mk
new revision: 3.556; previous revision: 3.555
done

xpcshell-simple rob$ cvs -d ":ext:rcampbell%mozilla.com@cvs.mozilla.org:/cvsroot" ci -m "Bug 382682, Add makefile target to launch interactive xpcshell for debugging. Patch by Alex Vincent"
cvs commit: Examining .
cvs commit: Examining example
cvs commit: Examining example/unit
RCS file: /cvsroot/mozilla/tools/test-harness/xpcshell-simple/execute_test.js,v
done
Checking in execute_test.js;
/cvsroot/mozilla/tools/test-harness/xpcshell-simple/execute_test.js,v  <--  execute_test.js
initial revision: 1.1
done
Checking in tail.js;
/cvsroot/mozilla/tools/test-harness/xpcshell-simple/tail.js,v  <--  tail.js
new revision: 1.3; previous revision: 1.2
done
Checking in test_all.sh;
/cvsroot/mozilla/tools/test-harness/xpcshell-simple/test_all.sh,v  <--  test_all.sh
new revision: 1.10; previous revision: 1.9
done
RCS file: /cvsroot/mozilla/tools/test-harness/xpcshell-simple/test_one.sh,v
done
Checking in test_one.sh;
/cvsroot/mozilla/tools/test-harness/xpcshell-simple/test_one.sh,v  <--  test_one.sh
initial revision: 1.1
done
Comment 11 Sylvain Pasche 2007-06-07 09:52:56 PDT
*** Bug 369226 has been marked as a duplicate of this bug. ***
Comment 12 Sylvain Pasche 2007-06-07 10:00:09 PDT
I tried to hack on something similar in bug 369226. That's great to see your work on this now checked in :-)

Didn't you felt like factorizing test_all.sh and test_one.sh? That makes lots of duplication.
Comment 13 Alex Vincent [:WeirdAl] 2007-06-07 11:19:49 PDT
I didn't really consider that, to be honest.  I do agree there's duplication here, and the major difference is removing the "2>&1 >$target_js.log" part.  On the other hand, I'm not that strong at shell script hacking.  This was admittedly a quick & dirty solution.

If you want to file a new bug for reducing the duplication and offer a patch, I'm sure people will be interested in reviewing it.
Comment 14 Nickolay_Ponomarev 2007-06-08 07:14:33 PDT
dev-doc-needed: http://developer.mozilla.org/en/docs/Writing_xpcshell-based_unit_tests should be updated
Comment 15 Eric Shepherd [:sheppy] 2007-09-20 13:16:16 PDT
Added note to xpcshell test harness page mentioning the check-interactive mode.

Note You need to log in before you can comment on or make changes to this bug.