1414
1515class Tests :
1616 def __init__ (self , url , environment ):
17+ self .retval = 0
1718 self .url = url
1819 self .environment = os .path .abspath (environment )
1920 self .email = os .getenv ('EMAIL' , 'void@mail.0' )
@@ -94,31 +95,41 @@ def common(self, test, identifier='common'):
9495 command = self .create_command (test_directory , '--plugin' )
9596 retval = self .run_command (command )
9697 if retval != 0 :
98+ self .retval = retval
9799 self .send_mail_no_logs (identifier )
98100
99101 def libraries (self , identifier = 'libraries_fetch' ):
100102 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
102106 self .send_mail_with_logs (identifier )
103107
104108 def examples (self , identifier = 'libraries_test' ):
105109 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
107113 self .send_mail_with_logs (identifier )
108114
109115 def sketches (self , identifier = 'cb_compile_tester' ):
110116 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
112120 self .send_mail_with_logs (identifier )
113121
114122 def compile (self , libraries ):
115123 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
117127
118128 def noplugin (self , identifier = 'noplugin' ):
119129 command = self .create_command ('noplugin' )
120130 retval = self .run_command (command )
121131 if retval != 0 :
132+ self .retval = retval
122133 self .send_mail_no_logs (identifier )
123134
124135 def walkthrough (self , identifier = 'walkthrough' ):
@@ -133,15 +144,20 @@ def walkthrough(self, identifier='walkthrough'):
133144
134145 retval = max (retvals )
135146 if retval != 0 :
147+ self .retval = retval
136148 self .send_mail_no_logs (identifier )
137149
138150 def staging (self ):
139151 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
141155
142156 def delete (self ):
143157 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
145161
146162OPERATIONS = {
147163 'common' :'\t Test site common functionality' ,
@@ -281,5 +297,8 @@ def main():
281297 tests = Tests (target , config )
282298 tests .run (operation , test = test , libraries = libraries )
283299
300+ print ('Tests exit code:' , tests .retval )
301+ sys .exit (tests .retval )
302+
284303if __name__ == '__main__' :
285304 main ()
0 commit comments