File tree 4 files changed +44
-14
lines changed
utils/swift_build_support
4 files changed +44
-14
lines changed Original file line number Diff line number Diff line change @@ -6,5 +6,5 @@ structures used by the Swift build script.
6
6
You may run unit tests for ` swift_build_support ` from the command line:
7
7
8
8
``` sh
9
- apple/swift $ python -m unittest discover -s utils/swift_build_support
9
+ $ python utils/swift_build_support/run_tests.py
10
10
```
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+
3
+ # This source file is part of the Swift.org open source project
4
+ #
5
+ # Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
6
+ # Licensed under Apache License v2.0 with Runtime Library Exception
7
+ #
8
+ # See https://swift.org/LICENSE.txt for license information
9
+ # See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+
11
+
12
+ """
13
+ Small script used to easily run the swift_build_support module unit tests.
14
+ """
15
+
16
+
17
+ from __future__ import absolute_import , unicode_literals
18
+
19
+ import os
20
+ import sys
21
+ import unittest
22
+
23
+
24
+ MODULE_DIR = os .path .abspath (os .path .dirname (__file__ ))
25
+ UTILS_DIR = os .path .abspath (os .path .join (MODULE_DIR , os .pardir ))
26
+
27
+
28
+ if __name__ == '__main__' :
29
+ # Add the swift/utils directory to the Python path.
30
+ sys .path .append (UTILS_DIR )
31
+
32
+ # Discover all tests for the module.
33
+ module_tests = unittest .defaultTestLoader .discover (MODULE_DIR )
34
+
35
+ # Create and run test suite.
36
+ suite = unittest .TestSuite ()
37
+ suite .addTests (module_tests )
38
+
39
+ runner = unittest .TextTestRunner ()
40
+ result = runner .run (suite )
41
+
42
+ sys .exit (not result .wasSuccessful ())
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 7
7
// UNSUPPORTED: OS=tvos
8
8
// UNSUPPORTED: OS=watchos
9
9
10
- // RUN: env PYTHONPATH=%utils:$PYTHONPATH % {python} -m unittest discover -s %utils/swift_build_support
10
+ // RUN: % {python} %utils/swift_build_support/run_tests.py
You can’t perform that action at this time.
0 commit comments