Commit Graph

35 Commits

Author SHA1 Message Date
Kavon Farvardin
b5e0f95a18 eliminate pipes in favor of shlex
This solves deprecation warnings in build-script:

```
DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
```

This change assumes that the minimum version
of Python3 is 3.3, which has `shlex.quote`.

Since our build bots currently use 3.6 as their
Python version, we can't yet use `shlex.join`
to further simplify some of the code using
quote.
2023-07-25 15:24:54 -07: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
3405691582
e81534960c [validation] Fix some portability test issues.
Here we fix a few portability issues affecting running the validation tests on OpenBSD. The remaining failures will be dealt with separately.

1. In the `rth` tool, ensure `-z origin` is specified to the linker when
   using `$ORIGIN`, as required on this platform.

2. Explicitly set the rpath in the `dsohandle-multi-module` execution
   test, since the test uses built dynamic libraries during the test.

3. Erase the environment variable instead of using `env -u`, the latter
   of which is not portable.
2021-02-06 16:36:44 -05:00
Saleem Abdulrasool
c1e4a9c019 Merge pull request #25390 from compnerd/double-double
rth: quote the commandline properly on Windows (NFC)
2019-06-14 11:33:22 -07:00
Saleem Abdulrasool
ef1fc19027 rth: quote the commandline properly on Windows (NFC)
This is purely for debugging purposes.  Use the subprocess.list2cmd
function to get a command line quoted for Windows quoting rules.  NFC
2019-06-12 11:36:27 -07:00
Saleem Abdulrasool
279df1be0f rth: change the working directory on Windows
The tests need to change the working directory when executing on Windows
as RPATH is not supported on the platform.  The current working
directory gets precedence over `PATH` for library lookup.  This allows
the last of the Evolution tests pass on Windows.
2019-06-12 11:35:08 -07:00
Saleem Abdulrasool
c50fee199f tests: improve resilience test helper for Windows
Windows does not support the concept of RPATH.  As a result, we must
change the working directory for the test.  This extends the support
for the tests to work with PE/COFF on Windows.  Use the newly minted
`self.triple` property to drive the host detection.  This means that
the test coverage on Windows is able to test most of the resilience
functionality.
2019-06-04 08:54:32 -07:00
Karoy Lorentey
e53071e240 [utils] Fix linter error (#25229) 2019-06-03 17:43:56 -07:00
Saleem Abdulrasool
1e630a5969 test: plumb --triple to the resilience test helper
The resilience test helper builds up invocations of the tooling.  In
order to do this, we need to know what host we are building for.  Plumb
the value for `-triple` from the test harness into the utility.  This
will be used subsequently to enable additional testing for Windows.
2019-06-02 17:55:34 -07:00
Slava Pestov
1159af50d9 Rename -enable-resilience to -enable-library-evolution and make it a driver flag
Fixes <rdar://problem/47679085>.
2019-03-14 22:24:26 -04:00
Slava Pestov
b64db715a8 IRGen: Remove -enable-class-resilience staging flag 2019-02-08 14:22:00 -05:00
Slava Pestov
ba04d49ebd Evolution: Replace unused --no-backward-deployment flag with --backward-deployment flag
This adds a new mode where we always build the app with the new library,
and run it with the old and new library. This is used to test backward
deployment of code that uses weak-linked symbols.

To ensure that we properly crash if we reference an undefined symbol that
is not weak linked, also pass a linker flag to bind symbols eagerly.
2018-12-03 20:36:03 -05:00
Slava Pestov
ee8a3ea566 Evolution: Build tests with optimizations if required
Make sure we honor the swift_test_mode parameter, by passing in
the right optimization flags. Also if we're passing in any flags,
pass in -wmo too.
2018-11-28 12:39:04 -05:00
Slava Pestov
5243cc718d Evolution: Compare symbols before and after
A resilient change should not *remove* previously-public symbols.

Note that currently, the test_superclass_properties test does not
meet this critierion, because we always emit keypath property
descriptors, even when the property is an override. Fixing this
is a larger change that I'll address in a follow-on PR, so for now
I'm just going to disable the symbol check for this one test only.

Part of <rdar://problem/40432647>.
2018-11-15 19:55:46 -05:00
Daniel Rodríguez Troitiño
d3e5af6f18 [android] Push test binaries w/o modifying executable name. (#19960)
At least test_rth.swift is checking the name of the executable
during the test, so renaming every executable to __executable in
Android will never work.

Also, during the rth tool execution, all the results from before
and after are pushed for every test. Since Android copies the
passed files without relative paths, the library files will
overwrite each other, making the test fail.

Depends on #19949 (more or less)
2018-11-02 11:03:08 -07:00
Jordan Rose
01a0de27ec [test] Update for remote-run-ing tests on a different macOS (#18966)
Most of this is just "remember to specify the inputs and outputs on
the command line, so remote-run can see them". A bit is "prefix
environment variables with '%env-'". And the last few are "yeah,
this was never going to work in a remote environment".

In the few cases where I couldn't think of anything reasonable, I just
marked the test as "UNSUPPORTED: remote_run", a new "feature".
2018-08-27 14:50:40 -07:00
Arnold Schwaighofer
8134920f6d Codesign validation-test/Evolution 2018-08-13 08:00:48 -07:00
Slava Pestov
c7853fe086 IRGen: Bring back the -enable-class-resilience staging flag 2018-04-09 21:53:45 -07:00
Jordan Rose
f9299e711c [test] rth: Use dynamic linking to properly test backwards-deployment (#14447)
The added test worked before as well; it's to make sure I didn't break
the existing behavior.
2018-02-08 17:14:10 -08:00
Slava Pestov
a3d64451c1 Compile evolution tests with -swift-version 4 2018-01-14 21:39:53 -08:00
Hugh Bellamy
c6fcbf0510 Python lint a bunch of files not currently python linted 2017-03-17 14:11:00 +07:00
Hugh Bellamy
4f23d61da0 Import print_function wherever we use print() in python code 2017-02-20 11:11:27 +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
practicalswift
0796eaad1f [Python] Fix 80-column violations 2016-03-09 23:52:11 +01:00
practicalswift
30b66ea036 Merge pull request #1584 from practicalswift/python-3-compatible-print
[Python] Use Py3k compatible print operator: print "foo" → print("foo")
2016-03-09 08:00:49 +01:00
Brian Gesiak
c9000af795 Merge pull request #1526 from practicalswift/fix-pep8-violations-ii
[Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
2016-03-08 23:55:46 -05:00
practicalswift
0fd0c48648 [Python] Use Py3k compatible print operator: print "foo" → print("foo") 2016-03-08 23:10:52 +01:00
practicalswift
265835fdfc [Python] Use consistent import ordering for Python code
Ordering used:
1.) standard library imports
2.) third party imports
3.) local package imports

Each group is individually alphabetized.
2016-03-07 23:25:16 +01:00
practicalswift
183da818df [Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
* E101: indentation contains mixed spaces and tabs
* E111: indentation is not a multiple of four
* E128: continuation line under-indented for visual indent
* E302: expected 2 blank lines, found 1
* W191: indentation contains tabs
2016-03-07 22:36:23 +01:00
Slava Pestov
1fef536d62 resilient-test-helper: Add --no-backward-deployment flag
This is used when the application changes in an incompatible way.
2016-03-03 07:37:00 -08:00
Luke Larson
c011d5f550 [rth] Flush stdout after print for correct output ordering 2016-02-17 18:11:36 -08:00
Luke Larson
24860d1e67 [rth] Don't raise an exception if tmp_dir doesn't exist 2016-02-17 11:51:58 -08:00
practicalswift
10b3e63b0f [Python] Fix two small PEP8 violations in recently introduced file "rth"
Before this commit:

```
$ flake8
./utils/rth:34:17: E127 continuation line over-indented for visual indent
./utils/rth:67:27: E127 continuation line over-indented for visual indent
$
```

After this commit:

```
$ flake8
$
```
2016-02-17 07:39:11 +01:00
Luke Larson
f53db0ebd3 [rth] Add resilience test helper utility 2016-02-16 18:52:34 -08:00