def do_cmake_build(abs_project_path, build_dir, board_type, port, processor=None, target_conditions=None):
		helper_functions.remove_directory(build_dir)

		try:
			os.makedirs(build_dir)
		except OSError:
			logger.exception('Failed to create build directory')
			return build_result(-1, '')

		command = ['cmake', '-DJENKINS_BUILD=TRUE', '-DUSE_ARDUINO=TRUE', '-DBOARD=' + board_type, '-DPORT=' + port,
				   '-DBAUD_RATE=' + str(configuration.baud_rate)]

		if target_conditions is not None:
			for target_condition in target_conditions:
				if target_condition.cs_pin is not None:
					command.append('-D' + target_condition.library + '_CS=' + str(target_condition.cs_pin))

		if processor is not None:
			command.append('-DPROCESSOR=' + processor)

		command.append(abs_project_path)

		proc = subprocess.Popen(command, cwd=build_dir, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
								universal_newlines=True)
		output = helper_functions.process_output_stream(proc)

		return build_result(proc.returncode, output)
	def execute_make_target(target_name, build_dir, fast):
		if fast:
			target_name += '/fast'

		proc = subprocess.Popen(['make', target_name], cwd=build_dir, stdout=subprocess.PIPE, 
		                        stderr=subprocess.STDOUT, universal_newlines=True)
		output = helper_functions.process_output_stream(proc)

		return build_result(proc.returncode, output)
Exemplo n.º 3
0
    test_exec = os.path.basename(abstest_path)
    planck_outputfname = os.path.join(
        configuration.pc_output_path,
        'planckunit_{testname}_output.txt').format(testname=test_exec)
    xunit_outputfname = os.path.join(
        configuration.pc_output_path,
        'xunit_{testname}_output.txt').format(testname=test_exec)

    args = {
        'stdout': subprocess.PIPE,
        'stderr': subprocess.STDOUT,
        'universal_newlines': True
    }

    proc = subprocess.Popen(['chmod', '+x', abstest_path], **args)
    helper_functions.process_output_stream(proc)

    proc = subprocess.Popen([abstest_path],
                            cwd=os.path.join(configuration.pc_build_path,
                                             'bin'),
                            **args)
    output = helper_functions.process_output_stream(proc)
    with open(planck_outputfname, 'w') as planck_output:
        planck_output.write(output)

    logger.info('Adapting {pl} -> {xl}...'.format(pl=planck_outputfname,
                                                  xl=xunit_outputfname))
    with open(planck_outputfname,
              'r+') as planck_file, open(xunit_outputfname,
                                         'w+') as xunit_file:
        pxa.PlanckAdapter(test_exec, planck_file,
Exemplo n.º 4
0
import configuration

sys.path.append('helper_files/')
import helper_functions

logger = logging.getLogger(__name__)
logger.addHandler(configuration.pc_logger)
logger.addHandler(configuration.console_logger)


logger.info('Starting pc build')

proc = subprocess.Popen(['cmake', '-DCOVERAGE_TESTING=ON', '-DJENKINS_BUILD=ON', configuration.project_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
						universal_newlines=True, cwd=configuration.pc_build_path)
helper_functions.process_output_stream(proc)

if proc.returncode != 0:
	logger.error('Generating Makefiles with CMake failed')
	sys.exit(0)

proc = subprocess.Popen(['make', 'all'], cwd=configuration.pc_build_path, stdout=subprocess.PIPE,
						stderr=subprocess.STDOUT, universal_newlines=True)
helper_functions.process_output_stream(proc)

if proc.returncode != 0:
	logger.error('Some or all tests failed to compile')
	sys.exit(0)

logger.info('Build process finished')
Exemplo n.º 5
0
    help="Whether or not to do a rapid build. (Disables many slow profilers)")
p_args = parser.parse_args()

arguments = {
    'stdout': subprocess.PIPE,
    'stderr': subprocess.STDOUT,
    'universal_newlines': True
}

# Convert coverage information
command = [
    'gcovr', '--branches', '--xml', '-o',
    os.path.join(configuration.pc_output_path, 'gcovr.xml')
]
proc = subprocess.Popen(command, **arguments)
helper_functions.process_output_stream(proc, logging.INFO)

command = [
    'gcovr', '--branches', '--html', '--html-details', '-o',
    os.path.join(configuration.pc_output_path, 'gcovr-report.html')
]
proc = subprocess.Popen(command, **arguments)
helper_functions.process_output_stream(proc, logging.INFO)

# Build Doxygen
iondb_doxy_path = os.path.join(configuration.project_path,
                               'documentation/doxygen/iondb_template')
command = ['doxygen', 'iondb_template']
if p_args.rapid:
    # If we're a rapid build, we skip all graph generation
    rapid_doxy_path = os.path.join(configuration.project_path,
logger = logging.getLogger(__name__)
logger.addHandler(configuration.pc_logger)
logger.addHandler(configuration.console_logger)

parser = argparse.ArgumentParser()
parser.add_argument("-r", "--rapid", action='store_true',
                    help="Whether or not to do a rapid build. (Disables many slow profilers)")
p_args = parser.parse_args()

arguments = {'stdout': subprocess.PIPE, 'stderr': subprocess.STDOUT, 'universal_newlines': True}

# Convert coverage information
command = ['gcovr', '--branches', '--xml', '-o', os.path.join(configuration.pc_output_path, 'gcovr.xml')]
proc = subprocess.Popen(command, **arguments)
helper_functions.process_output_stream(proc, logging.INFO)

command = ['gcovr', '--branches', '--html', '--html-details',
		   '-o', os.path.join(configuration.pc_output_path, 'gcovr-report.html')]
proc = subprocess.Popen(command, **arguments)
helper_functions.process_output_stream(proc, logging.INFO)

# Build Doxygen
iondb_doxy_path = os.path.join(configuration.project_path,'documentation/doxygen/iondb_template')
command = ['doxygen', 'iondb_template']
if p_args.rapid:
	# If we're a rapid build, we skip all graph generation
	rapid_doxy_path = os.path.join(configuration.project_path,'documentation/doxygen/rapid_template')
	with open(iondb_doxy_path, 'r') as doxy_temp, open(rapid_doxy_path, 'w') as rapid_temp:
		doxygen_adapter.doxy_adapt(doxy_temp, rapid_temp)