Skip to content

Commit

Permalink
Merge pull request universal-ctags#112 from b4n/units-language
Browse files Browse the repository at this point in the history
units: Add option to only test a specific language
  • Loading branch information
masatake committed Nov 8, 2014
2 parents 139f952 + 9850a65 commit 6be58f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/f-units.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ Example of running
Testing Units/c-sample...Passed
...

Runnig unit tests for a specific language
------------------------------------------------------------

You can run only the tests for a specific language by setting
``UNIT_LANGUAGE`` to a specific parser as reported by
``ctags --list-languages``::

make -f testing.mak test.units UNIT_LANGUAGE=PHP

Gathering test cases for known bugs
------------------------------------------------------------

Expand Down
5 changes: 5 additions & 0 deletions testing.mak
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ TEST_OPTIONS = -nu --c-kinds=+lpx
FUZZ_TIMEOUT=10
# You can specify one of language listed in $(./ctags --list-languages).
FUZZ_LANGUAGE=
UNIT_LANGUAGE=
FUZZ_SRC_DIRS=

DIFF_OPTIONS = -U 0 -I '^!_TAG' --strip-trailing-cr
Expand Down Expand Up @@ -202,6 +203,10 @@ test.units: $(CTAGS_TEST)
name=$${t%.[dbti]}; \
\
if test -n "$(UNIT)" -a "$${name}" != "Units/$(UNIT)"; then continue; fi; \
if test -n "$(UNIT_LANGUAGE)"; then \
l="$$($(UNIT_CTAGS_CMDLINE) --guess-parser "$$input" 2>/dev/null | sed -nr 's/^.*: (.+)$$/\1/p')"; \
test "$$l" = "$(UNIT_LANGUAGE)" || continue; \
fi; \
\
expected="$$t"/expected.tags; \
expectedtmp="$$t"/EXPECTED.TMP; \
Expand Down

0 comments on commit 6be58f6

Please sign in to comment.