Commit Graph

30 Commits

Author SHA1 Message Date
Hamish Knight
74dd4dcb1b Enable colors in FileCheck and Swift tests
If we're attached to a tty, pass `--color` to
FileCheck and `--color-diagnostics` to Swift
invocations in tests.
2024-02-09 16:47:03 +00:00
Artem Chikin
73b01dccfc Remove incremental builds from the Legacy driver
The C++-based driver is deprecated and this will help reduce the code surface that requires maintenance as the legacy driver is fully sunset.
2024-01-16 16:34:51 -08:00
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
Artem Chikin
ae2e856f9b Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
This reverts commit 937e1a365c, reversing
changes made to a5440a8abd.
2021-04-28 15:11:36 -07:00
Artem Chikin
1e44ed00eb Revert "Always build SwiftDriver and use it as default compiler driver" 2021-04-28 11:20:21 -07:00
Artem Chikin
c2dc8e3d07 Always build (and use) the new SwiftDriver as the default compiler driver.
This will make sure that compiler developers are using the new driver when they build the compiler locally and use it.

- Adds a new build-script product category: before_build_script_impl for products we wish to build before the impl products.
- Adds a new EarlySwiftDriver product to that category, which gets built with the host toolchain.
- Adds an escape hatch: --skip-early-swift-driver
- Adjusts the swift CMake configuration with an additional step: swift_create_early_driver_symlinks which (if one was built) creates symlinks in the swift build bin directory to the EarlySwiftDriver swift-driver and swift-help executables.
- Adds a new test subset : only_early_swiftdriver, which will get built into a corresponding CMake test target: check-swift-only_early_swiftdriver-* which runs a small subset of driver-related tests against the Early SwiftDriver.
  - This subset is run always when the compiler itself is tested (--test is specified)
  - With an escape disable-switch: --skip-test-early-swift-driver
  - All tests outside of only_early_swiftdriver are forced to run using the legacy C++ driver (to ensure it gets tested, still).

NOTE: SwiftDriver product (no 'Early') is still the main product used to build the driver for toolchain installation into and for executing the product's own tests. This change does not affect that.
2021-04-26 12:17:32 -07:00
Artem Chikin
65799c4e3e Set run-test script to be a python3 script 2021-03-30 13:27:11 -07:00
omochimetaru
081ffaa8d5 [run-test] add --build-jobs option 2020-04-12 08:43:55 +09:00
Dmitri Gribenko
9f3a6cdeef utils/run-test: added lit's --filter option
Added a pass through of lit's `--filter` option to utils/run-test, to
allow running a subset of tests, for example `./utils/run-test
--filter=irgen` runs tests in `test/IRGen` and any other test with
"irgen" in its name.
2020-04-07 16:28:03 +02:00
Ross Bayer
e793fcf052 [Build System: build-script] Moved SWIFT_SOURCE_ROOT, SWIFT_BUILD_ROOT and SWIFT_REPO_NAME along with other project path constants into a new build_swift.constants module. 2020-02-11 12:46:03 -08:00
Daniel Rodríguez Troitiño
e112581f76 [run-test] Fix --target and --param parsing.
For argparse, the type value of each argument must be a callable. The previous type was simply pointing to the class that implements the callable, and not to an instance of it.

This should recover the previous functionality for the --target and the --param arguments.

Seems that this is already applied in the build-script, so no changes are necessary there.
2020-02-04 08:31:17 -08:00
Rintaro Ishizaki
51e7f8a628 [run-test] Update run-test for recent changes 2020-01-18 21:46:57 -08:00
Ross Bayer
31f063b8b8 [Build System: build-script] Remove the old arguments module hiding in swift_build_support in favor of the more featureful one living in build_swift. 2020-01-17 00:30:17 -08:00
YOCKOW
90a33fa32c [run-test] Change default path for "lit.py" executable.
Since 1b4b7f9e17 has been committed, `update-checkout` clones "llvm-project" repo but does not clone "llvm" repo itself alone by default.
That may cause `run-test` failure because "lit.py" cannot be found.
This commit fixes the issue.
2019-12-17 14:40:37 +09:00
Daniel Rodríguez Troitiño
a90a4d03ec [test] Modify run-test to allow unified LLVM builds
The unified LLVM builds use a slightly different structure than the
Swift standalone builds. Modify the run-test utility tool to allow using
it in both standalone and unified builds.
2019-11-15 17:24:38 -08:00
Alex Hoppen
932525d762 [gardening] Fix several python-lint warnings 2019-10-29 10:40:20 -07:00
Alex Hoppen
776e2c0030 Revert "Migrate building SwiftSyntax to swift_build_support" 2019-10-29 09:55:32 -07:00
Alex Hoppen
46501b881f [gardening] Fix several python-lint warnings 2019-10-25 15:58:07 -07:00
Daniel Rodríguez Troitiño
9cec482ef3 [android] Allow executing only Android compiler tests.
The manipulation of host-test and skip-android-host was a little
different than the equivalent skip-ios-host and similar variables. These
changes make them closer and allows executing only the compiler tests,
but skip the test that need an Android device to run.

- Disables the upload command of the tests if the subset is the
  non-executable tests. The non-executable test do not need to be
  uploaded, and in the case of Android, a device doesn't need to be
  connected, so trying to connect to one will fail.
- Fix a problem where the swift_interpreter feature was removed without
  first checking if it was really added.
- Only enable the host tests (the compiler tests) in the Android CI
  preset (there's no device attached to that server, but currently only
  the Linux tests were being executed, which doesn't make a lot of
  sense).
- Move the decision about which platform support device/host tests into
  the platform themselves, which allows Android to have device/host
  tests. Also modify a little bit the logic around enabling/disabling
  the test suite to allow running only the host tests of a platform.
- Fix the suffix name for the target of non-executable tests in a couple
  of places.
2019-03-22 14:43:00 -07:00
David Zarzycki
283713d61d [Testing] Formalize stress tests
Stress tests are, by definition, stressful. They intentionally burn a
lot of resources by using randomness to hopefully surface state machine
bugs. Additionally, many stress tests are multi-threaded these days and
they may attempt to use all of the available CPUs to better uncover
bugs. In isolation, this is not a problem, but the test suite as a whole
assumes that individual tests are single threaded and therefore running
multiple stress tests at once can quickly spiral out of control.

This change formalizes stress tests and then treats them like long
tests, i.e. tested via 'check-swift-all' and otherwise opt-in.

Finally, with this change, the CI build bots might need to change if
they are still only testing 'validation' instead of all of the tests.
I see three options:

1) Run all of the tests. -- There are very few long tests left these
   days, and the additional costs seems small relative to the cost of
   the whole validation test suite before this change.
2) Continue checking 'validation', now sans stress tests.
3) Check 'validation', *then* the stress tests. If the former doesn't
   pass, then there is no point in the latter, and by running the stress
   tests separately, they stand a better chance of uncovering bugs and
   not overwhelming build bot resources.
2018-03-20 21:45:28 -04:00
Hugh Bellamy
36645a0976 Address FIXMES for cleaning up imports in build-script and friends 2017-04-01 09:54:01 +07:00
Dave Abrahams
f95133070e Merge pull request #8261 from natecook1000/nc-runtest-msg
[utils] Add message when run-test is run w/o args
2017-03-25 16:37:01 -07:00
Nate Cook
73d7d4f7c4 [utils] Add message when run-test is run w/o args 2017-03-21 22:37:20 -07:00
Hugh Bellamy
c6fcbf0510 Python lint a bunch of files not currently python linted 2017-03-17 14:11:00 +07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Rintaro Ishizaki
8e1095bdf4 [util] Remove --merge-coverage option from run-test 2016-09-02 13:58:03 +09:00
Michael Gottesman
11b894d195 [gardening] Fix some flake8 failures. 2016-06-21 21:13:02 -07:00
practicalswift
05c26537ff [gardening] Fix typos in recently introduced file utils/run-test 2016-06-21 19:10:13 +02:00
rintaro ishizaki
2b9a8dc477 [test] Added utils/run-test, a small utility to run tests for Swift
usage:
utils/run-test --build-dir <build_dir> <path_to_test> [<path_to_test> ...]
2016-06-21 21:01:08 +09:00