Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
BUG: Refs #212. Added in some test data to better locations.
Browse files Browse the repository at this point in the history
Part of a process of improving the batchmake tests.
  • Loading branch information
Michael Grauer authored and yuzhengZ committed Oct 18, 2011
1 parent 7d6d406 commit ca564ba
Show file tree
Hide file tree
Showing 22 changed files with 270 additions and 0 deletions.
Empty file.
Empty file.
58 changes: 58 additions & 0 deletions modules/batchmake/tests/testfiles/bin/PixelCounter.bmm
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<BatchMakeApplicationWrapper>
<BatchMakeApplicationWrapperVersion>1.0</BatchMakeApplicationWrapperVersion>
<Module>
<Name>PixelCounter</Name>
<Version>Not defined</Version>
<Path>SET_PATH_TO/PixelCounter</Path>
<Parameters>
<Param>
<Type>4</Type>
<Name>filename</Name>
<Value></Value>
<Parent>0</Parent>
<External>1</External>
<Optional>0</Optional>
</Param>
<Param>
<Type>3</Type>
<Name>threshold</Name>
<Value></Value>
<Parent>0</Parent>
<External>0</External>
<Optional>0</Optional>
</Param>
<Param>
<Type>1</Type>
<Name>GenerateMetaOutput</Name>
<Value>-generateMetaOutput</Value>
<Parent>0</Parent>
<External>0</External>
<Optional>1</Optional>
</Param>
<Param>
<Type>1</Type>
<Name>GenerateXMLMetaOutput</Name>
<Value>-oxml</Value>
<Parent>0</Parent>
<External>0</External>
<Optional>1</Optional>
</Param>
<Param>
<Type>1</Type>
<Name>GenerateXMLFile</Name>
<Value>-ofxml</Value>
<Parent>0</Parent>
<External>0</External>
<Optional>1</Optional>
</Param>
<Param>
<Type>4</Type>
<Name>GenerateXMLFile.GenerateXMLFile</Name>
<Value></Value>
<Parent>3</Parent>
<External>2</External>
<Optional>0</Optional>
</Param>
</Parameters>
</Module>
</BatchMakeApplicationWrapper>
Empty file.
Empty file.
Empty file.
7 changes: 7 additions & 0 deletions modules/batchmake/tests/testfiles/script/CompileErrors.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Should the script end in case of errors
ExitOnError(1)

Echo('This script should not compile')

Foreach(var ${varlist})
Endforeach()
22 changes: 22 additions & 0 deletions modules/batchmake/tests/testfiles/script/Compiles.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Should the script end in case of errors
ExitOnError(1)

# all params are hardcoded, just used to check for creating a dagjob and condor scripts

SetApp(pixelCounter @PixelCounter)
SetAppOption(pixelCounter.threshold 10)
SetAppOption(pixelCounter.GenerateXMLFile 1)

Set(hardcodedlist 'sphere_5.mha' 'sphere_10.mha' 'sphere_15.mha')

# Generic script options
Foreach(file ${hardcodedlist})
GetFilename(stem ${file} NAME_WITHOUT_EXTENSION)

SetAppOption(pixelCounter.filename ${file})
SetAppOption(pixelCounter.GenerateXMLFile.GenerateXMLFile ${stem}.xml)

# Run the application
Run(prog_output ${pixelCounter})

Endforeach(file)
25 changes: 25 additions & 0 deletions modules/batchmake/tests/testfiles/script/Myscript2.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Should the script end in case of errors
ExitOnError(1)

# Imported parameters: cfg_input_directory, cfg_output_directory, cfg_application_directory, cfg_threshold
Include(PixelCounter.config.bms)

# Application setup
SetApp(pixelCounter @PixelCounter)
SetApp(myapp2 @MyApp2)
SetAppOption(pixelCounter.threshold ${cfg_threshold})
SetAppOption(pixelCounter.GenerateXMLFile 1)


# Generic script options
Foreach(file ${cfg_input_cart})
GetFilename(stem ${file} NAME_WITHOUT_EXTENSION)

SetAppOption(pixelCounter.filename ${file})
SetAppOption(pixelCounter.GenerateXMLFile.GenerateXMLFile ${stem}.${cfg_output1}.xml)

# Run the application
CondorPostScript(pixelCounter ${cfg_condorpostscript} ${cfg_midas_baseURL} ${cfg_itemid} ${cfg_email} ${cfg_appname} ${cfg_apikey} ${cfg_output_directory} ${stem}.${cfg_output1}.xml)
Run(prog_output ${pixelCounter})

Endforeach(file)
24 changes: 24 additions & 0 deletions modules/batchmake/tests/testfiles/script/PixelCounter.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Should the script end in case of errors
ExitOnError(1)

# Imported parameters: cfg_input_directory, cfg_output_directory, cfg_application_directory, cfg_threshold
Include(PixelCounter.config.bms)

# Application setup
SetApp(pixelCounter @PixelCounter)
SetAppOption(pixelCounter.threshold ${cfg_threshold})
SetAppOption(pixelCounter.GenerateXMLFile 1)


# Generic script options
Foreach(file ${cfg_input_cart})
GetFilename(stem ${file} NAME_WITHOUT_EXTENSION)

SetAppOption(pixelCounter.filename ${file})
SetAppOption(pixelCounter.GenerateXMLFile.GenerateXMLFile ${stem}.${cfg_output1}.xml)

# Run the application
CondorPostScript(pixelCounter ${cfg_condorpostscript} ${cfg_midas_baseURL} ${cfg_itemid} ${cfg_email} ${cfg_appname} ${cfg_apikey} ${cfg_output_directory} ${stem}.${cfg_output1}.xml)
Run(prog_output ${pixelCounter})

Endforeach(file)
28 changes: 28 additions & 0 deletions modules/batchmake/tests/testfiles/script/anotherscript.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Should the script end in case of errors
ExitOnError(1)

# Imported parameters: cfg_input_directory, cfg_output_directory, cfg_application_directory, cfg_threshold
Include(PixelCounter.config.bms)
Include(PixelCounter.bms)
Include(myscript.bms)
Include(Myscript2.bms)

# Application setup
SetApp(pixelCounter @PixelCounter)
SetApp(anotherapp @AnotherApp)
SetAppOption(pixelCounter.threshold ${cfg_threshold})
SetAppOption(pixelCounter.GenerateXMLFile 1)


# Generic script options
Foreach(file ${cfg_input_cart})
GetFilename(stem ${file} NAME_WITHOUT_EXTENSION)

SetAppOption(pixelCounter.filename ${file})
SetAppOption(pixelCounter.GenerateXMLFile.GenerateXMLFile ${stem}.${cfg_output1}.xml)

# Run the application
CondorPostScript(pixelCounter ${cfg_condorpostscript} ${cfg_midas_baseURL} ${cfg_itemid} ${cfg_email} ${cfg_appname} ${cfg_apikey} ${cfg_output_directory} ${stem}.${cfg_output1}.xml)
Run(prog_output ${pixelCounter})

Endforeach(file)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Should the script end in case of errors
ExitOnError(1)

# Imported parameters: cfg_input_directory, cfg_output_directory, cfg_application_directory, cfg_threshold
Include(nonexistentscript.bms)

# Application setup
SetApp(pixelCounter @PixelCounter)
SetApp(anotherapp @AnotherApp)
SetAppOption(pixelCounter.threshold ${cfg_threshold})
SetAppOption(pixelCounter.GenerateXMLFile 1)


# Generic script options
Foreach(file ${cfg_input_cart})
GetFilename(stem ${file} NAME_WITHOUT_EXTENSION)

SetAppOption(pixelCounter.filename ${file})
SetAppOption(pixelCounter.GenerateXMLFile.GenerateXMLFile ${stem}.${cfg_output1}.xml)

# Run the application
CondorPostScript(pixelCounter ${cfg_condorpostscript} ${cfg_midas_baseURL} ${cfg_itemid} ${cfg_email} ${cfg_appname} ${cfg_apikey} ${cfg_output_directory} ${stem}.${cfg_output1}.xml)
Run(prog_output ${pixelCounter})

Endforeach(file)
23 changes: 23 additions & 0 deletions modules/batchmake/tests/testfiles/script/bmmswitherrors.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Should the script end in case of errors
ExitOnError(1)


# Application setup
SetApp(testapp1 @NoApp)
SetApp(testapp2 @TestApp2)
SetAppOption(pixelCounter.threshold ${cfg_threshold})
SetAppOption(pixelCounter.GenerateXMLFile 1)


# Generic script options
Foreach(file ${cfg_input_cart})
GetFilename(stem ${file} NAME_WITHOUT_EXTENSION)

SetAppOption(pixelCounter.filename ${file})
SetAppOption(pixelCounter.GenerateXMLFile.GenerateXMLFile ${stem}.${cfg_output1}.xml)

# Run the application
CondorPostScript(pixelCounter ${cfg_condorpostscript} ${cfg_midas_baseURL} ${cfg_itemid} ${cfg_email} ${cfg_appname} ${cfg_apikey} ${cfg_output_directory} ${stem}.${cfg_output1}.xml)
Run(prog_output ${pixelCounter})

Endforeach(file)
1 change: 1 addition & 0 deletions modules/batchmake/tests/testfiles/script/cycle1.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Include(cycle1.bms)
2 changes: 2 additions & 0 deletions modules/batchmake/tests/testfiles/script/cycle31.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Include(cycle32.bms)
Include(cycle33.bms)
1 change: 1 addition & 0 deletions modules/batchmake/tests/testfiles/script/cycle32.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Include(cycle33.bms)
1 change: 1 addition & 0 deletions modules/batchmake/tests/testfiles/script/cycle33.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Include(cycle32.bms)
26 changes: 26 additions & 0 deletions modules/batchmake/tests/testfiles/script/myscript.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Should the script end in case of errors
ExitOnError(1)

# Imported parameters: cfg_input_directory, cfg_output_directory, cfg_application_directory, cfg_threshold
Include(PixelCounter.config.bms)
Include(noscripts.bms)

# Application setup
SetApp(pixelCounter @PixelCounter)
SetApp(myapp @myapp)
SetAppOption(pixelCounter.threshold ${cfg_threshold})
SetAppOption(pixelCounter.GenerateXMLFile 1)


# Generic script options
Foreach(file ${cfg_input_cart})
GetFilename(stem ${file} NAME_WITHOUT_EXTENSION)

SetAppOption(pixelCounter.filename ${file})
SetAppOption(pixelCounter.GenerateXMLFile.GenerateXMLFile ${stem}.${cfg_output1}.xml)

# Run the application
CondorPostScript(pixelCounter ${cfg_condorpostscript} ${cfg_midas_baseURL} ${cfg_itemid} ${cfg_email} ${cfg_appname} ${cfg_apikey} ${cfg_output_directory} ${stem}.${cfg_output1}.xml)
Run(prog_output ${pixelCounter})

Endforeach(file)
2 changes: 2 additions & 0 deletions modules/batchmake/tests/testfiles/script/nocycle1.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Include(nocycle2.bms)
Include(nocycle3.bms)
1 change: 1 addition & 0 deletions modules/batchmake/tests/testfiles/script/nocycle2.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Echo('nothing to say')
1 change: 1 addition & 0 deletions modules/batchmake/tests/testfiles/script/nocycle3.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Include(nocycle2.bms)
23 changes: 23 additions & 0 deletions modules/batchmake/tests/testfiles/script/noscripts.bms
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Should the script end in case of errors
ExitOnError(1)


# Application setup
SetApp(testapp1 @TestApp1)
SetApp(testapp2 @TestApp2)
SetAppOption(pixelCounter.threshold ${cfg_threshold})
SetAppOption(pixelCounter.GenerateXMLFile 1)


# Generic script options
Foreach(file ${cfg_input_cart})
GetFilename(stem ${file} NAME_WITHOUT_EXTENSION)

SetAppOption(pixelCounter.filename ${file})
SetAppOption(pixelCounter.GenerateXMLFile.GenerateXMLFile ${stem}.${cfg_output1}.xml)

# Run the application
CondorPostScript(pixelCounter ${cfg_condorpostscript} ${cfg_midas_baseURL} ${cfg_itemid} ${cfg_email} ${cfg_appname} ${cfg_apikey} ${cfg_output_directory} ${stem}.${cfg_output1}.xml)
Run(prog_output ${pixelCounter})

Endforeach(file)

0 comments on commit ca564ba

Please sign in to comment.