Make scripted tests portable (e.g. to mac)

This commit is contained in:
James Crook 2019-04-10 15:04:09 +01:00
parent 5739c579fa
commit 0f256df79d
5 changed files with 16 additions and 7 deletions

1
.gitignore vendored
View File

@ -201,3 +201,4 @@ win/resetPrefs.txt
win/xaudacity.ico win/xaudacity.ico
*.sublime-project *.sublime-project
*.sublime-workspace *.sublime-workspace
/tests/results/*.png

View File

@ -73,14 +73,22 @@ def quickTest() :
def setup() : def setup() :
global path global path
global sample_path global sample_path
global result_path
global sample global sample
global sample2 global sample2
global postfix global postfix
postfix = '' postfix = ''
path = 'C:\\Users\\James Crook\\' path = os.path.abspath(__file__);
sample_path ='C:\\Users\\James Crook\\Music\\'
sample ='C:\\Users\\James Crook\\Music\\The Poodle Podcast.wav' path = os.path.dirname( path )
sample2 ='C:\\Users\\James Crook\\Music\\PoodlePodStereo.wav' path = os.path.dirname( path )
path = os.path.dirname( path )
path = os.path.join( path, 'tests' )
result_path = os.path.join( path, 'results' )
sample_path = os.path.join( path, 'samples' )
sample = os.path.join( sample_path, 'FifeAndDrums.wav' )
sample2 = os.path.join( sample_path, 'FifeAndDrumsStereo.wav' )
startPipes() startPipes()
do( 'SetProject: X=10 Y=10 Width=910 Height=800' ) do( 'SetProject: X=10 Y=10 Width=910 Height=800' )
@ -92,15 +100,15 @@ def makeWayForTracks( ) :
do( 'RemoveTracks' ) do( 'RemoveTracks' )
def capture( name, what ) : def capture( name, what ) :
global path global result_path
global postfix global postfix
name = name.split( '.png' )[0] + postfix + '.png' name = name.split( '.png' )[0] + postfix + '.png'
do( 'Screenshot: Path="'+path+name+'" CaptureWhat=' + what ) do( 'Screenshot: Path="'+os.path.join( result_path, name) +'" CaptureWhat=' + what )
def loadExample( name ): def loadExample( name ):
global sample_path global sample_path
makeWayForTracks( ) makeWayForTracks( )
do( 'Import2: Filename="'+sample_path+name+'"' ) do( 'Import2: Filename="'+os.path.join( sample_path, name)+'"' )
do( 'Select: Start=0 End=0') do( 'Select: Start=0 End=0')
do( 'FitInWindow' ) do( 'FitInWindow' )

Binary file not shown.

Binary file not shown.

Binary file not shown.