24 Commits

Author SHA1 Message Date
Cosimo Lupo
83f79bc2f4 run-tests.sh: use python setup.py test so that pytest is bootstrapped automatically with tests_require 2016-09-27 13:55:56 +01:00
Cosimo Lupo
51d335c0dc Revert "remove 'run-tests.sh'"
This reverts commit ac7fca7141f4bc81774f97496fda958152aaa3c6.

As the old saying goes, a shell script is worth a thousand words...
2016-08-20 01:20:19 +01:00
Cosimo Lupo
ac7fca7141 remove 'run-tests.sh' as unnecessary; just run tox or py.test
To run tox on specific versions of python, you can use the -e option:
$ tox -e py27
$ tox -e py35

To only run tests which match the given substring expression, use
py.test -k option. Do `py.test -h` for more info.
2016-08-19 11:38:58 +01:00
Cosimo Lupo
41dff8456e [run-test.sh] use pytest to collect tests
This way test discovery will work not only with the current unittest and doctest modules, but also with pytest's own kind of tests.

When run with no argument, the shell script will call the py.test command, which will scan the whole Lib/fontTools directory for all relevant tests.

If args are provided, tests are filtered if any of the substrings specified
match. The filtering works not only on the modules' file names (as the previous grep approach), but also on the names of the test functions, classes and methods. Pretty cool, huh?

We can still specify whether to run pytest with python -2 or -3 (provided pytest is installed on both Python versions).
And we don't need to print the python version any more as pytest does it for us.
Finally, there's no need to export PYTHONPATH -- pytest takes care of that too!
2016-02-07 01:03:39 +00:00
Cosimo Lupo
3a537be111 [run-test.sh] fix an issue when calling sys.executable with subprocess in py23_test.py 2016-01-25 18:25:07 +00:00
Cosimo Lupo
499c36fc87 run-test.sh: exit immediately if any subcommands return non-zero value 2015-12-11 16:10:51 +00:00
Behdad Esfahbod
587c0cd142 Revert "Revert "[run-test.sh] echo selected python interpreter version""
This reverts commit 551f9506b308697bea8d2c5597e1a853fac151f6.

Nice thing to have
2015-08-20 11:36:09 +01:00
Cosimo Lupo
551f9506b3 Revert "[run-test.sh] echo selected python interpreter version"
This reverts commit 8135df3fe9afc7eca6f9c75fbd271aec9ff24213.
2015-08-20 01:26:37 +01:00
Cosimo Lupo
8135df3fe9 [run-test.sh] echo selected python interpreter version 2015-08-19 23:46:27 +01:00
Behdad Esfahbod
19f361b97c Support running run-tests.sh from other directories
We'll see if this works with the bare /bin/sh's of TravisCI...
2015-04-25 15:55:45 -07:00
Behdad Esfahbod
801dcf21d6 Report failing modules 2015-04-21 11:06:56 -07:00
Behdad Esfahbod
95e2db7e47 Another try to fix TravisCI
Apparently the problem was with the first shift, not with the loop:
749eb3de80 (commitcomment-10792844)
2015-04-19 12:04:47 -07:00
Behdad Esfahbod
ecbe88cf17 Try fixing the build 2015-04-19 11:53:35 -07:00
Behdad Esfahbod
749eb3de80 Process all arguments to run-tests.sh as filters 2015-04-19 04:56:08 -07:00
Behdad Esfahbod
6fe84c7f74 Add -2 and -3 to run-tests.sh to choose Python 2 / 3 2015-04-15 17:41:12 -07:00
Behdad Esfahbod
73031d5a63 Allow overriding python for running tests, as well choosing tests
The first arg to run-tests.sh is used as a regex to narrow down
tests to run.  We should extend this to consider all args as
regexes.

Eg:

  ./run-tests.sh xml
2015-04-14 19:19:05 -07:00
Behdad Esfahbod
80758953ff Allow running test suite without git checkout
Should I prefer the git-grep if .git/ is available?
2015-04-14 19:11:25 -07:00
Sascha Brawer
2ac42ad3ec Support unittests in addition to doctests
The Python libraries come with two ways of writing unittests:
module unittest, and module doctest. In some cases, unittest
is more natural (less cumbersome) than doctest.

Wrote tests on xmlWriter for illustration.
2015-04-14 17:52:17 -07:00
Behdad Esfahbod
da900f656c Run module tests as modules 2015-04-07 18:27:23 -07:00
Behdad Esfahbod
e5b78aa212 Fix run-tests.sh to run on dash
$(()) is more portable than let, who knew...
2015-03-03 11:31:22 -08:00
Behdad Esfahbod
47cd66e43b Make run-tests.sh call doctest module directly
This makes it fail correctly.  Also, run doctest in verbose mode.
2015-03-03 10:47:20 -08:00
Behdad Esfahbod
f439e7b07d Really fix test runner this time
Still doesn't work as we don't return failure from the Python fails
if doctests fail.  But the test runner script is correct now.
2015-03-03 10:39:55 -08:00
Behdad Esfahbod
a0befdc025 Make run-tests.sh fail if any tests failed! 2015-03-03 10:16:01 -08:00
Behdad Esfahbod
f192400039 Fix checks; add run-tests.sh 2015-03-03 09:57:41 -08:00