5
5
// This work is licensed under the terms of the BSD 3-Clause License.
6
6
// For a copy, see the LICENSE file.
7
7
//
8
- // This file incorporates work covered by the following copyright and
9
- // permission notice:
10
- //
11
- // Copyright (c) 2013-2018, Jordi Boggiano
12
- // Copyright (c) 2013-2018, Alex Lyon
13
- // Copyright (c) 2015, Joseph Crail
14
- // Copyright (c) 2015-2016, Nathan Ross
15
- //
16
- // Permission is hereby granted, free of charge, to any person obtaining a
17
- // copy of this software and associated documentation files (the
18
- // "Software"), to deal in the Software without restriction, including
19
- // without limitation the rights to use, copy, modify, merge, publish,
20
- // distribute, sublicense, and/or sell copies of the Software, and to
21
- // permit persons to whom the Software is furnished to do so, subject to
22
- // the following conditions:
23
- //
24
- // The above copyright notice and this permission notice shall be included
25
- // in all copies or substantial portions of the Software.
26
- //
27
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
28
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
30
- // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
31
- // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
32
- // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
33
- // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34
- //
35
-
36
- #[ macro_export]
37
- macro_rules! assert_empty_stderr(
38
- ( $cond: expr) => (
39
- if $cond. stderr. len( ) > 0 {
40
- panic!( format!( "stderr: {}" , $cond. stderr) )
41
- }
42
- ) ;
43
- ) ;
44
-
45
- #[ macro_export]
46
- macro_rules! assert_empty_stdout(
47
- ( $cond: expr) => (
48
- if $cond. stdout. len( ) > 0 {
49
- panic!( format!( "stdout: {}" , $cond. stdout) )
50
- }
51
- ) ;
52
- ) ;
53
-
54
- #[ macro_export]
55
- macro_rules! assert_no_error(
56
- ( $cond: expr) => (
57
- assert!( $cond. success) ;
58
- if $cond. stderr. len( ) > 0 {
59
- panic!( format!( "stderr: {}" , $cond. stderr) )
60
- }
61
- ) ;
62
- ) ;
63
-
64
- #[ macro_export]
65
- macro_rules! path_concat {
66
- ( $e: expr, ..$n: expr) => { {
67
- use std:: path:: PathBuf ;
68
- let n = $n;
69
- let mut pb = PathBuf :: new( ) ;
70
- for _ in 0 ..n {
71
- pb. push( $e) ;
72
- }
73
- pb. to_str( ) . unwrap( ) . to_owned( )
74
- } } ;
75
- ( $( $e: expr) ,* ) => { {
76
- use std:: path:: PathBuf ;
77
- let mut pb = PathBuf :: new( ) ;
78
- $(
79
- pb. push( $e) ;
80
- ) *
81
- pb. to_str( ) . unwrap( ) . to_owned( )
82
- } } ;
83
- }
84
8
85
9
#[ macro_export]
86
10
macro_rules! util_name {
@@ -107,21 +31,6 @@ macro_rules! fixtures_dir {
107
31
} } ;
108
32
}
109
33
110
- #[ macro_export]
111
- macro_rules! new_ucmd {
112
- ( ) => {
113
- TestScenario :: new( util_name!( ) ) . ucmd( )
114
- } ;
115
- }
116
-
117
- #[ macro_export]
118
- macro_rules! at_and_ucmd {
119
- ( ) => { {
120
- let ts = TestScenario :: new( util_name!( ) ) ;
121
- ( ts. fixtures. clone( ) , ts. ucmd( ) )
122
- } } ;
123
- }
124
-
125
34
#[ macro_export]
126
35
macro_rules! fixtures_path {
127
36
( $filename: expr) => { {
0 commit comments