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 #29415
  • Loading branch information
patrickhousley committed Oct 25, 2019
1 parent d247a8e commit 08b5e13
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
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
@@ -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 08b5e13

Please sign in to comment.