@@ -1217,7 +1217,13 @@ def build_test_cmake(self, test, opts="", outfile=None):
12171217 outfile = outfile )
12181218
12191219 # make returns 0 if everything was good
1220- if rc == 0 :
1220+ if rc != 0 :
1221+ self .log .fail ("Failed to build test " + test .name )
1222+
1223+ # if we built a binary executable, we need to rename it into a
1224+ # GNUmake-like naming scheme so that the rest of the test logic can
1225+ # pick it up
1226+ elif not test .run_as_script :
12211227 # Find location of executable
12221228 path_to_exe = None
12231229
@@ -1239,8 +1245,9 @@ def build_test_cmake(self, test, opts="", outfile=None):
12391245 break
12401246
12411247 if path_to_bin is None :
1242- self .log .warn ("build successful but binary directory not found" )
1243- rc = 1
1248+ if not test .customRunCmd :
1249+ self .log .warn ("build successful but binary directory not found" )
1250+ rc = 1
12441251 else :
12451252 # Find location of executable
12461253 for root , dirnames , filenames in os .walk (path_to_bin ):
@@ -1254,14 +1261,13 @@ def build_test_cmake(self, test, opts="", outfile=None):
12541261 break
12551262
12561263 if path_to_exe is None :
1257- self .log .warn ("build successful but executable not found" )
1258- rc = 1
1264+ if not test .customRunCmd :
1265+ self .log .warn ("build successful but executable not found" )
1266+ rc = 1
12591267 else :
12601268 # Copy and rename executable to test dir
12611269 shutil .move (f"{ path_to_exe } " ,
12621270 f"{ self .source_dir } /{ test .buildDir } /{ test .name } .ex" )
1263- else :
1264- self .log .fail ("Failed to build test " + test .name )
12651271
12661272 return comp_string , rc
12671273
0 commit comments