Files
swift-mirror/test/stdlib/UIViewControllerAdditions.swift
Mike Ash e0031d0b8f [Test] Adjust UIViewControllerAdditions to take individual nib files as arguments rather than the enclosing folder.
remote-run doesn't like copying folders. This achieves the same end result without requiring remote-run to copy folders.

rdar://problem/50503952
2019-07-02 11:05:23 -04:00

63 lines
1.8 KiB
Swift

// RxUN: %target-build-swift -g %s -o %t/ViewControllerAdditions.out
// RxUN: %target-run %t/ViewControllerAdditions.out %S/Inputs/UIViewControllerAdditions/* | %FileCheck %s
// RUN: %target-run-simple-swift %S/Inputs/UIViewControllerAdditions/* | %FileCheck %s
// REQUIRES: executable_test
// REQUIRES: OS=ios
import UIKit
// _TtC1a15View1Controller.nib
class View1Controller : UIViewController { }
// _TtC1a15View2.nib
class View2Controller : UIViewController { }
// a.View3Controller.nib
class View3Controller : UIViewController { }
// a.View4.nib
class View4Controller : UIViewController { }
// View5Controller.nib
class View5Controller : UIViewController { }
// View6.nib
class View6Controller : UIViewController { }
// no nib
class MissingViewController : UIViewController { }
let nsarg1 = CommandLine.arguments[1] as NSString
let bundlePath = nsarg1.deletingLastPathComponent
let bundle = Bundle(path: bundlePath)
let v1 = View1Controller(nibName:nil, bundle:bundle)
print("tag 1 0=\(v1.view.tag) you're it")
// CHECK: tag 1 0=0 you're it
let v2 = View2Controller(nibName:nil, bundle:bundle)
print("tag 2 0=\(v2.view.tag) you're it")
// CHECK: tag 2 0=0 you're it
let v3 = View3Controller(nibName:nil, bundle:bundle)
print("tag 3 3=\(v3.view.tag) you're it")
// CHECK: tag 3 3=3 you're it
let v4 = View4Controller(nibName:nil, bundle:bundle)
print("tag 4 4=\(v4.view.tag) you're it")
// CHECK: tag 4 4=4 you're it
let v5 = View5Controller(nibName:nil, bundle:bundle)
print("tag 5 5=\(v5.view.tag) you're it")
// CHECK: tag 5 5=5 you're it
let v6 = View6Controller(nibName:nil, bundle:bundle)
print("tag 6 6=\(v6.view.tag) you're it")
// CHECK: tag 6 6=6 you're it
let v7 = MissingViewController(nibName:nil, bundle:bundle)
print("tag 7 0=\(v7.view.tag) you're it")
// CHECK: tag 7 0=0 you're it