Commit Graph

67 Commits

Author SHA1 Message Date
Norio Nomura
af8ce9c1b5 Enable SourceKit tests if build SourceKit 2017-04-02 09:16:45 +09:00
David Farler
3645736ac0 Merge pull request #7393 from bitjammer/syntax-tree
Start the Syntax structured editing library
2017-02-17 15:26:00 -08:00
David Farler
71346dc5c1 [Syntax] Add round-trip syntax test driver and stdlib roundtrip test 2017-02-17 12:57:04 -08:00
Hugh Bellamy
2b1c5efe4b [CMake] remove redundant USES_TERMINAL checks
The minimum version of CMake is 3.4.3
2017-02-17 14:33:42 +07:00
Hugh Bellamy
caa42a7728 Remove unecessary check for PYTHONINTERP_FOUD in tests 2017-02-12 10:42:11 +07:00
Mishal Shah
4c4ec2065a Increase the test timeout to 50mins 2017-02-02 14:44:36 -08:00
Max Moiseev
6b97421a97 [test] Increasing test timeout to 30 minutes
Array tests take longer on the simulator and constantly time out.
The proper solution would be to split the Arrays.swift.gyb into
multiple, though.

<rdar://problem/30250367>
2017-01-30 12:14:14 -08:00
Saleem Abdulrasool
375bbd06ae build: add dependency on sil-llvm-gen for tests
sil-llvm-gen/alloc.sil uses this tool during tests, but was missing a
dependency.  `ninja -t clean; ninja check-swift` would fail as a result.
2017-01-28 09:33:16 -08:00
Mishal Shah
36d60dfe2c Merge pull request #5830 from jrose-apple/lit-timeout
[test] Time out individual lit tests after 20 minutes.
2017-01-27 12:41:44 -08:00
Michael Gottesman
bf4864bc88 [sil-bug-reducer] Create the sil-passpipeline-dumper tool.
This enables one to dump the various passpipelines in a yaml format. Other
pretty print formats can be added in the future as well if desired. Its intended
usage is to provide a source of pass pipeline information for external python
bug-reducing tools. By integrating this as a compiler-tool, we are guaranteed to
never have to update any of these tools in the face of passpipeline changes.
2016-12-12 15:07:56 -08:00
Saleem Abdulrasool
2c648ccaab build: add a test dep on sil-nm 2016-12-10 20:00:35 -08:00
Bob Wilson
14428834c4 Update some more sil-extract references to the new sil-func-extractor name
Michael renamed this tool and forgot to update these places where the old
name was used.
2016-12-08 21:55:27 -08:00
Jordan Rose
06843ea940 [test] Time out individual lit tests after 20 minutes.
...if the Python 'psutil' module is installed.

We have no individual tests that take longer than 20 minutes, and
having lit provide the timeout will be a better experience than having
a buildbot kill the whole job.
2016-11-17 16:28:33 -08:00
Doug Coleman
5c12506e32 [cmake]: Second try at making swift-api-digester work correctly.
Note: I ran into an issue compiling on Linux with STL 4.8 headers where
STL vector needs an iterator instead of a ``const_iterator``. Hopefully this will
not show on the CI machines.

http://stackoverflow.com/questions/19559235/missing-const-iterator-overload-of-stdvectorerase-with-g-4-8
2016-10-28 16:35:19 -06:00
Mishal Shah
9c9d34f8fb Revert "[cmake]: Ensure that swift-api-digester rebuilds before tests are run." 2016-10-28 02:58:44 -07:00
Doug Coleman
5dfcf96908 [cmake]: Ensure that swift-api-digester rebuilds before tests are run.
Fixes rdar://problem/28953348
2016-10-27 17:22:22 -07:00
Luke Larson
9fa4232c6d [coverage] Fix relative coverage path 2016-09-28 22:33:30 -07:00
Chris Bieneman
b0e3b7c2a5 [CMake] Add missing LLVM & Clang tools to check-swift dependencies
This only impacts non-standalone builds, and it results in all the tools used during check-swift being built before the lit tests execute.
2016-09-23 11:02:17 -07:00
Luke Larson
573a58cacd [coverage] Add scripts supporting specific coverage
The three included Python scripts work together to generate a sqlite3
database containing mappings of all covered Swift source code regions to
the specific tests that cover them.

Additionally, build-script support is included for utilizing the
coverage database to prioritize tests covering changes in the Swift
repository.
2016-09-14 15:14:01 -07:00
Max Moiseev
b893f8ca9e [test] Using lit incremental mode for by default
The incremental mode orders test by the last time modified, instead of
by the path, it also touches the files for failed tests, in order for
them to be prioritized on the next run. Using this mode as the default
improves both the CI and local development experience: CI builds
triggered by the commit, that includes changes to the tests, will run
those tests first; locally, it makes a lot of sense to run previously
failed tests first to make sure they've been fixed.
2016-09-01 16:47:14 -07:00
Dmitri Gribenko
1d6b08ba97 stdlib: share the Unicode dataset across different test files 2016-08-07 23:29:24 -07:00
Saleem Abdulrasool
5e170ebcb5 build: support cross-compiling to windows 2016-07-13 21:37:04 -07:00
Michael Gottesman
51af90bc8e [cmake] Rename SWIFT_BUILD_TOOLS => SWIFT_INCLUDE_TOOLS
In LLVM, the convention is that *_INCLUDE_* means that cmake will generate
targets but says nothing about whether or not something will be built by default
or not. This means that as far as cmake is concerned, those targets do not
exist.

On the other hand, *_BUILD_* determines whether or not a class of things is a
dependency of the "all" target. Of course this implies that *_BUILD_* implies
that *_INCLUDE_* must be set to TRUE.

Currently SWIFT_BUILD_TOOLS is implemented like a *_INCLUDE_* option, so change
its name to SWIFT_INCLUDE_TOOLS.
2016-07-12 21:08:55 -07:00
Harlan
1625d97976 Switch to llvm-profdata's pooled profdata merge (#3281) 2016-07-01 16:45:21 -07:00
Brian Gesiak
6c053decd5 [Android] Specify default device deploy path
When the "--android-deploy-device-path" option was first added,
build products would only be deployed to a connected Android device
if the option was specified. Now, we use `command_upload_stdlib`
to upload every time the Android tests are being run.

As a result, running the test suite for Android without specifying
a deploy path leads to a subtle error, in which the
`command_upload_stdlib` CMake command fails. End users may find this
difficult to debug.

Add a default argument to the deployment path, and check for a valid
path before executing the CMake command.
2016-06-24 08:53:07 -07:00
Michael Gottesman
98db2cbca9 [cmake] Do not use LLVM's configure_lit_site_cfg to configure out lit config.
We do not use any variables in our lit.site.cfg.in files that are not already
set at this point in the configuration. So all calling this function does is
create some variables that are not used and then calls configure.

This commit just removes the call to the function and calls configure directly.
This simplifies the code (we are not calling into llvm) and reduces exposure to
llvm internals changing.

rdar://26154980
2016-06-22 04:31:43 -07:00
Rintaro Ishizaki
93f22b647d [test] Add upload-stdlib-{variant} target
So that we can easily invoke manual testing:

cmake --build ${SWIFT_BUILD_DIR} -- upload-stdlib-{variant}
python ${LLVM_SOURCE_DIR}/utils/lit/lit.py -sv ${TEST_PATH}
2016-06-20 13:38:51 +09:00
Mishal Shah
87b7bcfd3e Update master to build with Xcode 8 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-06-14 14:53:55 -07:00
Brian Gesiak
ee51b7a6f6 [Android] Add testing support
This adds support for running tests for the stdlib built
for Android, both on the host machine and on an Android device.

The Android variant of Swift may be built and tested using
the following `build-script` invocation:

```
$ utils/build-script \
  -R \                                           # Build in ReleaseAssert mode.
  -T \                                           # Run all tests.
  --android \                                    # Build for Android.
  --android-deploy-device-path /data/local/tmp \ # Temporary directory on the device where Android tests are run.
  --android-ndk ~/android-ndk-r10e \             # Path to an Android NDK.
  --android-ndk-version 21 \
  --android-icu-uc ~/libicu-android/armeabi-v7a/libicuuc.so \
  --android-icu-uc-include ~/libicu-android/armeabi-v7a/icu/source/common \
  --android-icu-i18n ~/libicu-android/armeabi-v7a/libicui18n.so \
  --android-icu-i18n-include ~/libicu-android/armeabi-v7a/icu/source/i18n/
```

See docs/Testing.rst for more details.
2016-06-09 13:03:28 -04:00
Dmitri Gribenko
a30f90c965 CMake: move tricky code from CMake to Python
Removing an abstraction boundary also allowed me to fix a bug where we
could not run long tests in optimized mode, which prevented us from
being able to mark executable tests as long.
2016-06-06 01:02:03 -07:00
Dmitri Gribenko
96c6023d23 CMake: fix a bug where only_validation-only_non_executable test configuration was running all tests
A nested loop was adding arguments specific to the current iteration to
a variable, where the arguments persisted into the next iteration.

The issue only affected the only_validation-only_non_executable
configuration, here's why.  The test subsets were configured in the
following order: primary, validation, all, only_validation, only_long.
The first three were not adding new arguments.  'all' was adding
arguments that were affecting 'only_validation'.  Then 'only_long' was
adding an argument of its own that was overriding the argument from
'all'.
2016-05-31 00:53:33 -07:00
rintaro ishizaki
e65d8c4db5 [Coverage] Get 'analyze-code-coverage=merged' to work.
Set profdata_merge command after test_results_dir is initialized.
2016-04-29 10:25:27 +09:00
Dmitri Gribenko
6b48e6152a build-script: run all tests in check-swift-all-* targets, including long tests 2016-04-25 14:56:09 -07:00
John McCall
f8fcd0ce11 Implement the RemoteAST test harness and add some skeletal tests. 2016-04-21 16:25:19 -07:00
Dmitri Gribenko
265fa20ce1 CMake: re-add primary testsuite to the validation target
You can run just the validation tests using the 'only_validation'
target.
2016-04-19 11:43:39 -07:00
Dmitri Gribenko
457f2b901c CMake & build-script: add a new tier of testing, "long tests"
* The behavior of `build-script -t` is unchanged.

* `build-script -T` continues to run primary and validation test suite,
  but without the long tests.

* `build-script --long-test` runs just the long tests.

* `build-script -T --long-test` runs all tests.
2016-04-16 14:03:54 -07:00
Zhuowei Zhang
7c502b6344 Port to Android
This adds an Android target for the stdlib. It is also the first
example of cross-compiling outside of Darwin.

Mailing list discussions:

1. https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151207/000171.html
2. https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000492.html

The Android variant of Swift may be built using the following `build-script`
invocation:

```
$ utils/build-script \
  -R \                                           # Build in ReleaseAssert mode.
  --android \                                    # Build for Android.
  --android-ndk ~/android-ndk-r10e \             # Path to an Android NDK.
  --android-ndk-version 21 \
  --android-icu-uc ~/libicu-android/armeabi-v7a/libicuuc.so \
  --android-icu-uc-include ~/libicu-android/armeabi-v7a/icu/source/common \
  --android-icu-i18n ~/libicu-android/armeabi-v7a/libicui18n.so \
  --android-icu-i18n-include ~/libicu-android/armeabi-v7a/icu/source/i18n/
```

Android builds have the following dependencies, as can be seen in
the build script invocation:

1. An Android NDK of version 21 or greater, available to download
   here: http://developer.android.com/ndk/downloads/index.html.
2. A libicu compatible with android-armv7.
2016-04-12 19:26:21 -04:00
David Farler
17d558839b Build swift-reflection-test if stdlib is built
This tool links against target-specific stdlib/public/Reflection,
so make sure to only include it as a dependency when stdlib is getting
built. Otherwise, separate overlay builds can fail because ninja can't
find the target-specific dependencies.

rdar://problem/25556475
2016-04-07 13:48:51 -07:00
David Farler
d8d9dc4aca Include target variant suffix in swift-reflection-test dependencies
swift-reflection-test isn't a standalone host-side tool anymore, but a
target executable, so the dependency needs to include the variant suffix
(e.g.  -macosx-x86_64) in the name.
2016-03-31 14:10:01 -07:00
David Farler
885d33ec0a Add swift-reflection-dump to check-swift tool dependencies 2016-03-29 16:06:47 -07:00
Han Sangjin
e06c7136cb Porting to Cygwin. rebased and squashed 2016-02-22 13:20:21 +09:00
Jordan Rose
92224cddd3 [CMake] The tests depend on swift-reflection-test. 2016-02-17 10:10:40 -08:00
Dmitri Gribenko
226ab38888 CMake / lit: add a mode to run only executable tests
This allows us to quickly run tests affected by implementation-only
standard library changes.
2016-02-12 22:50:42 -08:00
Ted Kremenek
a72f3e11d9 Merge pull request #1203 from apple/run-ios-host-tests
build-script: allow to run host-side iOS tests
2016-02-04 21:41:57 -08:00
Dmitri Gribenko
27be1ab257 build-script: allow to run host-side iOS tests
This change allows to easily run iOS tests that require only running the
compiler, and don't require running the generated code.
2016-02-04 17:19:12 -08:00
Harlan Haskins
847e90a355 [coverage] Fix arguments in profdata_merge/main.py invocation 2016-02-04 17:02:39 -08:00
Harlan Haskins
cf30318aeb [coverage] Converted to python standard logging framework 2016-02-02 12:59:13 -08:00
Harlan Haskins
6572267931 [coverage] Split profdata_merge_worker.py into separate files within a module 2016-02-01 15:52:56 -08:00
Harlan Haskins
96d426165d [coverage] Made some stylistic changes for CMake consistency 2016-02-01 11:51:47 -08:00
Harlan Haskins
9fccf5058a [coverage] Fixed conflicts with master 2016-01-28 10:05:38 -08:00