14
14
15
15
class Tests :
16
16
def __init__ (self , url , environment ):
17
+ self .retval = 0
17
18
self .url = url
18
19
self .environment = os .path .abspath (environment )
19
20
self .
email = os .
getenv (
'EMAIL' ,
'[email protected] ' )
@@ -94,31 +95,41 @@ def common(self, test, identifier='common'):
94
95
command = self .create_command (test_directory , '--plugin' )
95
96
retval = self .run_command (command )
96
97
if retval != 0 :
98
+ self .retval = retval
97
99
self .send_mail_no_logs (identifier )
98
100
99
101
def libraries (self , identifier = 'libraries_fetch' ):
100
102
command = self .create_command ('libraries_fetch' , '-F' , '--plugin' )
101
- self .run_command (command )
103
+ retval = self .run_command (command )
104
+ if retval != 0 :
105
+ self .retval = retval
102
106
self .send_mail_with_logs (identifier )
103
107
104
108
def examples (self , identifier = 'libraries_test' ):
105
109
command = self .create_command ('libraries' , '-F' , '--plugin' )
106
- self .run_command (command )
110
+ retval = self .run_command (command )
111
+ if retval != 0 :
112
+ self .retval = retval
107
113
self .send_mail_with_logs (identifier )
108
114
109
115
def sketches (self , identifier = 'cb_compile_tester' ):
110
116
command = self .create_command ('compile_tester' , '-F' , '--plugin' )
111
- self .run_command (command )
117
+ retval = self .run_command (command )
118
+ if retval != 0 :
119
+ self .retval = retval
112
120
self .send_mail_with_logs (identifier )
113
121
114
122
def compile (self , libraries ):
115
123
command = self .create_command ('target_libraries' , '-F' , '--plugin' , '--libraries={}' .format (libraries ))
116
- self .run_command (command )
124
+ retval = self .run_command (command )
125
+ if retval != 0 :
126
+ self .retval = retval
117
127
118
128
def noplugin (self , identifier = 'noplugin' ):
119
129
command = self .create_command ('noplugin' )
120
130
retval = self .run_command (command )
121
131
if retval != 0 :
132
+ self .retval = retval
122
133
self .send_mail_no_logs (identifier )
123
134
124
135
def walkthrough (self , identifier = 'walkthrough' ):
@@ -133,15 +144,20 @@ def walkthrough(self, identifier='walkthrough'):
133
144
134
145
retval = max (retvals )
135
146
if retval != 0 :
147
+ self .retval = retval
136
148
self .send_mail_no_logs (identifier )
137
149
138
150
def staging (self ):
139
151
command = self .create_command ('compile_tester' , '-F' , '--plugin' )
140
- self .run_command (command )
152
+ retval = self .run_command (command )
153
+ if retval != 0 :
154
+ self .retval = retval
141
155
142
156
def delete (self ):
143
157
command = self .create_command ('delete_sketches' )
144
- self .run_command (command )
158
+ retval = self .run_command (command )
159
+ if retval != 0 :
160
+ self .retval = retval
145
161
146
162
OPERATIONS = {
147
163
'common' :'\t Test site common functionality' ,
@@ -281,5 +297,8 @@ def main():
281
297
tests = Tests (target , config )
282
298
tests .run (operation , test = test , libraries = libraries )
283
299
300
+ print ('Tests exit code:' , tests .retval )
301
+ sys .exit (tests .retval )
302
+
284
303
if __name__ == '__main__' :
285
304
main ()
0 commit comments