Commit Graph

9 Commits

Author SHA1 Message Date
Karoy Lorentey
1a051719e3 [runtime] Adjust file/line information in fatal error messages to follow diagnostic conventions
In debug configurations, fatal error messages include file & line number information. This update presents this information in a format matching the diagnostic conventions used by the compiler, which can be a slight productivity boost.

Code compiled with optimizations enabled (which is most production code) does not output this information, so it isn’t affected by this change.

Original format:

    Fatal error: A suffusion of yellow: file calc.swift, line 5

New format:

    calc.swift:5: Fatal error: A suffusion of yellow

Resolves rdar://68484891
2020-11-10 13:23:21 -08:00
Daniel Rodríguez Troitiño
8bea502e8d [windows][test] Ensure the ordering of stdout and stderr messages.
It is possible that the rest of the platforms are relying in some not
clearly documented behaviour that the stdout is flushed before stderr
can be used, or something similar. Windows didn't seem to like that, and
was sometimes outputting the stderr messages interlaced with the stdout
messages (specially in the Azure testing for VS2017). The initial
solution was adding -DAG to some CHECK lines, but that doesn't cover all
the possibilities, and wasn't enabled for all the checks.

I tried to fix it in several ways, but none of them were perfect, and
many of them were deadlocking. There's a fundamental difference between
others and Windows and that is that for others stdout seems to have a
little bit of an edge in being treated first. I tried to get the Windows
code closer to that idea, but I have no luck. Some of the approaches
were using the main thread to read from the threads reading stdout and
stderr; using only the main thread and IOCP on the pipes reading from
the child process; and flushing after every output to stdout. None of
them were perfect.

The final solution is a hack, but it seems to not fail when I run the
test repeatedly in my machine, while other approaches were failing at
least once before I discarded them. The solution is including a small
sleep (1 millisecond) in the Windows code. This should yield the
execution time slice to other thread/process, which seems to do the
trick and keep the stdout before the stderr.

Hopefully this fixes the errors in Azure, and doesn't affect the rest of
the testing machines. Being a really small sleep also should not affect
the duration of the test itself.
2019-07-30 15:04:21 -07:00
Saleem Abdulrasool
4c91a3eb60 test: make StdlibUnittest.CrashingTests pass on Windows
The output can be interleaved differently.  Accept either ordering.
2019-06-11 15:38:43 -07:00
Kuba (Brecka) Mracek
d03a575279 Unify the capitalization across all user-visible error messages (#11599)
* Unify the capitalization across all user-visible error messages (fatal errors, assertion failures, precondition failures) produced by the runtime, standard library and the compiler.

* Update some more tests to the new expectations.
2017-08-29 12:16:04 -07:00
Maxim Moiseev
16eb32f539 [validation-test] Marking a few stdlibunittest validation tests as unsupported on watchos (#7731) 2017-02-24 13:44:32 -08:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Dmitri Gribenko
d872098fbc StdlibUnittest: clarify what a test does 2016-05-22 14:37:53 -07:00
Slava Pestov
49c54870c1 Serialization: Auto-linking recursively walks modules imported from -sil-serialize-all modules 2016-04-01 12:21:36 -07:00
Jordan Rose
40f57149f6 Move StdlibUnittest tests to their own directory.
StdlibUnittest.swift became StdlibUnittest/Common.swift;
all others just dropped the "StdlibUnittest" prefix.
2016-03-18 16:19:30 -07:00