Commit Graph

325 Commits

Author SHA1 Message Date
Eli Schwartz b1ddfabf8f
dependencies: defer importing a custom dependency until it is used
This lessens the amount of code imported at Meson startup by mapping
each dependency to a dictionary entry and using a programmable import to
dynamically return it.

Minus 16 files and 6399 lines of code imported at startup.
2023-06-26 13:10:33 -04:00
Nomura 18cfa545f0 Initial support for Metrowerks C/C++ compiler 2023-04-24 09:07:37 -04:00
Josh Soref cf9fd56bc9 fix various spelling issues
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-11 19:21:05 -04:00
Eli Schwartz 5fe7ecb861
tests: make it easier to read overall results in github
Use collapsible sections for cicmds.
2023-04-04 15:06:17 -04:00
Eli Schwartz cfc1abcfaf
project tests: add log of the setup command being run
Followup to commit 2acb6ee79e.
2023-03-20 17:22:50 -04:00
Eli Schwartz 6719724c7c remove pointless, unused typing-only import in the test runner
In the commit that originally added this import, it wasn't even used.
Now the implementation is being moved, so it will fail to work.

I do not know why I originally added it, but it needs to go. :)
2023-02-22 10:32:09 -08:00
Eli Schwartz 115f298361 tests: do not run the deprecated python3 tests unless python is python3
It's broken in e.g. pypy, but that's okay because the module is utterly
deprecated, and people should use the python module instead.
2023-02-13 09:09:10 -05:00
Eli Schwartz 58cfd8fc2c
tests: track when an entire category is skipped and be quieter
There is no need to state for every single test that "preconditions were
not met". And logging the skip reason for a single test is easy to read,
but making every second line alternate is less so.
2023-01-12 15:02:35 -05:00
Eli Schwartz 901dc34ed5
tests: properly log the reason why a test got unexpectedly skipped 2023-01-12 14:56:39 -05:00
Tristan Partin 71cddebf2c
Enable Java project tests on Darwim 2022-12-15 20:36:43 -06:00
Daniele Nicolodi 235f32f1a6 python: Use correct extension filename suffix on Python < 3.8.7
On Windows, in Python version prior to 3.8.7, the `sysconfig` modules
provides an extension filename suffix that disagrees the one returned
by `distutils.sysconfig`. Get the more awesome suffix from the latter
when building for a Python version known to present this issue.

Simplify the extension module filename suffix lookup to use the same
method used by `setuptools`.

Adjust project tests accordingly.

Fixes #10960.
2022-11-23 07:29:23 -05:00
Marvin Scholz 08262c3102 test runner: fix excluding null options
It was impossible to specify null arguments in the exclude array,
while they were passed properly in the code, they were stringified
while the entries in the options array were just completely removed.

To fix this, do not early stringify the argument name and option
together as that would make it impossible to properly match it to
None without introducing a new special case for the string "None".
So instead they are now kept as tuples and only stringified when
its actually needed.
2022-11-22 20:22:04 -05:00
Eli Schwartz 193092e26b
fix deprecated use of meson builddir/ in testsuite 2022-11-17 19:10:51 -05:00
Robert Cohn 1939e567d6 basic support for oneapi compilers 2022-10-24 18:55:22 +03:00
Dylan Baker 369c2660d0 run_project_tests: also change paths for DEPRECATION messages
Not just WARNING and ERROR
2022-08-17 16:25:36 -04:00
Eli Schwartz 3c7ab542c0
deprecate running "meson builddir" without setup subcommand
This is ambiguous, if the build directory has the same name as a
subcommand then we end up running the subcommand. It also means we have
a hard time adding *new* subcommands, because if it is a popular name of
a build directory then suddenly scripts that try to set up a build
directory end up running a subcommand instead.

The fact that we support this at all is a legacy design. Back in the
day, the "meson" program was for setting up a build directory and all
other tools were their own entry points, e.g. `mesontest` or
`mesonconf`. Then in commit fa278f351f we
migrated to the subcommand mechanism. So, for backwards compatibility,
we made those tools print a warning and then invoke `meson <tool>`. We
also made the `meson` tool default to setup.

However, we only warned for the other tools whose entry points were
eventually deleted. We never warned for setup itself, we just continued
to silently default to setup if no tool was provided.

`meson setup` has worked since 0.42, which is 5 years old this week.
It's available essentially everywhere. No one needs to use the old
backwards-compatible invocation method, but it continues to drag down
our ability to innovate. Let's finally do what we should have done a
long time ago, and sunset it.
2022-08-16 17:40:03 -04:00
Dylan Baker 15078112f9 run_project_tests: Don't try to use tqdm when stdout is not a tty
Like when piped to something like less, where tqdm just makes a mess of
the output instead of providing something helpful.
2022-07-06 15:59:47 -04:00
Simon McVittie 65ea833d58 Require CMake 3.14 for all tests that use the cmake module
Older versions are not supported by the cmake module since 0.62.

This avoids having to hard-code the linux-bionic-gcc CI job as being
unable to run these tests, which leaves other older environments like
Debian 10 still trying to run them (and failing).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-10 07:56:59 -04:00
Jussi Pakkanen 3ae36dee42 Limit parallelism to hopefully work on machines with 160 cores. 2022-05-06 16:37:36 -04:00
Eli Schwartz 9b94045170 another day, another mypy update becomes stricter about typing
Move GlobalState to a runtime T.NamedTuple, use it for constructing the
tuple we are passing around rather than expecting mypy to detect that
the one we already have matches.
2022-05-01 13:41:31 +03:00
Matti Picus 73fa3aad43 python module: windows dll name for pypy needs special casing 2022-04-12 06:58:04 -04:00
Eli Schwartz 105bbaabdd
project tests: log the reason why a test is skipped
We expose a reason after the string 'MESON_SKIP_TEST', but it is
actually ignored when running the test, so it is only useful as
documentation and really might as well be a comment.

Make it even more useful by actually printing that string after the
'[SKIPPED]' message.

Also, sometimes a test can be skipped for multiple reasons, and it would
be useful to know which one occurred.
2022-04-03 16:06:33 -04:00
Eli Schwartz ce7a67e511
project tests: do not use tqdm progress bars for a single test
This can happen for example with `--only fpga` as that category has
exactly one test.
2022-04-03 16:06:33 -04:00
Eli Schwartz ff8a9c9efb
move typing-only definition to TYPE_CHECKING 2022-03-29 16:44:54 -04:00
Mark Bolhuis 5a4177523e modules/wayland: Add unstable_wayland module 2022-02-27 14:33:33 -05:00
Eli Schwartz 58c124d48a
project tests: fine-tune the check for whether we are in CI
Follow-up on commit 4274e0f42a. We want to
allow tests to be skipped freely in third-party environments, so this
should check the jobname, not whether $CI exists.

We will anyways raise an error when trying to run the project tests, if
$CI is set but no jobname is set.
2022-02-17 14:48:27 -05:00
Eli Schwartz a580fac83a
tests: allow setting MESON_CI_JOBNAME=thirdparty
This is treated by the test harness as though unset, i.e. we do normal
skipping and don't assume we are running in Meson's own project CI.

However, it has one distinction which is that it isn't an error to set
$CI without setting $MESON_CI_JOBNAME, if it is in fact set but to the
ignored value.

This lets automated workflows such as Linux distro testing, particularly
alpine linux, set $CI or have it set for them by default, without
messing things up.

Also it has the advantage of $CI actually enabling useful benefits! We
will still assume that this thirdparty environment wants to force
verbose logging (printing testlogs, running ninja/samu with -v) and
colorize the console.
2022-02-17 14:48:27 -05:00
Daniel Mensinger 2e2ca5a877 cmake: ci: Skip tests on Ubuntu Bionic where CMake is stuck on 3.10 2022-02-03 11:25:59 -05:00
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