Skip to content

Commit

Permalink
test: test configure ninja
Browse files Browse the repository at this point in the history
- 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: nodejs#29415

PR-URL: nodejs#30033
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Christian Clauss <[email protected]>
  • Loading branch information
patrickhousley authored and Trott committed Nov 6, 2019
1 parent 3b124e0 commit 85dd9e8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ jstest: build-addons build-js-native-api-tests build-node-api-tests ## Runs addo

.PHONY: tooltest
tooltest:
@$(PYTHON) test/tools/test-js2c.py
@$(PYTHON) -m unittest discover -s ./test/tools

.PHONY: coverage-run-js
coverage-run-js:
Expand Down
29 changes: 29 additions & 0 deletions test/tools/test_configure.py
Original file line number Diff line number Diff line change
@@ -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()
File renamed without changes.

0 comments on commit 85dd9e8

Please sign in to comment.