def do_dc_offset_removal_test(testlevel): # Check if the test is running in an environment with hardware resources # available - the test takes a long time to run in the simulator args = xmostest.getargs() if not args.remote_resourcer: # Abort the test print 'remote resourcer not avaliable' return binary = 'test_dc_offset_removal/bin/test_dc_offset_removal.xe' tester = xmostest.ComparisonTester(open('test_dc_offset_removal.expect'), 'lib_mic_array', 'lib_mic_array_backend_tests', 'dc_offset_removal_test_%s'%testlevel) tester.set_min_testlevel(testlevel) resources = xmostest.request_resource("testrig_os_x_12", tester) run_job = xmostest.run_on_xcore(resources['uac2_xcore200_mc_analysis_device_1'], binary, tester=tester) xmostest.complete_all_jobs()
def do_dc_offset_removal_test(testlevel): # Check if the test is running in an environment with hardware resources # available - the test takes a long time to run in the simulator args = xmostest.getargs() if not args.remote_resourcer: # Abort the test print 'remote resourcer not avaliable' return binary = 'test_dc_offset_removal/bin/test_dc_offset_removal.xe' tester = xmostest.ComparisonTester(open('test_dc_offset_removal.expect'), 'lib_mic_array', 'lib_mic_array_backend_tests', 'dc_offset_removal_test_%s' % testlevel) tester.set_min_testlevel(testlevel) resources = xmostest.request_resource("testrig_os_x_11", tester) run_job = xmostest.run_on_xcore( resources['uac2_xcore200_mc_analysis_device_1'], binary, tester=tester) xmostest.complete_all_jobs()
def do_backend_test(length, frame_count, testlevel): # Check if the test is running in an environment with hardware resources # available - the test takes a long time to run in the simulator args = xmostest.getargs() if not args.remote_resourcer: # Abort the test print 'remote resourcer not avaliable' return binary = 'test_fir_model/bin/COUNT{fc}_{len}/test_fir_model_COUNT{fc}_{len}.xe'.format( fc=frame_count, len=length) tester = xmostest.ComparisonTester(open('fir_model.expect'), 'lib_mic_array', 'lib_mic_array_backend_tests', 'backend_test_%s' % testlevel, { 'frame_count': frame_count, 'length': length }) tester.set_min_testlevel(testlevel) resources = xmostest.request_resource("uac2_xcore200_mc_testrig_os_x_11", tester) run_job = xmostest.run_on_xcore(resources['analysis_device_1'], binary, tester=tester, timeout=3600) xmostest.complete_all_jobs()
def do_backend_test(length, frame_count, testlevel): # Check if the test is running in an environment with hardware resources # available - the test takes a long time to run in the simulator args = xmostest.getargs() if not args.remote_resourcer: # Abort the test print 'remote resourcer not avaliable' return binary = 'test_fir_model/bin/COUNT{fc}_{len}/test_fir_model_COUNT{fc}_{len}.xe'.format(fc=frame_count, len=length) tester = xmostest.ComparisonTester(open('fir_model.expect'), 'lib_mic_array', 'lib_mic_array_backend_tests', 'backend_test_%s'%testlevel, {'frame_count':frame_count, 'length':length}) tester.set_min_testlevel(testlevel) resources = xmostest.request_resource("testrig_os_x_12", tester) run_job = xmostest.run_on_xcore(resources['uac2_xcore200_mc_analysis_device_1'], binary, tester=tester, timeout=3600) xmostest.complete_all_jobs()
def runtest(): # Check if the test is running in an environment with hardware resources # i.e. if not running from usb audio view it will quit. lib_device_control # is in the usb audio view so it will build args = xmostest.getargs() if not args.remote_resourcer: # Abort the test print 'remote resourcer not avaliable' return device_app_name = 'usb_end_to_end_hardware/bin/usb_end_to_end_hardware.xe'.format( ) #This path is relative from xmostest in the view used. goes up and back down to lib_device_control host_app_name = '../../../../lib_device_control/tests/usb_end_to_end_hardware_host/bin/usb_end_to_end_hardware_host.bin' # Setup the tester which will determine and record the result tester = xmostest.CombinedTester( 2, device_control_endtoend_tester("usb", host_app_name, device_app_name)) testlevel = 'smoke' tester.set_min_testlevel(testlevel) board = 'testrig_os_x_12' # Get the hardware resources to run the test on resources = None try: resources = xmostest.request_resource(board, tester, remote_resource_lease_time=30) except xmostest.XmosTestError: print "Unable to find required board %s required to run test" % board tester.shutdown() return env = "" # Start the xCORE DUT device_job = xmostest.run_on_xcore(resources['uac2_xcore200_mc_dut'], device_app_name, do_xe_prebuild=True, tester=tester[0], enable_xscope=True, xscope_handler=None, timeout=30, build_env=env) # Start the control app host_job = xmostest.run_on_pc( resources['host'], [host_app_name], tester=tester[1], timeout=30, initial_delay=10 ) #Enough time for xtag to load firmware and host to enumerate device xmostest.complete_all_jobs()
def do_ssrc_test_iteration(input_sr, output_sr, testlevel): simargs_ssrc = "" resources = xmostest.request_resource("xsim") file_name = file_name_builder() #print ('Running SSRC test iteration SR input = %d, output = %d' % (input_sr, output_sr)) test_files = (os.path.join( "src_output", file_name.output_signal(input_sr, output_sr, "pure_sine")), os.path.join( "src_output", file_name.output_signal(input_sr, output_sr, "inter_modulation"))) golden_files = (os.path.join( "ssrc_test", "expected", file_name.golden_signal(input_sr, output_sr, "pure_sine")), os.path.join( "ssrc_test", "expected", file_name.golden_signal(input_sr, output_sr, "inter_modulation"))) tester = FileComparisonTester(test_files, golden_files, "lib_src", "ssrc_test", str(input_sr) + "->" + str(output_sr), {}, regexp=False, ignore=[]) tester.set_min_testlevel(testlevel) args = [ "-i", os.path.join("src_input", file_name.test_signal(input_sr, "pure_sine")), os.path.join("src_input", file_name.test_signal(input_sr, "inter_modulation")), "-o", test_files[0], test_files[1] ] args += [ "-f", str(input_sr), "-g", str(output_sr), "-n", str(num_in_samps) ] appargs_ssrc = args #print("xsim cmd line = %s" % " ".join(appargs_ssrc)) xmostest.run_on_simulator(resources["xsim"], os.path.join("ssrc_test", "bin", "ssrc_test.xe"), appargs=appargs_ssrc, simargs=simargs_ssrc, tester=tester) xmostest.complete_all_jobs() """Uncomment this line to help debug - ensures that previous test run before next iteration loop. Makes reading stdout easier"""
def runtest(): # Check if the test is running in an environment with hardware resources # i.e. if not running from usb audio view it will quit. lib_device_control # is in the usb audio view so it will build args = xmostest.getargs() if not args.remote_resourcer: # Abort the test print 'remote resourcer not avaliable' return device_app_name = 'usb_end_to_end_hardware/bin/usb_end_to_end_hardware.xe'.format() #This path is relative from xmostest in the view used. goes up and back down to lib_device_control host_app_name = '../../../../lib_device_control/tests/usb_end_to_end_hardware_host/bin/usb_end_to_end_hardware_host.bin' # Setup the tester which will determine and record the result tester = xmostest.CombinedTester(2, device_control_endtoend_tester("usb", host_app_name, device_app_name)) testlevel = 'smoke' tester.set_min_testlevel(testlevel) board = 'testrig_os_x_12' # Get the hardware resources to run the test on resources = None try: resources = xmostest.request_resource(board, tester, remote_resource_lease_time=30) except xmostest.XmosTestError: print "Unable to find required board %s required to run test" % board tester.shutdown() return env = "" # Start the xCORE DUT device_job = xmostest.run_on_xcore(resources['uac2_xcore200_mc_dut'], device_app_name, do_xe_prebuild = True, tester = tester[0], enable_xscope = True, xscope_handler = None, timeout = 30, build_env = env) # Start the control app host_job = xmostest.run_on_pc(resources['host'], [host_app_name], tester = tester[1], timeout = 30, initial_delay = 10) #Enough time for xtag to load firmware and host to enumerate device xmostest.complete_all_jobs()