Changeset 2270


Ignore:
Timestamp:
Feb 5, 2010 6:01:08 PM (10 years ago)
Author:
jwatson
Message:

PySP tests need absolute output paths!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/coopr/pysp/tests/unit/test_ph.py

    r2269 r2270  
    77from os.path import abspath, dirname
    88sys.path.insert(0, dirname(dirname(abspath(__file__)))+"/../..")
    9 currdir = dirname(abspath(__file__))+os.sep
     9curr_dir = dirname(abspath(__file__))+os.sep
    1010
    1111pysp_examples_dir = dirname(dirname(dirname(dirname(dirname(abspath(__file__))))))+os.sep+"examples"+os.sep+"pysp"+os.sep
     
    5454           return
    5555       
    56         pyutilib.misc.setup_redirect(currdir+"test_quadratic_farmer.out")
     56        pyutilib.misc.setup_redirect(curr_dir+"test_quadratic_farmer.out")
    5757        print "RUNNING QUADRATIC FARMER TEST"
    5858        pyutilib.misc.reset_redirect()
     
    6060        model_dir = farmer_examples_dir + os.sep + "models"
    6161        instance_dir = farmer_examples_dir + os.sep + "scenariodata"       
    62         pyutilib.subprocess.run(coopr_bin_dir+"runph --solver=cplex --solver-manager=serial --model-directory="+model_dir+" --instance-directory="+instance_dir,outfile="farmer_quadratic.out")
     62        pyutilib.subprocess.run(coopr_bin_dir+"runph --solver=cplex --solver-manager=serial --model-directory="+model_dir+" --instance-directory="+instance_dir,outfile=curr_dir+os.sep+"farmer_quadratic.out")
    6363        # if the test passes, the first argument is deleted.
    64         self.failUnlessFileEqualsBaseline(currdir+"farmer_quadratic.out",currdir+"farmer_quadratic.baseline", filter=filter_time)
     64        self.failUnlessFileEqualsBaseline(curr_dir+"farmer_quadratic.out",curr_dir+"farmer_quadratic.baseline", filter=filter_time)
    6565
    6666    def test_linearized_farmer(self):
     
    6969           return       
    7070
    71         pyutilib.misc.setup_redirect(currdir+"test_linearized_farmer.out")
     71        pyutilib.misc.setup_redirect(curr_dir+"test_linearized_farmer.out")
    7272        print "RUNNING LINEARIZED FARMER TEST"
    7373        pyutilib.misc.reset_redirect()
     
    7575        model_dir = farmer_examples_dir + os.sep + "models"
    7676        instance_dir = farmer_examples_dir + os.sep + "scenariodata"       
    77         pyutilib.subprocess.run(coopr_bin_dir+"runph --solver=cplex --solver-manager=serial --model-directory="+model_dir+" --instance-directory="+instance_dir+" --linearize-nonbinary-penalty-terms=10",outfile="farmer_linearized.out")
     77        pyutilib.subprocess.run(coopr_bin_dir+"runph --solver=cplex --solver-manager=serial --model-directory="+model_dir+" --instance-directory="+instance_dir+" --linearize-nonbinary-penalty-terms=10",outfile=curr_dir+os.sep+"farmer_linearized.out")
    7878        # if the test passes, the first argument is deleted.
    79         self.failUnlessFileEqualsBaseline(currdir+"farmer_linearized.out",currdir+"farmer_linearized.baseline", filter=filter_time)
     79        self.failUnlessFileEqualsBaseline(curr_dir+"farmer_linearized.out",curr_dir+"farmer_linearized.baseline", filter=filter_time)
    8080
    8181    def test_quadratic_sizes3(self):
     
    8484           return
    8585       
    86         pyutilib.misc.setup_redirect(currdir+"test_quadratic_sizes3.out")
     86        pyutilib.misc.setup_redirect(curr_dir+"test_quadratic_sizes3.out")
    8787        print "RUNNING QUADRATIC SIZES3 TEST"
    8888        pyutilib.misc.reset_redirect()
     
    9797                                " --ww-extension-cfgfile="+sizes_example_dir+os.sep+"config"+os.sep+"wwph.cfg"+
    9898                                " --ww-extension-suffixfile="+sizes_example_dir+os.sep+"config"+os.sep+"wwph.suffixes",
    99                                 outfile="sizes3_quadratic.out")
     99                                outfile=curr_dir+os.sep+"sizes3_quadratic.out")
    100100        # if the test passes, the first argument is deleted.
    101         self.failUnlessFileEqualsBaseline(currdir+"sizes3_quadratic.out",currdir+"sizes3_quadratic.baseline", filter=filter_time)       
     101        self.failUnlessFileEqualsBaseline(curr_dir+"sizes3_quadratic.out",curr_dir+"sizes3_quadratic.baseline", filter=filter_time)       
    102102
    103103    def run(self, result=None):
Note: See TracChangeset for help on using the changeset viewer.