Boost logo

Boost Testing :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2006-02-26 04:51:41


Vladimir Prus wrote:
>Reece Dunn wrote:
>
> > I have found another issue with pregression.py. After doing a V2 run,
> > status contains directories and filenames that have a character that is
> > displayed as a square (unrepresentable). I.e., it is testing for Unicode
> > characters. However, when regression.py is removing a previous boost
>run,
> > I get the following error:
>
>Strange. Then stock version of regression.py should have the same problem
>as
>I did not change anything. Maybe it's just was never detected.

This was fixed in the Boost version of regression.py using:
   shutils.rmtree( unicode( path ))

(see my updated regression.py that fixes this issue and an issue when
running monitored builds).

> > Another question: I am using cygwin bash to run the regression tools,
>but
> > running a Windows version of python, so is it possible to detect this
> > situation and use the unix/cygwin tools?
>
>Can you clarify?

At the moment, regression.py is using cmd.exe and del to perform the
regression tests when I use a Windows version of Python, even though I have
cygwin installed. Since I have cygwin installed, I would like to use rm,
tee, etc. even if I am running the Windows version of Python.

This can be fixed by using this function:

def platform_id():
    if sys.platform == 'win32':
        # Try to use the tee command (part of cygwin and mingw
distributions)
        text = 'Is this really cygwin?'
        file = 'cygwin-test.tst'
        os.system( 'echo %s 2>&1 | tee %s 2>&1 >nul' % ( text, file ))

        # If the test file exists, then we have tee...
        if os.path.exists( file ):
            line = open( file ).readline().replace( ' \r\n', '' )
            os.unlink( file )

            # If the file contains the text we outputted, assume the cygwin
            # tools are available...
            if line == text:
                return 'cygtools'

    return sys.platform

Also, my cygwin version of python chokes on the call to platform.system():

Traceback (most recent call last):
  File "./regression.py", line 918, in ?
    commands[ command ]( **accept_args( args ) )
  File "./regression.py", line 804, in accept_args
    options = {
  File "./regression.py", line 107, in platform_name
    return platform.system()
AttributeError: 'module' object has no attribute 'system'

The fix is to have:

def platform_name():
    if sys.platform == 'win32':
        return 'Windows'
    elif sys.platform == 'cygwin':
        return 'Windows/Cygwin'

    return platform.system()

- Reece


Boost-testing list run by mbergal at meta-comm.com