Commit Graph

297 Commits

Author SHA1 Message Date
Eli Schwartz 751f84405e
pyupgrade --py37-plus 2022-01-10 18:36:56 -05:00
Daniel Mensinger c5ce9744b2 Fix mypy errors 2021-12-17 14:00:28 -05:00
Xavier Claessens 928078982c Add --vsenv command line option and active VS only when needed 2021-10-10 23:15:18 +03:00
Eli Schwartz e8a85fa8a2
various python neatness cleanups
All changes were created by running

"pyupgrade --py3-only"

and committing the results. Although this has been performed in the
past, newer versions of pyupgrade can automatically catch more
opportunities, notably list comprehensions can use generators instead,
in the following cases:
- unpacking into function arguments as function(*generator)
- unpacking into assignments of the form x, y = generator
- as the argument to some builtin functions such as min/max/sorted

Also catch a few creeping cases of new code added using older styles.
2021-10-04 16:29:30 -04:00
Christian Clauss d5b0673079 Fix typos 2021-09-30 14:11:54 -07:00
Mat Cross 174bc1c786 Presence of nagfor signifies that Fortran tests can be run. 2021-09-10 16:08:57 -04:00
Xavier Claessens 0063eb251e python: Workaround broken install path 2021-08-22 22:14:59 -04:00
Eli Schwartz 44e123dd90
test runner: add the ability to configure test.json for python paths
Adds new installed file types with @VAR@ substitution.
2021-08-18 17:58:30 -04:00
Nirbheek Chauhan 1799658614 Revert "Disable Rust + clangcl."
This reverts commit 6c55fc5cb0
2021-08-17 19:58:23 -07:00
Nirbheek Chauhan 339c768862 Revert "Disable vs2017 + 32bit Rust combo as it is broken."
This reverts commit 75688240cf

Should've been fixed by c95bffb295
2021-08-18 05:43:39 +05:30
Eli Schwartz 00bfbcbfa2 tests: make detecting broken compilers always run without tracebacks
Fixes regression in commit 75688240cf.
Even though this function is *currently* only invoked on Windows, these
environment variables may not actually exist -- and apparently don't in
at least the "UnusedMissingReturn / windows" test run, which... did not
get triggered by that commit, since it only edited the testsuite runner,
not any test cases. \o/
2021-08-15 11:35:44 +03:00
Jussi Pakkanen 6c55fc5cb0 Disable Rust + clangcl. 2021-08-15 03:06:01 +03:00
Jussi Pakkanen 75688240cf Disable vs2017 + 32bit Rust combo as it is broken. 2021-08-15 00:31:18 +03:00
Jussi Pakkanen 8c0c92e1a6 Allow gettext test to skip on macOS. 2021-08-12 23:25:33 +03:00
Jussi Pakkanen 61ec215860 Remove workaround now that we have a new Ninja. 2021-07-25 21:33:18 +03:00
Jon Turney 3c81ff8f00
Make it an error if MESON_CI_JOBNAME isn't set under CI
Also check skip is as expected for CI all runs, not just those that set
MESON_CI_JOBNAME.
2021-07-13 15:26:08 +01:00
Jon Turney b20cfec4bc Use None as Environment object build_dir in detect_system_compiler()
The Environment object constructor accepts None as build_dir (for quite
a while now), so don't bother with creating a temporary directory for
use as the build_dir, if we're not going to need it.

Future work: Environment.__init__() sets scratch_dir to '' if build_dir
is None, which seems a little wonky, as it isn't a path.
2021-07-07 20:08:12 +02:00
Jon Turney 609864a66d Annotate framework tests with where they are expected to skip
Remove hard-coded framework test skip logic in skippable(), instead
annotate test.json with environments in which skip is expected.

(Mainly this is done with by testing the value of MESON_CI_JOBNAME now
set for linux jobs)
2021-07-07 20:08:12 +02:00
Jon Turney c78e6cac80 Allow `skip_*` test.json keys at top-level or in `matrix:` 2021-07-07 20:08:12 +02:00
Jon Turney a2e44296c9 Add `skip_on_os` to test.json 2021-07-07 20:08:12 +02:00
Jon Turney 7126fbaf81 Add `skip_on_jobname` to test.json
Plan to replace the hard-coded list of 'may be skipped' framework tests in
skippable() with annotations in test.json which record 'will be skipped
in these specific CI jobs'.

If the value of the MESON_CI_JOBNAME env var (an arbitrary string
expected to be unique for each CI configuration) contains any of the
strings in the `skip_on_jobname` key in test.json, the test is expected
to output MESON_SKIP_TEST.

Unexpected skips or runs are treated as an error.

Future work: Maybe we should add additional count categories 'unexpected
skip' and 'unexpected not skipped', rather than counting those as 'skipped'
and 'failed', respectively.
2021-07-07 20:08:12 +02:00
Jon Turney 6bf86f4783 Drop non-framework test names from skippable()
In all these cases, the test has already been determined as skippable
because it's not part of the 'frameworks' suite.
2021-07-07 20:08:12 +02:00
Eli Schwartz c4f5f6364e pyupgrade 2021-07-05 17:55:04 +03:00
Daniel Mensinger 3e396b3782
fix: Always explicitly set encoding for text files (fixes #8263) 2021-06-29 11:28:08 +02:00
Daniel Mensinger 28175bbee2
pathlib: Patch pathlib to work around some bugs (fixes #7295) 2021-06-29 11:28:08 +02:00
Daniel Mensinger 3f889606c7 Split compiler detection from Environment
This moves all the compiler detection logic into the new
compilers.detect module. This dramatically reduces the size
and complexity of Environment.
2021-06-25 19:34:48 +02:00
Jon Turney bee4dc9f78 Fix project tests category name used in skippable() and XML output
Since 25df6e7d split the iteration over tests to start them from the
iteration to collect their results, the variable 'name' is only being
set in the first iteratiorn, so all tests are treated as being in the
last test category read (probably 'wasm') for skipppable() and in the
XML output.

Store the category name in the TestDef object
Use it in skippable()
Use it in classname attribute of XML test results
2021-06-22 16:23:09 +02:00
Daniel Mensinger b2112bc4f6 tests: Always enable the traceback in run_project_tests.py 2021-06-18 23:48:33 +02:00
Daniel Mensinger 10afec575b tests: Add visual seperator to the test logs in run_project_tests.py 2021-06-18 23:48:33 +02:00
Jon Turney 636bf91586 CI: Split out file format test as a separate GitHub workflow
Split out checking of file format as a separate GitHub workflow, rather
than running it as part of the project tests for every platform and
toolchain combination in CI, so that this test is not effected by the
changed paths constraints which are applied to the project tests.
2021-06-11 15:28:07 +02:00
Daniel Mensinger e987a88c19 tests: Force colorize CI output 2021-06-09 13:25:36 +02:00
Daniel Mensinger 7fac515acf tests: Don't even start running skipped tests 2021-06-09 13:25:36 +02:00
Daniel Mensinger 30ff36dc91 tests: Fix global state issue 2021-06-09 13:25:36 +02:00
Daniel Mensinger 0aa8843fb2 tests: Add option to limit the number of workers
Also, increase the minimum ammount of workers from 1 to
2 when the core count can not be determined.
2021-06-09 13:25:36 +02:00
Daniel Mensinger 098e3f9994 tests: Optional progress bar with tqdm 2021-06-09 13:25:36 +02:00
Daniel Mensinger 25df6e7d16 tests: Refactored test runner 2021-06-09 13:25:36 +02:00
Daniel Mensinger e1708d3de9 tests: Reduce complexity of the run_tests signature 2021-06-09 13:25:36 +02:00
Daniel Mensinger 99d3897caf tests: reduce global variables 2021-06-09 13:25:36 +02:00
Daniel Mensinger 7fc755b334 typing: Fully annotate run_project_tests.py 2021-06-09 13:25:36 +02:00
Dylan Baker 74ed27f776 cython: add 1 basic test 2021-06-07 09:17:40 -07:00
Jussi Pakkanen 0b2a7300c0 Set up VS environment automatically when run. 2021-05-13 11:03:10 +03:00
Ralf Gommers 9bbf2dd07c Add validation for --only in `run_project_tests.py`
This now gives a clear error rather than silently passes for
unrecognized categories, like:

    python run_project_tests.py --only nonexisting

or

    python run_project_tests.py --only objc  # should be 'objective c'
2021-05-02 22:27:40 +03:00
Jussi Pakkanen 54767ab482
Merge pull request #8568 from dcbaker/submit/qt-dependency-factory
QT: use a proper dependency factory
2021-03-24 22:52:15 +02:00
Dylan Baker 1767c57492 run_project_tests: add annotations 2021-03-23 15:28:08 -07:00
Dylan Baker 54c55f77a9 run_project_tests.py: Allow qt tests to skip on !macOS
We don't always have qmake installed (and it's good to test failure
paths too!) so we can't expect this to succeed in all cases. With the
following commit we'll use a test.json to test both pkg-config and
qmake, so we need to be able to skip.
2021-03-23 15:28:08 -07:00
Xavier Claessens 66d62a224e test.json: Add support for not matching stdout lines
By default expected line must be matched in order. When an expected line
is matched it does not matter if it's matched again later or not.

When defining "count", it means that line must be matched exactly that
many times before matching the next expected line. Once all occurences
have been matched for an expected line, it not must appear any more in
all next lines.
2021-03-23 18:07:18 -04:00
Xavier Claessens d0d81ab84e run_project_tests.py: Allow "--only common/240" syntax 2021-03-23 18:07:18 -04:00
Jussi Pakkanen ecd8c7e4af Update VS module version check. 2021-03-16 21:06:51 +02:00
Jussi Pakkanen 3ac3e125e4 Delete leftover files from some tests. 2021-03-16 16:37:02 +02:00
Eli Schwartz 6a0fabc647
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04 17:16:11 -05:00