Commit Graph

2015 Commits

Author SHA1 Message Date
Saleem Abdulrasool
299548deb7 validation-test: avoid shell in HashingRandomization
Split up the commands into multiple RUN lines.  Use a temporary to
actually capture the output of multiple invocations to compose them into
a single stream.

Replace the `export` usage with `env` which the lit interpreter is able
to process even on Windows.

This makes HashingRandomization pass on Windows.
2019-06-03 19:10:37 -07:00
Saleem Abdulrasool
8cb86acab5 tests: add swift_addNewDSOImage to the stubs
This is needed particularly on Windows which does not permit unresolved
symbols and the startup stub (swiftrt.obj) references the runtime
function.
2019-06-03 18:53:29 -07:00
Saleem Abdulrasool
1c41c0887c validation-test: adjust stdlib tests for Windows
The embedded shell script in the RUN command for lit is problematic for
non-sh shell environments (i.e. Windows).  This adjusts the tests to
uniformly build the code for the ObjC runtime.  However, the Objective-C
code is only built under the same circumstances that it is currently
enabled - the availability of the needed frameworks.  The empty object
on other runtimes will have no material impact.  The swift side of it
checks whether the runtime is built with ObjC interop.  This allows us
to largely use the same command line for all the targets.  The last
missing piece is that the `-fobjc-runtime` requires that we run a modern
ObjC runtime.  We enable this unconditionally in lit for the non-Apple
targets.

This improves the validation test coverage for the standard library on
Windows.
2019-06-03 08:36:22 -07:00
Arnold Schwaighofer
b31b7a9d8e Remove some UNSUPPORTED swift_test_mode_optimize_none_with_implicit_dynamic
rdar://51228899
2019-05-31 08:45:37 -07:00
Erik Eckstein
4fb4435d12 IRGen: add an option to disable runtime calls for dynamic replacements.
With the option -Xllvm -basic-dynamic-replacement the runtime functions are not called (so it works with an old swift library).
But calling the original of a replaced function is not supported in this case.
2019-05-30 15:28:16 -07:00
Joe Groff
2a28948a69 Merge pull request #25030 from jckarter/SR-10600-back-deploy
Introduce a backward-deployment library for SR-10600.
2019-05-29 15:02:02 -07:00
Joe Groff
2a2d40d870 Driver: Link against compatibility library for deploying back to Swift 5.0 runtimes 2019-05-24 12:44:22 -07:00
David Smith
7561f95134 Test foreign strings on invalid content more thoroughly 2019-05-17 16:18:34 -07:00
Pavol Vaskovic
14f250bfa1 Merge pull request #24575 from palimondo/set-seq-unittests
[stdlib] Fix and Improve Unit Tests for Set.Sequence
2019-05-09 13:22:47 +02:00
Pavol Vaskovic
bce023aca6 [stdlib] Set.Sequence unittest explicit annotation
Use explicit type annotation to make it crystal clear (beyoud any reasonable doubt) these are indeed testing the Sequence variants.
2019-05-09 10:04:20 +02:00
Robert Widmann
df53d4cbc7 Merge pull request #24549 from drodriguez/enable-test-posix-error-code
[test] Enable impossible to support test POSIXErrorCode.
2019-05-07 19:12:53 -04:00
Pavol Vaskovic
0f4c1cda0d [stdlib] Fix unit tests for Set.Sequence methods
Really test the Sequence variants of set algebra and cover the same cases as Set.Set.
2019-05-07 19:38:18 +02:00
Pavol Vaskovic
475c2099a7 [stdlib] Improve unit test coverage of Set.Set
Systematically test also set algebra:
* with empty sets on both sides
* inverse operation
2019-05-07 19:35:56 +02:00
Daniel Rodríguez Troitiño
1813cc3670 [android] Enable some tests that should pass on Android.
Some tests are limited to only Linux, when they should also pass for
Android.

Additionally, InputStream.swift.gyb was disabled for Android ARMv7, but
wasn't for Android AArch64, which allow me to find the error on it and
fix it on #24521.

Finally, StringLowercasedUppercased is interesting in Android because it
checks the used ICU is correct for performing the tasks that the stdlib
needs.
2019-05-06 17:53:51 -07:00
Daniel Rodríguez Troitiño
699b4821de [test] Enable impossible to support test POSIXErrorCode.
The REQUIRES written one in each line were impossible to satisfy in any
platform, so the test wasn't running at all. This was changed to a
REQUIRE-ANY listing all the platforms (and adding Android). I also
needed to add runAllTest() at the end to make the test pass.
2019-05-06 17:44:32 -07:00
Karoy Lorentey
f776a381f3 [test] Add availability guards for tests checking behavioral changes in 5.1 2019-05-03 19:09:47 -07:00
Keita Nonaka
35bbfbf880 add set filter test and minor fixes 2019-05-01 22:56:57 -04:00
Nate Chandler
a09a9640d0 Don't implicitly return assignments.
Corrected a number of diagnostic regressions.
2019-04-24 10:09:19 -07:00
Nate Chandler
c21678d34a Corrected tests by removing implicit returns. 2019-04-24 10:04:20 -07:00
Arnold Schwaighofer
1e63ce77fb Revert "Temporarily disable stdlib tests depending on autorelease elision." 2019-04-16 08:34:01 -07:00
Andrew Trick
bb8c5c66f9 Temporarily disable stdlib tests depending on autorelease elision.
Until the issue is fixed. Tracked by:
<rdar://problem/49791522> Swift CI Test failures: IRGen/autorelease_optimized_armv7/aarch64.
https://bugs.swift.org/browse/SR-10474
2019-04-15 16:31:47 -07:00
Karoy Lorentey
e08b219448 Merge pull request #23683 from lorentey/casting-improvements
[stdlib] Fix Set/Dictionary casting issues
2019-04-15 10:56:38 -07:00
Karoy Lorentey
3c74c0f1cb [stdlib] Change the signature of Dictionary’s bulk initializer (#23758)
The initializer was originally introduced without proper availability; in https://github.com/apple/swift/pull/23643, we fixed this by applying the `@_alwaysEmitIntoClient` attribute. However, this had the unfortunate side-effect that the symbol disappeared from `libswiftCore.dylib`, which somehow confuses some simulator builds.

Try to figure out what’s happening by replacing the third closure argument with an integer return value. This changes the mangled name of the bulk initializer, which should make it more obvious how/why these builds fail.

rdar://problem/49479386
2019-04-03 10:51:36 -07:00
Karoy Lorentey
ceb703b840 [test] Add new Set/Dictionary casting tests 2019-03-29 19:15:23 -07:00
Michael Ilseman
0ece62d911 [String] Add Substring.base
Adds Substring.base, analogous to Slice.base, to access the entire
String.

Tests added.
2019-03-29 15:43:00 -07:00
Xi Ge
97233420b8 test: disable FixedPointConversion tests while investigating related CI failures. rdar://49177883 2019-03-24 11:51:14 -07:00
David Zarzycki
e5f8e30c15 [Testing] Mark FixedPointConversion tests as "long_test" (#23522)
As of 14d89ec1c1, these tests now take
2.25x longer than the *entire* validation test suite on fast machines.
Mark them as "long_test" for now until they can be broken into smaller
concurrent tests.
2019-03-24 13:21:39 -04:00
Arnold Schwaighofer
a67f3b919d Merge pull request #23452 from aschwaighofer/add_test_optimize_none_implicit_dynamic
Add a test mode to exercise implicit dynamic
2019-03-22 06:24:14 -07:00
Daniel Rodríguez Troitiño
4dcf60ca0f [test] Fix FixedPointConversion tests (#23220)
Fix several problems with FixedPointConversion generation code.

The first problem is that at some point `repr(value)` was being used,
which turn the number into a string. That was great for printing the
number, but make the test against the value of the number (like
`testValue < otherMin` always false. There were a number of tests that
were never performed, specifically the integer tests.

The second problem was using doubles in the Python code. For Float32 and
Float64 the tests were generated correctly, but in the case of Float80,
the test adding or removing a quantity to the maximum/minimum were
failing because of the lack of precission (Adding 0.1 to a very
big/small number is the same as not adding anything). Switching to
Decimal should keep enough precission for the tests.

Finally the last problem was that the bounds of the conversions are not
actually `selfMin` and `selfMax`, but the values returned by the utility
function `getFtoIBounds`. For example for unsigned types, the lower
bound is always -1, not zero (every value between -1 and zero is rounded
to zero, and doesn't fail).

Instead of using nested gyb templates, use lit.cfg %target-ptrsize,
which should be faster, cleaner, and provides correct line-directive
output.

Remove a bunch of warnings in Swift when compiling the generated result
of FixedPointConversion.swift.gyb.

Co-authored-by: Gwynne Raskind <gwynne@users.noreply.github.com>
2019-03-21 13:58:30 -04:00
Arnold Schwaighofer
e113ef8c93 Add a mode to test implicit dynamic with private imports 2019-03-20 14:34:01 -07:00
Xi Ge
b2b128caa0 test: temporarily disable several failing tests on CI. rdar://49026133 2019-03-19 11:18:05 -07:00
swift-ci
6e7202e0f6 Merge pull request #23174 from lorentey/tacoma-narrows 2019-03-15 14:48:33 -07:00
Arnold Schwaighofer
588b4d6c08 Improve StringMemoryTest.swift
The test fails on some bots as written before.

rdar://48845923
2019-03-14 10:54:20 -07:00
Karoy Lorentey
d467b6fcac [test] Add tests for Set/Dictionary force-bridging failure cases 2019-03-07 19:57:13 -08:00
Arnold Schwaighofer
8cc813d624 Reduce the time spend in StringMemoryTest
Measure the increase.
rdar://problem/48658000
2019-03-07 07:36:53 -08:00
Mishal Shah
98ad5a496e Revert "[StringMemoryTest] Reduce # of iterations down to 1M and lower memory threshold" 2019-03-07 00:15:34 -08:00
Doug Gregor
de13028f6b [StringMemoryTest] Reduce # of iterations down to 1M and lower memory threshold
This test is taking way too long. Cut down on the number of iterations
from 10M to 1M.
2019-03-06 16:59:32 -08:00
Karoy Lorentey
3356b2aca4 Revert "[test] Dictionary: Skip a failing index validation test" 2019-02-28 14:16:38 -08:00
Karoy Lorentey
6836cf8e09 [test] Disable two more collection tests in unoptimized builds 2019-02-27 18:33:19 -08:00
Karoy Lorentey
a7f9894f5a [test] Dictionary: Skip a test that currently fails when compiled with -O
rdar://problem/47973577
2019-02-25 16:03:23 -08:00
Michael Ilseman
f87960746c Merge pull request #22108 from milseman/en_gadus_offset
[String.Index] Obsolete encodedOffset var/init
2019-02-19 14:43:26 -08:00
Max Moiseev
01491ca9d4 Merge pull request #22633 from moiseev/do-not-verify
This test does not verify anything, so typechecking is enough
2019-02-15 09:08:22 -08:00
Maxim Moiseev
9483ad43b3 This test does not verify anything, so typechecking is enough
Related to <rdar://problem/48094005>
Fixes: <rdar://problem/48056095>
2019-02-14 16:50:29 -08:00
Michael Ilseman
e53b719f2e [test] Disable UnicodeLongTest.swift on watchos (#22606)
[test] Disable UnicodeLongTest.swift on watchos
2019-02-14 15:13:35 -08:00
Michael Ilseman
415cc8fb0c [String.Index] Deprecate encodedOffset var/init
String.Index has an encodedOffset-based initializer and computed
property that exists for serialization purposes. It was documented as
UTF-16 in the SE proposal introducing it, which was String's
underlying encoding at the time, but the dream of String even then was
to abstract away whatever encoding happend to be used.

Serialization needs an explicit encoding for serialized indices to
make sense: the offsets need to align with the view. With String
utilizing UTF-8 encoding for native contents in Swift 5, serialization
isn't necessarily the most efficient in UTF-16.

Furthermore, the majority of usage of encodedOffset in the wild is
buggy and operates under the assumption that a UTF-16 code unit was a
Swift Character, which isn't even valid if the String is known to be
all-ASCII (because CR-LF).

This change introduces a pair of semantics-preserving alternatives to
encodedOffset that explicitly call out the UTF-16 assumption. These
serve as a gentle off-ramp for current mis-uses of encodedOffset.
2019-02-13 18:42:40 -08:00
Karoy Lorentey
e806809634 Merge pull request #22485 from lorentey/disable-long-running-tests
[test] Require optimized stdlib for CollectionOfRef validation tests
2019-02-13 18:36:05 -08:00
swift-ci
498b72270b Merge pull request #22527 from Catfish-Man/literally-empty 2019-02-11 22:35:33 -08:00
David Smith
490325c057 Update Dictionary test expectations too 2019-02-11 21:24:33 -08:00
David Smith
f2c398c74a Update test expectations around Set storage identifiers 2019-02-11 18:41:14 -08:00
Andrew Trick
28a529ceed Fix crashes in Unsafe[Raw]BufferPointer with nil baseAddress.
This fix updates various initializers to handle incoming empty buffers
that happen to have a nil base. They should simply create another
buffer with nil base rather than crashing!

It is valid for an Unsafe[Raw]BufferPointer can have a nil base
address. This allows round-tripping with C code that takes a
pointer/length pair and uses `0` as the pointer value.

The original design wrongly assumed that we would use a sentinel value
for empty buffers and was never updated for or tested with the current
design.

Fixes <rdar://problem/47946984> Regression in Foundation.Data's
UnsafeBufferPointer constructor.
2019-02-11 13:38:48 -08:00