Commit Graph

31 Commits

Author SHA1 Message Date
Saleem Abdulrasool
a405c5d994 test: repair stdlib/Dispatch on ASi
The conversion of the naonseconds to Mach ticks in multiples of Mach
timebase units alters the time.  This would fail on ASi where mach ticks
are not synonymous with nanoseconds.
2020-08-07 14:58:36 -07:00
Saleem Abdulrasool
48b0802b63 test: swap parameters in test assertion (NFC)
Swap the parameters in `assertEqual` to improve diagnostics on failure.
This now prints as:

```
stdout>>> expected: -431 (of type Swift.int)
stdout>>> actual: -11 (of type Swift.int)
```
2020-08-06 09:04:23 -07:00
Mishal Shah
e7cd5ab17f Update master to build with Xcode 11.4 2020-03-24 11:30:45 -07:00
Butta
3f4109b3a2 [android] Get build scripts working natively, fix tests and install
The build scripts assume Android cross-compilation using the NDK, so avoid
that configuration if building on an Android host. Fix or disable some tests,
and don't install a glibc.modulemap without a native sysroot prefix.
2020-02-05 11:36:33 +05:30
Julian Lettner
105e4ad592 [TSan] Add positive test for TSan + Dispatch on Linux
1) Enable tests that use `import Dispatch` on Linux. Add substitution
   `%import-libdispatch` that needs to be used for all cross-platform
   tests (i.e., tests that are intended to be run on other platforms
   than Darwin) that do `import Dispatch` or enable thread sanitizer.

2) Make sure as many existing Dispatch and TSan tests as possible run on
   Linux. Mark tests that would require substantial work with
   `UNSUPPORTED: OS=linux-gnu`.

3) Add integration-style Swift test that shows that TSan finds a simple
   race when using `Dispatch.async` incorrectly. A more complete test
   suite for TSan's libdispatch support lives on the LLVM/compiler-rt
   side.

rdar://problem/49177535
2019-06-10 14:24:53 -07:00
Julian Lettner
c0674b7ef8 [testsuite] Allow libdispatch tests to run on non-Apple platforms
The lit feature `objc_interop` is used as a proxy for the availability
of libdispatch and Foundation.

Although we don't support Obj-C on non-Apple platforms, we support
libdispatch and Foundation. Let's break up `objc_interop` into
finer-grained categories so we can run more tests on non-Apple
platforms.

This patch adds lit features `libdispatch` and `foundation` (currently
only enabled on Apple platforms) and removes the `objc_interop`
dependency from libdispatch tests.
2019-03-08 16:53:40 -08:00
Arnold Schwaighofer
2d8a1dbbfe Codesign test/stdlib 2018-08-10 06:58:40 -07:00
Kim Topley
7b0991f0a8 Change the signature for DispatchData.enumerateBytes() to match that of Data.enumerateBytes() for Swift 4.2 and obsolete the old version.
rdar://problem/40775762
2018-07-17 11:00:55 -07:00
Ben Cohen
685f31b0e2 [stdlib] Migrate stdlib tests of Swift 3 (#17427)
* First sweep of Swift 3 stdlib test upgrades

* Review feedback

* Remove a handful more #if >=4.0

* Fix up Dictionary tests
2018-07-08 09:37:01 -07:00
Saleem Abdulrasool
b67d5f0cf7 test: convert rm -rf && mkdir -p into %empty-directory
This converts the instances of the pattern for which we have a proper
substitution in lit.  This will make it easier to replace it
appropriately with Windows equivalents.
2018-03-06 14:30:54 -08:00
Kim Topley
1da4b04d99 Fixes overflow trap when creating DispatchTime objects with large uptimeNanoseconds values and re-enables the tests that failed.
Adds some additional tests.
2017-10-16 07:09:05 -07:00
Greg Parker
8ca2225383 [test] XFAIL stdlib/Dispatch.swift on all ARM CPUs pending rdar://34751238. (#12283)
Previous XFAIL attempt was only for 32-bit ARM, but 64-bit ARM is also affected.
2017-10-04 19:12:40 -07:00
Greg Parker
b6b983a6d4 [test] XFAIL stdlib/Dispatch.swift on 32-bit ARM pending rdar://34751238. (#12259)
Previous attempt to XFAIL (#12231) missed armv7s.
2017-10-04 09:42:23 -07:00
Greg Parker
cc188c9b55 [test] XFAIL stdlib/Dispatch.swift on 32-bit ARM pending rdar://34751238. (#12231) 2017-10-02 17:28:30 -07:00
Kim Topley
c5af2799c1 Fix overflow traps in DispatchTime/DispatchWallTime/DispatchTimeInterval.
rdar://problem/32678302
2017-09-20 12:16:05 -07:00
Kim Topley
6194f37e1a Fix warnings in DispatchQueue.sync() implementation when using a compiler with SE-0176 support. 2017-06-30 08:45:15 -07:00
Max Moiseev
eaf20b23ba [overlay] Rename scheduleOneShot and scheduleRepeating
rdar://29587696
2017-06-26 15:38:21 -07:00
Mishal Shah
c5ff1f2cac Update master to build with Xcode 9 beta 1, OS X 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-06-14 16:20:35 -07:00
ktopley-apple
2e5e1d8ee5 Makes the DispatchIO initializer that accepts a path failable, reflecting the fact that a relative or non-existent path is invalid. (#8173)
(Radar 28564226)
2017-03-20 15:32:22 -07:00
ktopley-apple
56081a24c3 Add support for UnsafeRawBufferPointer to DispatchData (#8004)
* Add support for UnsafeRawBufferPointer to DispatchData

(Radar 28503167)

* Review comments.
2017-03-10 13:59:44 -08:00
Kim Topley
65032a6898 DispatchTime.uptimeNanoseconds returns incorrect value on some platforms.
(Radar 30332506)
2017-02-08 10:34:08 -08:00
ktopley-apple
4854530db0 Fixes crash when DispatchData is created from an UnsafeBufferPointer<Uint8> with a nil address. (#7194)
Radar 29337927
2017-02-02 09:33:45 -08:00
Kim Topley
7d9ed86d8c Fixes handling of range indices in DispatchData.copyBytes() and adds tests for the copyBytes() method (Radar 29005050) 2017-01-26 09:13:25 -08:00
Maxim Moiseev
89840c738a [dispatch] Fix + and - operations on DispatchTime and DispatchWallTime (#6961)
... for the cases where `seconds` parameter is NaN or infinite.
Fixes <rdar://problem/29764171>
2017-01-20 21:44:47 -08:00
Kevin Ballard
301510e9d4 Fix dispatch time comparisons (#5078)
* [Dispatch] Don't crash when comparing DispatchWallTimes with <

* [Dispatch] Make comparisons with distantFuture work as expected
2016-10-13 11:32:24 -07:00
Dmitri Gribenko
c9041beea3 Migrate callsites from 'expectNotEmpty()' to 'expectNotNil()' 2016-09-10 20:05:43 -07:00
Max Moiseev
9fc37efee4 [test] renaming test/1_stdlib to just test/stdlib 2016-09-01 16:51:43 -07:00
Jordan Rose
e83c117c30 [test] Hack: run stdlib tests first to start long-running tests earlier.
This decreases total testing time by over a minute on my old Mac Pro.
It probably has much less effect on systems with fewer cores, but shouldn't
be any worse there.

Swift SVN r22745
2014-10-15 01:30:51 +00:00
Anna Zaks
122ea9dc92 Add overlay cover for dispatch_data_empty
Swift SVN r21821
2014-09-10 00:50:43 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Greg Parker
f1d020e11a <rdar://16848707> Add Dispatch overlay with covers for some libdispatch macros.
Swift SVN r17693
2014-05-08 09:47:00 +00:00