Commit Graph

49 Commits

Author SHA1 Message Date
Anthony Latsis
6a3903bb53 Revert "Revert "Introduce adoption mode for Swift features""
This reverts commit 393c59c078.
2025-03-05 15:21:01 +00:00
Rintaro Ishizaki
393c59c078 Revert "Introduce adoption mode for Swift features" 2025-03-04 19:13:05 -08:00
Anthony Latsis
f0cfc0ba55 [NFC] Add unit tests for feature option parsing 2025-03-04 13:43:25 +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
Michael Gottesman
e385f9249e [region-isolation] Add unittests for SILOptimizer to top level unittest CMakeLists.txt
I forgot to do this when moving the unittests so we were not building/running them.
2023-10-25 16:56:50 -07:00
Robert Widmann
3764ef8a9a Drop libSyntax's Unit Tests
We no longer intend to support the libSyntax AST, so let's drop
the tests that are only going to get in the way of us iterating
on the Swift Syntax tree.
2022-09-14 23:16:08 -07:00
Alastair Houghton
2ba80e1180 [Unittests] Make the Threading unit tests work.
The threading unit tests currently just check the operation of Mutex.
This used to be part of the runtime tests, but now it's a separate
library we can test it separately.

rdar://90776105
2022-06-07 07:39:51 +01:00
Alex Hoppen
4aa2bbbf06 Revert "Merge pull request #42447 from al45tair/eng/PR-90776105"
This reverts commit 8bcb71140f, reversing
changes made to c4dd271d36.
2022-06-02 18:03:23 +02:00
Alastair Houghton
ddea8b18a8 [Unittests] Make the Threading unit tests work.
The threading unit tests currently just check the operation of Mutex.
This used to be part of the runtime tests, but now it's a separate
library we can test it separately.

rdar://90776105
2022-05-24 14:57:39 +01:00
Adrian Prantl
ef83539c58 Add unittests for the remangler, particularly to cover error handling.
We currently don't have any tests for remangler error handling, because in
asserts builds it asserts. This patch adds a flag that only exists in !NDEBUG
builds to turn off assertions when inside the unit tests.
2022-05-13 17:55:38 -07:00
Erik Eckstein
65976fd0c5 SIL: add a utility which can manage per-block bitfields and flags efficiently.
It is very efficient: no memory allocation is needed an initialization is at zero cost.
2021-01-21 21:31:41 +01:00
Artem Chikin
75a8cfa048 [Dependency Scanning] Add a C API layer for dependency scanning tool, scanning actions, and scan results.
Adds a C API layer consisting of:
- Data structures used to represent in-memory result of dependency scanning
- Opaque dependency scanner tool (C wrapper for `DependencyScanningTool`)

Refactors `ScanDependencies.cpp` to produce dependency scanning result in the form of the above binary format.
2021-01-07 09:08:20 -08:00
Artem Chikin
6cbb1414ff [Dependency Scanning] Add a unittest harness to invoke the dependency scanning tool C++ library 2021-01-07 09:08:20 -08:00
Pavel Yaskevich
9239692d00 [unittests] Add a fixture for Sema unit tests 2020-10-12 18:57:20 -07:00
Pavel Yaskevich
dbae8342e8 [Localization] Establish a dedicated directory for localization tests 2020-09-03 16:33:23 -07:00
HassanElDesouky
354440402f [Localization] Create swift-def-to-yaml-converter tool 2020-09-03 16:33:23 -07:00
Duncan P. N. Exon Smith
43e771e55b Reapply ClangImporter changes to leverage Clang's module cache
This reapplies four commits for the ClangImporter.  They broke the build
on master because the associated commits on swift-clang's
swift-5.1-branch never made it to stable due to automerger woes.  This
time I'll push everything through manually.

These are the commits being reapplied:

- a42bc62397 "ClangImporter: Share a module cache between CompilerInstances"
- 9eed34235b "ClangImporter: Adjust to r355777, PCMCache => ModuleCache"
- da8a1c57e8 "ClangImporter: Use the new CacheGeneratedPCH in Clang"
- 2134b17a20 "ClangImporter: Test that PCHs are actually cached in memory"

rdar://problem/48545366
2019-03-20 09:59:58 -07:00
Davide Italiano
ff10e7f8c6 Revert "ClangImporter: Test that PCHs are actually cached in memory"
This reverts commit 2134b17a20.
2019-03-18 11:30:51 -07:00
Duncan P. N. Exon Smith
2134b17a20 ClangImporter: Test that PCHs are actually cached in memory
Follow up 236fc19121 with a ClangImporter
test that we get the PCH written by this process even if it has been
replaced on disk.
2019-03-13 13:16:25 -07:00
Saleem Abdulrasool
d30a2ababd FrontendTool: fix escaping of filenames in Makefile
The dependency file that is being generated should not escape : and # in
the filename.  This makes the behaviour of the filename escaping similar
to clang and GCC and fixes incorrect quoting of paths on Windows.
2019-02-19 10:51:26 -08:00
Argyrios Kyrtzidis
1dc288fb23 Introduce C parser library
Add a shared library with a C API that provides access to the syntactic parser with callbacks for the inference of raw syntax nodes.
This is primarily intended to be used by SwiftSyntax to speed-up source code parsing for it.
2019-01-09 18:30:45 -08:00
Ben Langmuir
7f393dec81 Revert "[UnitTests] Build unittests with the same compiler used to build the runtime library to ensure calling conventions match." 2018-05-15 19:13:15 -07:00
Mike Ash
f837d42702 [UnitTests] Replicate stdlib's CMakeLists.txt thread sanitizer logic in unittests' CMakeLists.txt.
rdar://problem/40114415
2018-05-15 13:59:42 -04:00
Mike Ash
e6a0525862 [UnitTests] Build unittests with the same compiler used to build the runtime library to ensure calling conventions match.
rdar://problem/40114415
2018-05-10 15:09:31 -04:00
David Farler
7ee42994c8 Start the Syntax library and optional full token lexing
Add an option to the lexer to go back and get a list of "full"
tokens, which include their leading and trailing trivia, which
we can index into from SourceLocs in the current AST.

This starts the Syntax sublibrary, which will support structured
editing APIs. Some skeleton support and basic implementations are
in place for types and generics in the grammar. Yes, it's slightly
redundant with what we have right now. lib/AST conflates syntax
and semantics in the same place(s); this is a first step in changing
that to separate the two concepts for clarity and also to get closer
to incremental parsing and type-checking. The goal is to eventually
extract all of the syntactic information from lib/AST and change that
to be more of a semantic/symbolic model.

Stub out a Semantics manager. This ought to eventually be used as a hub
for encapsulating lazily computed semantic information for syntax nodes.
For the time being, it can serve as a temporary place for mapping from
Syntax nodes to semantically full lib/AST nodes.

This is still in a molten state - don't get too close, wear appropriate
proximity suits, etc.
2017-02-17 12:57:04 -08: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
Michael Gottesman
b9e6adce30 [cmake] Refactor out unittest configuration logic from unittests/CMakeLists.txt => cmake/modules/AddSwiftUnittests.cmake.
rdar://24717107
2016-06-10 01:48:36 -07:00
David Farler
50440abcd0 TypeRef Uniquing
We'd like to be able to compare TypeRefs with pointer equality,
but we can't link LLVMSupport, so make a lightweight TypeRefID
like FoldingSetID, that only supports the input types necessary
to unique TypeRefs.

rdar://problem/25924875
2016-04-25 23:56:28 -07:00
Jordan Rose
fadf6b3c9f [unittest] Add some basic tests for TypeBase::canOverride.
Also, move the version lattice tests under a general "AST" test bundle.
2016-04-14 16:00:46 -07:00
William Dillon
d0d9b1de5a Discard swift.ld and support gold linker 2016-02-17 17:47:35 -08:00
Harlan Haskins
1777c20aff [coverage] Fixed indentation in CMake 2016-02-01 12:38:22 -08:00
Harlan Haskins
44be500157 [coverage] Changed back to old coverage check in CMakeLists.txt files 2016-01-28 13:21:38 -08:00
Harlan Haskins
9eb729ce79 [coverage] Reworked CMake invocation for coverage testing given there are three states for SWIFT_ANALYZE_CODE_COVERAGE 2016-01-26 16:36:26 -08:00
Harlan Haskins
c6c0b3d5d0 [coverage] Removed explicit swift-%p.profraw arguments from CMake commands, because we're using LLVM's environment variables 2016-01-25 19:49:03 -08:00
Luke Larson
ba619a9ff2 [CMake] Support code coverage analysis 2016-01-19 18:51:07 -08:00
Argyrios Kyrtzidis
8ff6a98a99 [sourcekit] Merge SourceKit into the Swift repo.
The code goes into its own sub-tree under 'tools' but tests go under 'test',
so that running 'check-swift' will also run all the SourceKit tests.

SourceKit is disabled on non-darwin platforms.
2015-11-05 01:09:08 -08:00
Jordan Rose
ce616a8897 [unittests] Remove empty and unreferenced unit tests.
Swift SVN r31499
2015-08-26 18:15:13 +00:00
Jordan Rose
f5b1efb354 Move client-affecting configuration options into a generated Config.h.
This way they can be used from other projects, like LLDB. The downside
is we now have to make sure the header is included consistently in all
the places we care about, but I think in practice that won't be a problem,
especially not with tests.

rdar://problem/22240127

Swift SVN r31173
2015-08-12 17:50:13 +00:00
Jordan Rose
953424072e Guard "object literals" feature with SWIFT_ENABLE_OBJECT_LITERALS.
This is not a feature we're releasing at the moment, so provide a way
to turn it off.

rdar://problem/21935551

Swift SVN r30966
2015-08-04 00:16:52 +00:00
David Farler
ca5876a866 swiftMarkup Library
Replace ReST-flavored documentation comments with Markdown.

rdar://problem/20180412

In addition to full Markdown support, the following extensions are
supported. These appear as lists at the top level of the comment's
"document". All of these extensions are matched without regard to
case.

Parameter Outlines
------------------

- Parameters:
  - x: ...
  - y: ...

Separate Parameters
-------------------

- parameter x: ...
- parameter y: ...

- Note:
Parameter documentation may be broken up across the entire comment,
with a mix of parameter documentation kinds - they'll be consolidated
in the end.

Returns
-------

- returns: ...

The following extensions are also list items at the top level, which
will also appear in Xcode QuickHelp as first-class citizens:

- Attention: ...
- Author: ...
- Authors: ...
- Bug: ...
- Complexity: ...
- Copyright: ...
- Date: ...
- Experiment: ...
- Important: ...
- Invariant: ...
- Note: ...
- Postcondition: ...
- Precondition: ...
- Remark: ...
- Remarks: ...
- See: ...
- Since: ...
- Todo: ...
- Version: ...
- Warning: ...

These match most of the extra fields in Doxygen, plus a few more per request.

Other changes
-------------
- Remove use of rawHTML for all markup AST nodes except for those
not representable by the Xcode QuickHelp XSLT - <h>, <hr/>, and of
course inline/block HTML itself.

- Update the doc comment RNG schema to more accurately reflect Xcode
QuickHelp.

- Clean up cmark CMake configuration.

- Rename "FullComment" to "DocComment"

- Update the Swift Standard Documentation (in a follow-up commit)

- Update SourceKit for minor changes and link against cmark
  (in a follow-up commit).

Swift SVN r27727
2015-04-26 00:07:15 +00:00
Dmitri Hrybenko
321d4d4792 Rename libfunctionNameDemangle.dylib to libswiftDemangle.dylib
This library becomes a permanent interface that we would need to support
in the long term, so we should get dylib names and APIs right.

rdar://20418214

Swift SVN r26957
2015-04-03 22:12:28 +00:00
Jordan Rose
38752c2d92 [CMake] Move swift_llvm_config to SwiftSharedCMakeConfig (for SourceKit).
...and rename it to swift_common_llvm_config.

This is the function that acts like llvm_config but handles the LLVM build
being a different configuration from the Swift (or SourceKit) build, which
can be problematic for multi-configuration build schemes like Xcode.

There's also one fix here: LLVM dependencies for dylibs weren't being
properly added. (This is the "SHARED_LIBRARY" case near the bottom.)

Swift SVN r26631
2015-03-27 16:36:43 +00:00
Dmitri Hrybenko
6058d291ca CMake: allow the SDK overlay to be built separately from the compiler
and the stdandard library

rdar://19703353

Swift SVN r25139
2015-02-10 21:57:03 +00:00
Jordan Rose
c87a359107 [CMake] Teach unit tests to handle Release LLVM / Debug Swift.
(and similar mixed modes)

This is duplicating some of the work in swift_llvm_config, and should
probably be refactored back there at some point, but for now this gets
unit tests building in Xcode when the build configurations for LLVM and
Swift aren't the same.

Swift SVN r24257
2015-01-08 03:02:16 +00:00
Dmitri Hrybenko
6670bb76ec Rewrite the CMake build system
Swift SVN r24124
2014-12-23 22:15:30 +00:00
Dmitri Hrybenko
e954ac9534 CMake: normalize checks for Apple operating systems
Swift SVN r23056
2014-11-01 04:14:36 +00:00
John McCall
d1ccc7e10a Fix the metadata unit test and ensure that it gets set up
correctly for at least my build configuration.

Swift SVN r20566
2014-07-25 22:18:01 +00:00
Greg Parker
1892c003bc [test] Add test machinery for iOS, but don't use or enable anything yet.
Swift SVN r13407
2014-02-04 07:00:48 +00:00
Jordan Rose
1eec5db8c5 CMake: get unit tests working.
Whatever difficulty there supposedly was in doing this for Clang must
apply only to standalone builds where no LLVM source is available.

Swift SVN r3057
2012-10-25 18:30:06 +00:00