Files
swift-mirror/validation-test/StdlibUnittest/ChildProcessShutdown/FailIfChildExitsDuringShutdown.swift
Han Sangjin a8dec7fa43 [stdlib] Fixed for Cygwin
- CYGWIN symbol is used to distinguish Cygwin environment from other OS
  and other environment in Windows.
- Added windows and windowsCygnus to OSVersion in StdlibUnittest
2017-01-17 02:31:16 +09:00

35 lines
839 B
Swift

// RUN: %target-run-simple-swift 2>&1 | %FileCheck %s
// REQUIRES: executable_test
import StdlibUnittest
#if os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Windows)
import Glibc
#else
import Darwin
#endif
_setTestSuiteFailedCallback() { print("abort()") }
//
// Test that harness aborts when a test crashes if a child process exits with a
// non-zero code after all tests have finished running.
//
var TestSuiteChildExits = TestSuite("TestSuiteChildExits")
TestSuiteChildExits.test("passes") {
atexit {
_exit(1)
}
}
// CHECK: [ RUN ] TestSuiteChildExits.passes
// CHECK: [ OK ] TestSuiteChildExits.passes
// CHECK: TestSuiteChildExits: All tests passed
// CHECK: Abnormal child process termination: Exit(1).
// CHECK: The child process failed during shutdown, aborting.
// CHECK: abort()
runAllTests()