Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docker/python3.12/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM alpine:3.23
CMD ["/bin/sh"]
RUN apk add --no-cache python3 py3-pip linux-headers git rsync openssh g++ zlib-dev \
&& ln -sf python3 /usr/bin/python \
&& ln -sf pip3 /usr/bin/pip
WORKDIR /root
10 changes: 10 additions & 0 deletions docker/python3.12/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -xe
image=cppalliance/boost_regression_docker:1
echo image is $image
docker build -t $image .
echo $?
# if [ "$?" = "0" ] ; then
# docker push $image
# fi
24 changes: 13 additions & 11 deletions reports/src/boost_wide_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

from __future__ import print_function

import shutil
import codecs
import xml.sax.handler
Expand Down Expand Up @@ -214,7 +216,7 @@ def _modtime_timestamp( file ):
root_paths = []

def shorten( file_path ):
root_paths.sort( lambda x, y: cmp( len(y ), len( x ) ) )
root_paths.sort( key=lambda x: len(x), reverse=True )
for root in root_paths:
if file_path.lower().startswith( root.lower() ):
return file_path[ len( root ): ].replace( "\\", "/" )
Expand Down Expand Up @@ -280,7 +282,7 @@ def update( self ):
try:
utils.log( ' Unzipping "%s" ... into "%s"' % ( shorten( self.source_ ), os.path.dirname( self.file_path_ ) ) )
self.unzip_func_( self.source_, os.path.dirname( self.file_path_ ) )
except Exception, msg:
except Exception as msg:
utils.log( ' Skipping "%s" due to errors (%s)' % ( self.source_, msg ) )


Expand Down Expand Up @@ -455,7 +457,7 @@ def build_reports(
extended_test_results = os.path.join( output_dir, 'extended_test_results.xml' )

if filter_runners == None:
if default_filter_runners.has_key(tag):
if tag in default_filter_runners:
filter_runners = default_filter_runners[tag]

execute_tasks(
Expand Down Expand Up @@ -511,7 +513,7 @@ def accept_args( args ):
'--comment': ''
, '--expected-results': ''
, '--failures-markup': ''
, '--reports': string.join( report_types, ',' )
, '--reports': ','.join( report_types )
, '--boost-report': None
, '--tag': None
, '--user': None
Expand All @@ -520,10 +522,10 @@ def accept_args( args ):
}

utils.accept_args( args_spec, args, options, usage )
if not options.has_key( '--results-dir' ):
if '--results-dir' not in options:
options[ '--results-dir' ] = options[ '--locate-root' ]

if not options.has_key( '--results-prefix' ):
if '--results-prefix' not in options:
options[ '--results-prefix' ] = 'all'

warnings = []
Expand All @@ -536,19 +538,19 @@ def accept_args( args ):
, options[ '--comment' ]
, options[ '--results-dir' ]
, options[ '--results-prefix' ]
, options.has_key( '--dont-collect-logs' )
, '--dont-collect-logs' in options
, options[ '--reports' ].split( ',' )
, options[ '--boost-report' ]
, warnings
, options[ '--user' ]
, options.has_key( '--upload' )
, '--upload' in options
, options[ '--filter-runners' ]
)


def usage():
print 'Usage: %s [options]' % os.path.basename( sys.argv[0] )
print '''
print('Usage: %s [options]' % os.path.basename( sys.argv[0] ))
print('''
\t--locate-root the same as --locate-root in compiler_status
\t--tag the tag for the results (i.e. 'trunk')
\t--expected-results the file with the results to be compared with
Expand Down Expand Up @@ -578,7 +580,7 @@ def usage():
\t n - runner comment files
\t--filter-runners use only those runners that match specified
\t regex (case insensitive)
'''
''')

def main():
build_reports( *accept_args( sys.argv[ 1 : ] ) )
Expand Down
24 changes: 13 additions & 11 deletions reports/src/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@

from accept_args import *
from char_translation_table import *
from check_existance import *
from checked_system import *
from libxslt import *
from log import *
from makedirs import *
from rename import *
from tar import *
from zip import *
from __future__ import absolute_import

import sourceforge
from utils.accept_args import *
from utils.char_translation_table import *
from utils.check_existance import *
from utils.checked_system import *
from utils.libxslt import *
from utils.log import *
from utils.makedirs import *
from utils.rename import *
from utils.tar import *
from utils.zip import *

from utils import sourceforge
7 changes: 4 additions & 3 deletions reports/src/utils/accept_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ def accept_args( args_spec, args, options, usage ):
defaults_num = len(options)

( option_pairs, rest_args ) = getopt.getopt( args, '', args_spec )
map( lambda x: options.__setitem__( x[0], x[1] ), option_pairs )
for x in option_pairs:
options.__setitem__( x[0], x[1] )

if ( options.has_key( '--help' ) or len( options.keys() ) == defaults_num ):
if ( '--help' in options or len( options.keys() ) == defaults_num ):
usage()
sys.exit( 1 )

Expand All @@ -25,6 +26,6 @@ def accept_args( args_spec, args, options, usage ):
if m:
options[ '--%s' % m.group( 'name' ) ] = m.group( 'value' )
else:
raise 'Invalid format of config line "%s"' % l
raise Exception( 'Invalid format of config line "%s"' % l )

return rest_args
15 changes: 11 additions & 4 deletions reports/src/utils/char_translation_table.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

import sys
import string

def chr_or_question_mark( c ):
Expand All @@ -7,7 +8,13 @@ def chr_or_question_mark( c ):
else:
return '?'

char_translation_table = string.maketrans(
''.join( map( chr, range(0, 256) ) )
, ''.join( map( chr_or_question_mark, range(0, 256) ) )
)
if sys.version_info[0] >= 3:
char_translation_table = bytes.maketrans(
bytes(range(0, 256))
, bytes( bytearray( chr_or_question_mark(c).encode('latin-1')[0] for c in range(0, 256) ) )
)
else:
char_translation_table = string.maketrans(
''.join( map( chr, range(0, 256) ) )
, ''.join( map( chr_or_question_mark, range(0, 256) ) )
)
2 changes: 1 addition & 1 deletion reports/src/utils/checked_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
def system( commands ):
if sys.platform == 'win32':
f = open( 'tmp.cmd', 'w' )
f.write( string.join( commands, '\n' ) )
f.write( '\n'.join( commands ) )
f.close()
rc = os.system( 'tmp.cmd' )
return rc
Expand Down
2 changes: 1 addition & 1 deletion reports/src/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def log_level():
frames = inspect.stack()
level = 0
for i in frames[ 3: ]:
if i[0].f_locals.has_key( '__log__' ):
if '__log__' in i[0].f_locals:
level = level + i[0].f_locals[ '__log__' ]
return level

Expand Down
Loading