| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cb16229 commit 1011a17
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -294,6 +294,10 @@ jstest: build-addons build-js-native-api-tests build-node-api-tests ## Runs addo | |||
| 294 | 294 | $(CI_JS_SUITES) \ | |
| 295 | 295 | $(CI_NATIVE_SUITES) | |
| 296 | 296 | ||
| 297 | + .PHONY: tooltest | ||
| 298 | + tooltest: | ||
| 299 | + @$(PYTHON) test/tools/test-js2c.py | ||
| 300 | + | ||
| 297 | 301 | .PHONY: coverage-run-js | |
| 298 | 302 | coverage-run-js: | |
| 299 | 303 | $(RM) -r out/$(BUILDTYPE)/.coverage | |
@@ -311,6 +315,7 @@ test: all ## Runs default tests, linters, and builds docs. | |||
| 311 | 315 | $(MAKE) -s build-node-api-tests | |
| 312 | 316 | $(MAKE) -s cctest | |
| 313 | 317 | $(MAKE) -s jstest | |
| 318 | + $(MAKE) -s tooltest | ||
| 314 | 319 | ||
| 315 | 320 | .PHONY: test-only | |
| 316 | 321 | test-only: all ## For a quick test, does not run linter or build docs. | |
@@ -319,6 +324,7 @@ test-only: all ## For a quick test, does not run linter or build docs. | |||
| 319 | 324 | $(MAKE) build-node-api-tests | |
| 320 | 325 | $(MAKE) cctest | |
| 321 | 326 | $(MAKE) jstest | |
| 327 | + $(MAKE) tooltest | ||
| 322 | 328 | ||
| 323 | 329 | # Used by `make coverage-test` | |
| 324 | 330 | test-cov: all | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,14 @@ | |||
| 1 | + import unittest | ||
| 2 | + import sys, os | ||
| 3 | + sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), | ||
| 4 | + '..', '..', 'tools'))) | ||
| 5 | + from js2c import NormalizeFileName | ||
| 6 | + | ||
| 7 | + class Js2ctest(unittest.TestCase): | ||
| 8 | + def testNormalizeFileName(self): | ||
| 9 | + self.assertEqual(NormalizeFileName('dir/mod.js'), 'mod') | ||
| 10 | + self.assertEqual(NormalizeFileName('deps/mod.js'), 'internal/deps/mod') | ||
| 11 | + self.assertEqual(NormalizeFileName('mod.js'), 'mod') | ||
| 12 | + | ||
| 13 | + if __name__ == '__main__': | ||
| 14 | + unittest.main() | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -261,7 +261,8 @@ def NormalizeFileName(filename): | |||
| 261 | 261 | split = ['internal'] + split | |
| 262 | 262 | else: # `lib/**/*.js` so drop the 'lib' part | |
| 263 | 263 | split = split[1:] | |
| 264 | - filename = '/'.join(split) | ||
| 264 | + if len(split): | ||
| 265 | + filename = '/'.join(split) | ||
| 265 | 266 | return os.path.splitext(filename)[0] | |
| 266 | 267 | ||
| 267 | 268 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments