VirtualBox

Changeset 94506 in vbox for trunk/src


Ignore:
Timestamp:
Apr 7, 2022 7:32:16 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
150849
Message:

Validation Kit/unit tests: Determine the executable suffixes right before running the unit tests, as this needs to be handled when we also know the guest OS' type. ​bugref:10195

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py

    r94417 r94506  
    380380        self.sUnitTestsPathDst = None;
    381381
    382         self.sExeSuff   = '.exe' if utils.getHostOs() in [ 'win', 'dos', 'os2' ] else '';
     382        # Will be determined before executing the actual unit tests.
     383        self.sExeSuff   = '';
    383384
    384385        self.aiVBoxVer  = (4, 3, 0, 0);
     
    623624        Main function to execute all unit tests.
    624625        """
     626
     627        # Determine executable suffix based on selected execution mode.
     628        if self.sMode.startswith('remote'): # Run on a test VM (guest).
     629            if oTestVm.isWindows():
     630                self.sExeSuff = '.exe';
     631            else:
     632                self.sExeSuff = '';
     633        else:
     634            self.sExeSuff = '.exe' if utils.getHostOs() in [ 'win', 'dos', 'os2' ] else '';
     635
    625636        self._testRunUnitTestsSet(r'^tst*', 'testcase');
    626637        self._testRunUnitTestsSet(r'^tst*', '.');
     
    937948
    938949            sDst = os.path.join(sDstDir, os.path.basename(sFullPath));
    939             self._wrapCopyFile(sFullPath, sDst, 0o755);
     950            self._wrapCopyFile(sFullPath + self.sExeSuff, sDst, 0o755);
    940951            asFilesToRemove.append(sDst);
    941952
     
    11291140                sName = sTestCaseSubDir + '/' + sName;
    11301141
    1131             reporter.log2('sTestCasePattern=%s, sBaseName=%s, sName=%s, sFileName=%s' \
    1132                           % (sTestCasePattern, sBaseName, sName, sFilename,));
     1142            reporter.log2('sTestCasePattern=%s, sBaseName=%s, sName=%s, sSuffix=%s, sFileName=%s' \
     1143                          % (sTestCasePattern, sBaseName, sName, sSuffix, sFilename,));
    11331144
    11341145            # Process white list first, if set.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette