Skip to content

Commit 0dedecc

Browse files
Patrick HousleyMylesBorins
Patrick Housley
authored andcommitted
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: #29415 PR-URL: #30033 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Christian Clauss <[email protected]>
1 parent 92fa4e0 commit 0dedecc

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ jstest: build-addons build-js-native-api-tests build-node-api-tests ## Runs addo
300300

301301
.PHONY: tooltest
302302
tooltest:
303-
@$(PYTHON) test/tools/test-js2c.py
303+
@$(PYTHON) -m unittest discover -s ./test/tools
304304

305305
.PHONY: coverage-run-js
306306
coverage-run-js:

test/tools/test_configure.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import sys
2+
import os
3+
import unittest
4+
import subprocess
5+
6+
7+
class ConfigureTests(unittest.TestCase):
8+
def setUp(self):
9+
self.working_dir = os.path.abspath(
10+
os.path.join(
11+
os.path.dirname(__file__),
12+
'..', '..'
13+
)
14+
)
15+
16+
def test_ninja(self):
17+
subprocess.check_call(
18+
'./configure --ninja',
19+
cwd=self.working_dir,
20+
shell=True,
21+
stdout=subprocess.PIPE,
22+
stderr=subprocess.PIPE
23+
)
24+
25+
26+
if (__name__ == '__main__' and
27+
sys.platform in ['linux', 'linux2', 'darwin', 'cygwin']):
28+
29+
unittest.main()
File renamed without changes.

0 commit comments

Comments
 (0)