Commit Graph

10 Commits

Author SHA1 Message Date
Ben Langmuir
85d9acf138 [stdlib][test] Remove problematic else branches in availability checks
Testing the old behaviour can cause issues when the new availability
gets properly defined. Just check the new behaviour, which is what we
are doing in other stdlib tests.
2024-08-14 09:37:22 -07:00
Ben Langmuir
56fa3e54c8 [stdlib][test] Update string printing availability checks
The change in behaviour that these checks covered is not currently in 6.0,
only in main. Update the availability check to use stdlib 6.1.
2024-08-08 15:10:41 -07:00
Alejandro Alonso
9bc9d926c4 Update BridgedObjectDebuggerSupport.swift 2024-05-29 09:32:27 -07:00
Alejandro Alonso
528160d1cd Update BridgedObjectDebuggerSupport.swift 2024-05-15 10:03:57 -07:00
Alejandro Alonso
b2f21bbfb3 Update DebuggerSupport.swift 2024-05-15 10:02:35 -07:00
Michael Ilseman
ba6158d74e [test] Internalize _StringGuts; Add shared testing struct; NFC
Create a _StringRepresentation struct to standardize internal testing
on. Internalize much of _StringGuts, except for some SPI hacks, and
update tests to use _StringRepresentation.
2018-08-01 14:23:56 -07:00
Vedant Kumar
ca27e829ba Add a transform to help test lldb expression evaluation
The initial version of the debugger testing transform instruments
assignments in a way that allows the debugger to sanity-check its
expression evaluator.

Given an assignment expression of the form:

```
  a = b
```

The transform rewrites the relevant bits of the AST to look like this:

```
  { () -> () in
    a = b
    checkExpect("a", stringForPrintObject(a))
  }()
```

The purpose of the rewrite is to make it easier to exercise the
debugger's expression evaluator in new contexts. This can be automated
by having the debugger set a breakpoint on checkExpect, running `expr
$Varname`, and comparing the result to the expected value generated by
the runtime.

While the initial version of this testing transform only supports
instrumenting assignments, it should be simple to teach it to do more
interesting rewrites.

There's a driver script available in SWIFT_BIN_DIR/lldb-check-expect to
simplfiy the process of launching and testing instrumented programs.

rdar://36032055
2018-03-30 16:50:31 -07:00
Vedant Kumar
20f95f9250 [DebuggerSupport] Test formatting of the small and Cocoa variants
This test case has been lifted from test/stdlib/NewString.swift.
2018-01-30 18:29:35 -08:00
Vedant Kumar
7fe43d6d71 Mark a debugger support test as requiring objc_interop 2018-01-29 17:36:46 -08:00
Vedant Kumar
5049db0dd9 [DebuggerSupport] Attempt expanding objects with .class display style
When pretty-printing objects, attempt to expand & print objects which
have the `.class` display style even if they do not have any instance
variables. The pretty-printer will still bail out if the object does not
conform to CustomReflectable.

This is enough to teach the pretty-printer to format bridged NSStrings.

rdar://36843869
2018-01-29 15:31:53 -08:00