On 13/02/13 15:30, Ben Noordhuis wrote:
> On Wed, Feb 13, 2013 at 3:36 PM, TJ <[email protected]> wrote:urce tree when 
> doing in-tree builds).
>>
>> When run from the Makefile that isn't an issue but before I commit the patch 
>> I would welcome
>> some feedback.
>>
>>
>> diff --git a/test/simple/testcfg.py b/test/simple/testcfg.py
>> index bb2c4d1..5066f70 100644
>> --- a/test/simple/testcfg.py
>> +++ b/test/simple/testcfg.py
>> @@ -46,7 +46,7 @@ class SimpleTestCase(test.TestCase):
>>      self.file = file
>>      self.config = config
>>      self.mode = mode
>> -    self.tmpdir = join(dirname(self.config.root), 'tmp')
>> +    self.tmpdir = join(os.getcwd(), 'test', 'tmp')
>>
>>    def AfterRun(self, result):
>>      # delete the whole tmp dir
> 
> I'm not convinced that's 100% safe or future-proof.  That's not to say
> I know of good alternatives, just that this doesn't seem like the best
> way forward.

I felt the same way. After some research I came up with this. Set an 
environment variable in the
Makefile and have SimpleTestCase use it if found or else use the existing path 
detection. My other
out-of-tree-build patches already introduced $(builddir) into config.mk 
alongside $(srcdir). Until
now I wasn't sure $(builddir) would be needed but it has come in handy.

diff --git a/Makefile b/Makefile
index 51adcd0..b838c2b 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@

 BUILDTYPE ?= Release
 PYTHON ?= python
+override PYTHON := NODE_BUILDDIR=$(builddir) $(PYTHON)
 NINJA ?= ninja
 DESTDIR ?=
 SIGN ?=
diff --git a/test/simple/testcfg.py b/test/simple/testcfg.py
index bb2c4d1..8dec3ae 100644
--- a/test/simple/testcfg.py
+++ b/test/simple/testcfg.py
@@ -46,7 +46,7 @@ class SimpleTestCase(test.TestCase):
     self.file = file
     self.config = config
     self.mode = mode
-    self.tmpdir = join(dirname(self.config.root), 'tmp')
+    self.tmpdir = join(os.getenv('NODE_BUILDDIR', dirname(self.config.root)), 
'test', 'tmp')

   def AfterRun(self, result):
     # delete the whole tmp dir

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to