test: test configure ninja

- Updated the tooltest target to run unittest module
- Renamed test/tools/test-js2c.py to be discoverable by unittest module
- Added test class for `configure` shell script
- Added a test to ensure `configure` script exits with status code zero
when passed the `--ninja` flag

Closes: https://github.com/nodejs/node/issues/29415

PR-URL: https://github.com/nodejs/node/pull/30033
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
This commit is contained in:
Patrick Housley
2019-10-18 18:01:59 -05:00
committed by Rich Trott
parent 3b124e0a73
commit 85dd9e8333
3 changed files with 30 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
import sys
import os
import unittest
import subprocess
class ConfigureTests(unittest.TestCase):
def setUp(self):
self.working_dir = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
'..', '..'
)
)
def test_ninja(self):
subprocess.check_call(
'./configure --ninja',
cwd=self.working_dir,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
if (__name__ == '__main__' and
sys.platform in ['linux', 'linux2', 'darwin', 'cygwin']):
unittest.main()