Index: test/README.rst
===================================================================
--- test/README.rst	(revision 6c007022258cff8efb5208e90301244c22e30170)
+++ test/README.rst	(revision 6c007022258cff8efb5208e90301244c22e30170)
@@ -0,0 +1,16 @@
+Running Tests
+=============
+
+Tests are stored in subdirectories of the test directory, as
+*package/test/utest_\*.py*.   Other files in the test subdirectory are
+data, expected output and other support files.  Before running any tests
+you must first run *setup.py build* in the root.  Tests are run against the
+current source directory with run magic to find the compiled code, so you
+only need to rebuild between tests if you are modifying the C code.
+
+Tests can be run in Eclipse (or other IDE) by selecting *utest_sansview.py*
+and selecting run.  This will run all of the tests.  To run tests for one
+one package, edit the *utest_sansview.py* run command and add the package
+directory to the command arguments.  To run an individual test,
+select *run_one.py* and edit the command arguments to include the path to
+the desired test file.
Index: test/park_integration/test/test_fit_cylinder.py
===================================================================
--- test/park_integration/test/test_fit_cylinder.py	(revision 5777106e8a4a0a62fe2ee0fbaf7c0aa19c0bb92b)
+++ test/park_integration/test/test_fit_cylinder.py	(revision 6c007022258cff8efb5208e90301244c22e30170)
@@ -4,9 +4,9 @@
 """
 import unittest
+import math
 
 from sans.fit.AbstractFitEngine import Model
-import math
 from sans.fit.Fitting import Fit
-from DataLoader.loader import Loader
+from sans.dataloader.loader import Loader
 
 class TestSingleFit(unittest.TestCase):
@@ -21,5 +21,6 @@
         self.model.setParam("radius",18)
         self.model.setParam("length", 397)
-        self.model.setParam("contrast",3e-006 )
+        self.model.setParam("sldCyl",3e-006 )
+        self.model.setParam("sldSolv",0.0 )
         self.model.setParam("background", 0.0)
         #select parameters to fit
@@ -31,5 +32,5 @@
         fitter.set_data(self.data,1)
         fitter.set_model(self.model,1,self.pars1)
-        fitter.select_problem_for_fit(Uid=1,value=1)
+        fitter.select_problem_for_fit(id=1,value=1)
         return  fitter.fit()
        
@@ -38,5 +39,5 @@
         """ Simple cylinder model fit (scipy)  """
         
-        result1 = self._fit("scipy")
+        result1, = self._fit("scipy")
         
         self.assert_(result1)
@@ -52,5 +53,6 @@
     def test_park(self):
         """ Simple cylinder model fit (park)  """
-        result1 = self._fit("park")
+        #raise NotImplementedError()
+        result1, = self._fit("park")
         
         self.assert_(result1)
@@ -81,5 +83,5 @@
         self.model1.set(radius=18)
         self.model1.set(length=396)
-        self.model1.set(contrast=3e-006 )
+        self.model1.set(sldCyl=3e-006, sldSolv=0.0)
         self.model1.set(background=0.0)
         
@@ -90,5 +92,5 @@
         self.model2.set(radius=37)
         self.model2.set(length='C1.length')
-        self.model2.set(contrast=3e-006 )
+        self.model2.set(sldCyl=3e-006, sldSolv=0.0)
         self.model2.set(background=0.0)
        
@@ -101,6 +103,6 @@
         fitter.set_data(self.data2,2)
         fitter.set_model(self.model2, 2, ['radius','scale'])
-        fitter.select_problem_for_fit(Uid=1,value=1)
-        fitter.select_problem_for_fit(Uid=2,value=1)
+        fitter.select_problem_for_fit(id=1,value=1)
+        fitter.select_problem_for_fit(id=2,value=1)
         return fitter.fit()
     
@@ -108,6 +110,6 @@
     def test_park2(self):
         """ Simultaneous cylinder model fit (park)  """
-        
-        result1= self._fit('park')
+        #raise NotImplementedError()
+        result1,= self._fit('park')
         self.assert_(result1)
         self.assertTrue(len(result1.pvec)>=0  )
Index: test/park_integration/test/test_fit_line.py
===================================================================
--- test/park_integration/test/test_fit_line.py	(revision 5777106e8a4a0a62fe2ee0fbaf7c0aa19c0bb92b)
+++ test/park_integration/test/test_fit_line.py	(revision 6c007022258cff8efb5208e90301244c22e30170)
@@ -6,4 +6,9 @@
 
 from sans.fit.AbstractFitEngine import Model
+from sans.dataloader.loader import Loader
+from sans.fit.Fitting import Fit
+from sans.models.LineModel import LineModel
+from sans.models.Constant import Constant
+
 import math
 class testFitModule(unittest.TestCase):
@@ -13,14 +18,11 @@
         """ Fit 1 data (testdata_line.txt)and 1 model(lineModel) """
         #load data
-        from DataLoader.loader import Loader
         data = Loader().load("testdata_line.txt")
         #Importing the Fit module
-        from sans.fit.Fitting import Fit
         fitter = Fit('scipy')
         # Receives the type of model for the fitting
-        from sans.models.LineModel import LineModel
         model1  = LineModel()
         model1.name = "M1"
-        model = Model(model1)
+        model = Model(model1,data)
         #fit with scipy test
         
@@ -28,19 +30,17 @@
         fitter.set_data(data,1)
         try:fitter.set_model(model,1,pars1)
-        except ValueError,msg:
-            print "ValueError was raised: "+str(msg)
-            #assert str(msg)=="wrong paramter %s used to set model %s. Choose\
-            #                 parameter name within %s"%('param1', model.model.name,str(model.model.getParamList()))
-        else: raise AssertError,"No error raised for scipy fitting with wrong parameters name to fit"
-        pars1= ['A','B']
-        fitter.set_model(model,1,pars1)
-        fitter.select_problem_for_fit(id=1,value=1)
-        result1 = fitter.fit()
-        self.assert_(result1)
-        
-        self.assertTrue( math.fabs(result1.pvec[0]-4)/3 <= result1.stderr[0] )
-        self.assertTrue( math.fabs(result1.pvec[1]-2.5)/3 <= result1.stderr[1])
-        self.assertTrue( result1.fitness/len(data.x) < 2 )
-        
+        except ValueError,exc:
+            #print "ValueError was correctly raised: "+str(msg)
+            assert str(exc).startswith('wrong parameter')
+        else: raise AssertionError("No error raised for scipy fitting with wrong parameters name to fit")
+        pars1= ['A','B']
+        fitter.set_model(model,1,pars1)
+        fitter.select_problem_for_fit(id=1,value=1)
+        result, = fitter.fit()
+
+        self.assertTrue( math.fabs(result.pvec[0]-4)/3 <= result.stderr[0] )
+        self.assertTrue( math.fabs(result.pvec[1]-2.5)/3 <= result.stderr[1])
+        self.assertTrue( result.fitness/len(data.x) < 2 )
+
         #fit with park test
         fitter = Fit('park')
@@ -66,5 +66,4 @@
         """ fit 2 data and 2 model with no constrainst"""
         #load data
-        from DataLoader.loader import Loader
         l = Loader()
         data1=l.load("testdata_line.txt")
@@ -73,8 +72,6 @@
      
         #Importing the Fit module
-        from sans.fit.Fitting import Fit
         fitter = Fit('scipy')
         # Receives the type of model for the fitting
-        from sans.models.LineModel import LineModel
         model11  = LineModel()
         model11.name= "M1"
@@ -93,5 +90,5 @@
         fitter.select_problem_for_fit(id=2,value=0)
         
-        try: result1 = fitter.fit()
+        try: result1, = fitter.fit()
         except RuntimeError,msg:
            assert str(msg)=="No Assembly scheduled for Scipy fitting."
@@ -99,5 +96,5 @@
         fitter.select_problem_for_fit(id=1,value=1)
         fitter.select_problem_for_fit(id=2,value=1)
-        try: result1 = fitter.fit()
+        try: result1, = fitter.fit()
         except RuntimeError,msg:
            assert str(msg)=="Scipy can't fit more than a single fit problem at a time."
@@ -123,5 +120,4 @@
         """ fit 2 data and 2 model with 1 constrainst"""
         #load data
-        from DataLoader.loader import Loader
         l = Loader()
         data1= l.load("testdata_line.txt")
@@ -129,5 +125,4 @@
        
         # Receives the type of model for the fitting
-        from sans.models.LineModel import LineModel
         model11  = LineModel()
         model11.name= "line"
@@ -135,5 +130,4 @@
         model11.setParam("B",1.0)
         
-        from sans.models.Constant import Constant
         model22  = Constant()
         model22.name= "cst"
@@ -151,5 +145,4 @@
         
         #Importing the Fit module
-        from sans.fit.Fitting import Fit
         fitter = Fit('park')
         fitter.set_data(data1,1)
@@ -170,5 +163,4 @@
         """ fit 2 data concatenates with limited range of x and  one model """
             #load data
-        from DataLoader.loader import Loader
         l = Loader()
         data1 = l.load("testdata_line.txt")
@@ -177,5 +169,4 @@
        
         # Receives the type of model for the fitting
-        from sans.models.LineModel import LineModel
         model1  = LineModel()
         model1.name= "M1"
@@ -187,5 +178,4 @@
         pars1= ['A','B']
         #Importing the Fit module
-        from sans.fit.Fitting import Fit
         fitter = Fit('scipy')
         fitter.set_data(data1,1,qmin=0, qmax=7)
@@ -194,5 +184,5 @@
         fitter.select_problem_for_fit(id=1,value=1)
         
-        result1 = fitter.fit()
+        result1, = fitter.fit()
         self.assert_(result1)
 
Index: test/park_integration/test/test_fit_smeared.py
===================================================================
--- test/park_integration/test/test_fit_smeared.py	(revision 5777106e8a4a0a62fe2ee0fbaf7c0aa19c0bb92b)
+++ test/park_integration/test/test_fit_smeared.py	(revision 6c007022258cff8efb5208e90301244c22e30170)
@@ -4,9 +4,12 @@
 """
 import unittest
-from sans.fit.AbstractFitEngine import Model
 import math
 import numpy
+from sans.fit.AbstractFitEngine import Model
 from sans.fit.Fitting import Fit
-from DataLoader.loader import Loader
+from sans.dataloader.loader import Loader
+from sans.models.qsmearing import smear_selection
+from sans.models.CylinderModel import CylinderModel
+from sans.models.SphereModel import SphereModel
 
 class testFitModule(unittest.TestCase):
@@ -24,7 +27,7 @@
         
         # Receives the type of model for the fitting
-        from sans.models.CylinderModel import CylinderModel
         model1  = CylinderModel()
-        model1.setParam('contrast', 1)
+        model1.setParam('sldCyl', 3.0e-6)
+        model1.setParam('sldSolv', 0.0)
         model = Model(model1)
         model.set(scale=1e-10)
@@ -33,6 +36,6 @@
         
         # What the hell is this line for?
-        fitter.select_problem_for_fit(Uid=1,value=1)
-        result1 = fitter.fit()
+        fitter.select_problem_for_fit(id=1,value=1)
+        result1, = fitter.fit()
         
         self.assert_(result1)
@@ -60,8 +63,8 @@
         fitter = Fit('scipy')
         # Receives the type of model for the fitting
-        from sans.models.CylinderModel import CylinderModel
         model1  = CylinderModel()
-        model1.setParam('contrast', 1)
-        
+        model1.setParam('sldCyl', 3.0e-6)
+        model1.setParam('sldSolv', 0.0)
+
         # Dispersion parameters
         model1.dispersion['radius']['width'] = 0.001
@@ -74,6 +77,6 @@
         model.set(scale=1e-10)
         fitter.set_model(model,1,pars1)
-        fitter.select_problem_for_fit(Uid=1,value=1)
-        result1 = fitter.fit()
+        fitter.select_problem_for_fit(id=1,value=1)
+        result1, = fitter.fit()
         
         self.assert_(result1)
@@ -97,5 +100,4 @@
         print "TEST DONE WITHOUT PROPER OUTPUT CHECK:"
         print "   ---> TEST NEEDS TO BE COMPLETED"
-        from sans.models.SphereModel import SphereModel
         data = Loader().load("latex_smeared.xml")
         self.data_res = data[0]
@@ -109,6 +111,5 @@
         
     def test_reso(self):
-        from DataLoader.qsmearing import smear_selection
-        
+
         # Let the data module find out what smearing the
         # data needs
@@ -123,5 +124,5 @@
         # data for a given fit.
         fitter.set_data(self.data_res,1)
-        fitter._engine.fitArrangeDict[1].dList[0].smearer = smear
+        fitter._engine.fit_arrange_dict[1].data_list[0].smearer = smear
         print "smear ",smear
         # Model: maybe there's a better way to do this.
@@ -130,8 +131,8 @@
         
         # Why do we have to do this...?
-        fitter.select_problem_for_fit(Uid=1,value=1)
+        fitter.select_problem_for_fit(id=1,value=1)
         
         # Perform the fit (might take a while)
-        result1 = fitter.fit()
+        result1, = fitter.fit()
         
         # Replace this with proper test once we know what the
@@ -141,6 +142,4 @@
         
     def test_slit(self):
-        from DataLoader.qsmearing import smear_selection
-        
         smear = smear_selection(self.data_slit)
         self.assertEqual(smear.__class__.__name__, 'SlitSmearer')
@@ -153,12 +152,12 @@
         # data for a given fit.
         fitter.set_data(self.data_slit,1)
-        fitter._engine.fitArrangeDict[1].dList[0].smearer = smear
-        fitter._engine.fitArrangeDict[1].dList[0].qmax = 0.003
+        fitter._engine.fit_arrange_dict[1].data_list[0].smearer = smear
+        fitter._engine.fit_arrange_dict[1].data_list[0].qmax = 0.003
         
         # Model
         fitter.set_model(Model(self.sphere),1, ['radius','scale'])
-        fitter.select_problem_for_fit(Uid=1,value=1)
+        fitter.select_problem_for_fit(id=1,value=1)
         
-        result1 = fitter.fit()
+        result1, = fitter.fit()
         
         # Replace this with proper test once we know what the
Index: test/park_integration/test/test_park_scipy.py
===================================================================
--- test/park_integration/test/test_park_scipy.py	(revision 5777106e8a4a0a62fe2ee0fbaf7c0aa19c0bb92b)
+++ test/park_integration/test/test_park_scipy.py	(revision 6c007022258cff8efb5208e90301244c22e30170)
@@ -4,10 +4,13 @@
 """
 import unittest
+import math
 
 from sans.guiframe.dataFitting import Data1D 
 from sans.fit.AbstractFitEngine import Model,FitData1D
-import math
 from sans.fit.Fitting import Fit
-from DataLoader.loader import Loader
+from sans.dataloader.loader import Loader
+from sans.models.MultiplicationModel import MultiplicationModel
+from sans.models.CylinderModel import CylinderModel
+from sans.models.SquareWellStructure import SquareWellStructure
 
 class testFitModule(unittest.TestCase):
@@ -21,13 +24,11 @@
         data = Data1D(x=out.x, y=out.y, dx=out.dx, dy=out.dy)
         # Receives the type of model for the fitting
-        from sans.models.MultiplicationModel import MultiplicationModel
-        from sans.models.CylinderModel import CylinderModel
-        from sans.models.SquareWellStructure import SquareWellStructure
         model1  =  MultiplicationModel(CylinderModel(),SquareWellStructure())
         model1.setParam('background', 0.0)
-        model1.setParam('contrast', 3e-006)
-        model1.setParam('length', 600)
-        model1.setParam('radius', 20)
-        model1.setParam('scale', 10)
+        model1.setParam('sldCyl', 3e-006)
+        model1.setParam('sldSolv', 0.0)
+        model1.setParam('length', 420)
+        model1.setParam('radius', 40)
+        model1.setParam('scale_factor', 2)
         model1.setParam('volfraction', 0.04)
         model1.setParam('welldepth', 1.5)
@@ -36,15 +37,16 @@
         model = Model(model1)
     
-        pars1 =['length','radius','scale']
+        pars1 =['length','radius','scale_factor']
         fitter = Fit('scipy')
         fitter.set_data(data,1)
         fitter.set_model(model,1,pars1)
-        fitter.select_problem_for_fit(Uid=1,value=1)
-        result1 = fitter.fit()
-      
+        fitter.select_problem_for_fit(id=1,value=1)
+        result1, = fitter.fit()
+
         self.assert_(result1)
         self.assertTrue(len(result1.pvec)>=0 )
         self.assertTrue(len(result1.stderr)>= 0)
-        
+
+        print "results",list(zip(result1.pvec, result1.stderr))
         self.assertTrue( math.fabs(result1.pvec[0]-605)/3.0 <= result1.stderr[0] )
         self.assertTrue( math.fabs(result1.pvec[1]-20.0)/3.0  <= result1.stderr[1] )
Index: test/pr_inversion/test/test_output.txt
===================================================================
--- test/pr_inversion/test/test_output.txt	(revision 57986a193b4c99f3eed011b3e03a3994511e3545)
+++ test/pr_inversion/test/test_output.txt	(revision 6c007022258cff8efb5208e90301244c22e30170)
@@ -3,5 +3,5 @@
 #alpha=0.0007
 #chi2=836.797
-#elapsed=0.000468969
+#elapsed=0.000999928
 #qmin=None
 #qmax=None
Index: test/run_one.py
===================================================================
--- test/run_one.py	(revision bbd97e5cc51780c7e00fb5c22b4c92799a7c0216)
+++ test/run_one.py	(revision 6c007022258cff8efb5208e90301244c22e30170)
@@ -12,4 +12,5 @@
 #print "\n".join(sys.path)
 test_path,test_file = splitpath(sys.argv[1])
+print "test file",sys.argv[1]
 #print test_path, test_file
 sys.argv = [sys.argv[0]]
Index: test/utest_sansview.py
===================================================================
--- test/utest_sansview.py	(revision bbd97e5cc51780c7e00fb5c22b4c92799a7c0216)
+++ test/utest_sansview.py	(revision 6c007022258cff8efb5208e90301244c22e30170)
@@ -26,5 +26,5 @@
 #    COMMAND_SEP = '&'
 
-def run_tests():
+def run_tests(dirs=None, all=False):
     test_root = os.path.abspath(os.path.dirname(__file__))
     run_one_py = os.path.join(test_root, 'run_one.py')
@@ -35,5 +35,5 @@
     n_failures = 0
     
-    for d in os.listdir(test_root):
+    for d in (dirs if dirs else os.listdir(test_root)):
         
         # Check for modules to be skipped
@@ -76,15 +76,18 @@
                         passed += 1
                         print "Result for %s: SUCCESS" % module_name
-                        
+
     print "\n----------------------------------------------"
-    print "Results by test modules:"
-    print "    PASSED: %d" % passed
-    ratio = 100.0*failed/(failed+passed)
-    print "    FAILED: %d    (%.0f%%)" % (failed,ratio) 
-    
-    print "Results by tests:"
-    print "    Tests run:    %d" % n_tests
-    print "    Tests failed: %d" % n_failures
-    print "    Test errors:  %d" % n_errors 
+    if n_tests == 0:
+        print "No tests."
+    else:
+        print "Results by test modules:"
+        print "    PASSED: %d" % passed
+        ratio = 100.0*failed/(failed+passed)
+        print "    FAILED: %d    (%.0f%%)" % (failed,ratio)
+
+        print "Results by tests:"
+        print "    Tests run:    %d" % n_tests
+        print "    Tests failed: %d" % n_failures
+        print "    Test errors:  %d" % n_errors
     print "----------------------------------------------"
     
@@ -92,5 +95,7 @@
 
 if __name__ == '__main__':
-    if run_tests()>0:
+    all = (len(sys.argv) > 1 and sys.argv[1] == '-all')
+    dirs = sys.argv[1:] if not all else sys.argv[2:]
+    if run_tests(dirs=dirs, all=all)>0:
         sys.exit(1)
     
