Changeset 98074 in vbox for trunk/src/VBox/ValidationKit/tests
- Timestamp:
- Jan 13, 2023 1:08:38 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 155202
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py
r98070 r98074 977 977 return True; 978 978 979 def _executeTestCase(self, oTestVm, sName, sF ullPath, sTestCaseSubDir, oDevNull): # pylint: disable=too-many-locals,too-many-statements979 def _executeTestCase(self, oTestVm, sName, sFilePathAbs, sTestCaseSubDir, oDevNull): # pylint: disable=too-many-locals,too-many-statements 980 980 """ 981 981 Executes a test case. 982 983 sFilePathAbs contains the absolute path (including OS-dependent executable suffix) of the testcase. 984 985 Returns @c true if testcase was skipped, or @c if not. 982 986 """ 983 987 … … 1005 1009 asDirsToRemove.append(sDstDir); 1006 1010 1007 sSrc = sF ullPath + self.sExeSuff;1011 sSrc = sFilePathAbs; 1008 1012 # If the testcase source does not exist for whatever reason, just mark it as skipped 1009 1013 # instead of reporting an error. … … 1013 1017 return fSkipped; 1014 1018 1015 sDst = os.path.join(sDstDir, os.path.basename(sF ullPath) + self.sExeSuff);1019 sDst = os.path.join(sDstDir, os.path.basename(sFilePathAbs)); 1016 1020 fModeExe = 0; 1017 1021 fModeDeps = 0; … … 1035 1039 # Copy any associated .dll/.so/.dylib. 1036 1040 for sSuff in [ '.dll', '.so', '.dylib' ]: 1037 sSrc = os.path.splitext(sF ullPath)[0] + sSuff;1041 sSrc = os.path.splitext(sFilePathAbs)[0] + sSuff; 1038 1042 if os.path.exists(sSrc): 1039 1043 sDst = os.path.join(sDstDir, os.path.basename(sSrc)); … … 1042 1046 1043 1047 # Copy any associated .r0, .rc and .gc modules. 1044 offDriver = sF ullPath.rfind('Driver')1048 offDriver = sFilePathAbs.rfind('Driver') 1045 1049 if offDriver > 0: 1046 1050 for sSuff in [ '.r0', 'RC.rc', 'RC.gc' ]: 1047 sSrc = sF ullPath[:offDriver] + sSuff;1051 sSrc = sFilePathAbs[:offDriver] + sSuff; 1048 1052 if os.path.exists(sSrc): 1049 1053 sDst = os.path.join(sDstDir, os.path.basename(sSrc)); … … 1051 1055 asFilesToRemove.append(sDst); 1052 1056 1053 sF ullPath = os.path.join(sDstDir, os.path.basename(sFullPath));1057 sFilePathAbs = os.path.join(sDstDir, os.path.basename(sFilePathAbs)); 1054 1058 1055 1059 # 1056 1060 # Set up arguments and environment. 1057 1061 # 1058 asArgs = [sF ullPath + self.sExeSuff,]1062 asArgs = [sFilePathAbs,] 1059 1063 if sName in self.kdArguments: 1060 1064 asArgs.extend(self.kdArguments[sName]); … … 1139 1143 1140 1144 if iRc == 0: 1141 reporter.log('*** %s: exit code %d' % (sF ullPath, iRc));1145 reporter.log('*** %s: exit code %d' % (sFilePathAbs, iRc)); 1142 1146 self.cPassed += 1; 1143 1147 1144 1148 elif iRc == 4: # RTEXITCODE_SKIPPED 1145 reporter.log('*** %s: exit code %d (RTEXITCODE_SKIPPED)' % (sF ullPath, iRc));1149 reporter.log('*** %s: exit code %d (RTEXITCODE_SKIPPED)' % (sFilePathAbs, iRc)); 1146 1150 fSkipped = True; 1147 1151 self.cSkipped += 1; 1148 1152 1149 1153 elif fSkipped: 1150 reporter.log('*** %s: exit code %d (Skipped)' % (sF ullPath, iRc));1154 reporter.log('*** %s: exit code %d (Skipped)' % (sFilePathAbs, iRc)); 1151 1155 self.cSkipped += 1; 1152 1156 … … 1160 1164 if iRc != 1: 1161 1165 reporter.testFailure('Exit status: %d%s' % (iRc, sName)); 1162 reporter.log( '!*! %s: exit code %d%s' % (sF ullPath, iRc, sName));1166 reporter.log( '!*! %s: exit code %d%s' % (sFilePathAbs, iRc, sName)); 1163 1167 else: 1164 reporter.error('!*! %s: exit code %d%s' % (sF ullPath, iRc, sName));1168 reporter.error('!*! %s: exit code %d%s' % (sFilePathAbs, iRc, sName)); 1165 1169 self.cFailed += 1; 1166 1170 … … 1203 1207 1204 1208 for sFilename in asFiles: 1209 # When executing in remote execution mode, make sure to append the executable suffix here, as 1210 # the (white / black) lists do not contain any OS-specific executable suffixes. 1211 if self.sMode in ('remote-exec'): 1212 sFilename = sFilename + self.sExeSuff; 1205 1213 # Separate base and suffix and morph the base into something we 1206 1214 # can use for reporting and array lookups. … … 1214 1222 1215 1223 # Process white list first, if set. 1216 if self.fOnlyWhiteList and not self._isExcluded(sName, self.kdTestCasesWhiteList): 1224 if self.fOnlyWhiteList \ 1225 and not self._isExcluded(sName, self.kdTestCasesWhiteList): 1217 1226 # (No testStart/Done or accounting here!) 1218 1227 reporter.log('%s: SKIPPED (not in white list)' % (sName,)); … … 1220 1229 1221 1230 # Basic exclusion. 1222 if not re.match(sTestCasePattern, sBaseName) or sSuffix in self.kasSuffixBlackList: 1231 if not re.match(sTestCasePattern, sBaseName) \ 1232 or sSuffix in self.kasSuffixBlackList: 1223 1233 reporter.log2('"%s" is not a test case.' % (sName,)); 1224 1234 continue; … … 1249 1259 pass; 1250 1260 1251 sFullPath = os.path.normpath(os.path.join(self.sUnitTestsPathSrc, os.path.join(sTestCaseSubDir, sFilename))); 1261 sFilePathAbs = os.path.normpath(os.path.join(self.sUnitTestsPathSrc, os.path.join(sTestCaseSubDir, sFilename))); 1262 reporter.log2('sFilePathAbs=%s\n' % (sFilePathAbs,)); 1252 1263 reporter.testStart(sName); 1253 1264 try: 1254 fSkipped = self._executeTestCase(oTestVm, sName, sF ullPath, sTestCaseSubDir, oDevNull);1265 fSkipped = self._executeTestCase(oTestVm, sName, sFilePathAbs, sTestCaseSubDir, oDevNull); 1255 1266 except: 1256 1267 reporter.errorXcpt('!*!');
Note:
See TracChangeset
for help on using the changeset viewer.