summaryrefslogtreecommitdiff
path: root/test/testpy
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2014-10-16 18:43:13 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2014-10-16 22:39:34 +0200
commitedaf7af30bddef699ea68726fedd7a28d1dc999a (patch)
tree067c9a5e5646085b6988cd8bc61de91a99c385b7 /test/testpy
parent5ec2b3fc3d2da83eed34645176c720fb2c4c4969 (diff)
downloadnode-new-edaf7af30bddef699ea68726fedd7a28d1dc999a.tar.gz
test: make test runner multi-arch/mode compatible
Make `python tools/test.py --arch=ia32,x64 --mode=debug,release` work. The test runner looks for the `node` binary in `out/${arch}.${mode}/`. Running tools/test.py without --arch makes it use `out/Release/node` or `out/Debug/node` like before. This commit removes `test/simple/test-executable-path.js` because the assumptions it makes about the locations of the debug and release binaries are now outdated. PR-URL: https://github.com/node-forward/node/pull/24 Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'test/testpy')
-rw-r--r--test/testpy/__init__.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py
index 9593a1f642..cf64ba131c 100644
--- a/test/testpy/__init__.py
+++ b/test/testpy/__init__.py
@@ -41,10 +41,11 @@ FILES_PATTERN = re.compile(r"//\s+Files:(.*)")
class SimpleTestCase(test.TestCase):
- def __init__(self, path, file, mode, context, config, additional=[]):
- super(SimpleTestCase, self).__init__(context, path, mode)
+ def __init__(self, path, file, arch, mode, context, config, additional=[]):
+ super(SimpleTestCase, self).__init__(context, path, arch, mode)
self.file = file
self.config = config
+ self.arch = arch
self.mode = mode
self.tmpdir = join(dirname(self.config.root), 'tmp')
self.additional_flags = additional
@@ -82,7 +83,7 @@ class SimpleTestCase(test.TestCase):
return self.path[-1]
def GetCommand(self):
- result = [self.config.context.GetVm(self.mode)]
+ result = [self.config.context.GetVm(self.arch, self.mode)]
source = open(self.file).read()
flags_match = FLAGS_PATTERN.search(source)
if flags_match:
@@ -117,14 +118,14 @@ class SimpleTestConfiguration(test.TestConfiguration):
return name.startswith('test-') and name.endswith('.js')
return [f[:-3] for f in os.listdir(path) if SelectTest(f)]
- def ListTests(self, current_path, path, mode):
+ def ListTests(self, current_path, path, arch, mode):
all_tests = [current_path + [t] for t in self.Ls(join(self.root))]
result = []
for test in all_tests:
if self.Contains(path, test):
file_path = join(self.root, reduce(join, test[1:], "") + ".js")
- result.append(SimpleTestCase(test, file_path, mode, self.context, self,
- self.additional_flags))
+ result.append(SimpleTestCase(test, file_path, arch, mode, self.context,
+ self, self.additional_flags))
return result
def GetBuildRequirements(self):
@@ -151,7 +152,7 @@ class AddonTestConfiguration(SimpleTestConfiguration):
result.append([subpath, f[:-3]])
return result
- def ListTests(self, current_path, path, mode):
+ def ListTests(self, current_path, path, arch, mode):
all_tests = [current_path + t for t in self.Ls(join(self.root))]
result = []
for test in all_tests: