Exemplo n.º 1
0
    def test_parse_output_resultstring_errormemout(self):
        runinstance_output_content = ["Bla\nBla\nBla\nResult for ParamILS: "
                                      "SAT, 0.35, 1, 0.5, -1, Random file"]
        with open("runsolver_vsize_exceeded.txt") as fh:
            runsolver_output_content = fh.readlines()

        cpu_time, wallclock_time, status, result, additional_data = \
            runsolver_wrapper.parse_output(self.config,
                                           runinstance_output_content,
                                           runsolver_output_content, 0.35)

        self.assertAlmostEqual(0.039276, wallclock_time)
        self.assertAlmostEqual(0.016, cpu_time)
        self.assertEqual("CRASHED", status)
        self.assertAlmostEqual(result, 1)
Exemplo n.º 2
0
    def test_parse_output_resultstring_errorrunsolver(self):
        runinstance_output_content = ["Bla\nBla\nBla\nResult for ParamILS: "
                                      "SAT, 0.35, 1, 0.5, -1, Random file"]
        with open("runsolver_did_not_end_properly.txt") as fh:
            runsolver_output_content = fh.readlines()

        cpu_time, wallclock_time, status, result, additional_data = \
            runsolver_wrapper.parse_output(self.config,
                                           runinstance_output_content,
                                           runsolver_output_content, 0.35)

        self.assertAlmostEqual(0.35, wallclock_time)
        self.assertAlmostEqual(1.32, cpu_time)
        self.assertEqual("SAT", status)
        self.assertAlmostEqual(result, 0.5)
Exemplo n.º 3
0
    def test_parse_output_resultstring_noerror_notfinite(self):
        runinstance_output_content = ["Bla\nBla\nBla\nResult for ParamILS: "
                                      "SAT, 0.35, 1, NaN, -1, Random file"]
        with open("runsolver_positive.txt") as fh:
            runsolver_output_content = fh.readlines()

        cpu_time, wallclock_time, status, result, additional_data = \
            runsolver_wrapper.parse_output(self.config,
                                           runinstance_output_content,
                                           runsolver_output_content, 0.35)

        self.assertAlmostEqual(0.259524, wallclock_time)
        self.assertAlmostEqual(0.188011, cpu_time)
        self.assertEqual("CRASHED", status)
        self.assertAlmostEqual(result, 1)
Exemplo n.º 4
0
    def test_parse_output_noresultstring_errormemlimit(self):
        runinstance_output_content = ["Bla\nBla\nBla\n"]
        with open("runsolver_vsize_exceeded.txt") as fh:
            runsolver_output_content = fh.readlines()

        cpu_time, wallclock_time, status, result, additional_data = \
            runsolver_wrapper.parse_output(self.config,
                                           runinstance_output_content,
                                           runsolver_output_content, 0.35)

        self.assertAlmostEqual(0.039276, wallclock_time)
        self.assertAlmostEqual(0.016, cpu_time)
        self.assertEqual("CRASHED", status)
        self.assertAlmostEqual(result, 1)
        self.assertEqual("VSize exceeded Please have a look at the runsolver "
                         "output file.", additional_data)
Exemplo n.º 5
0
    def test_parse_output_noresultstring_noerror(self):
        runinstance_output_content = ["Bla\nBla\nBla\n"]
        with open("runsolver_positive.txt") as fh:
            runsolver_output_content = fh.readlines()

        cpu_time, wallclock_time, status, result, additional_data = \
            runsolver_wrapper.parse_output(self.config,
                                           runinstance_output_content,
                                           runsolver_output_content, 0.35)

        self.assertAlmostEqual(0.259524, wallclock_time)
        self.assertAlmostEqual(0.188011, cpu_time)
        self.assertEqual("CRASHED", status)
        self.assertAlmostEqual(result, 1)
        self.assertEqual("No result string returned. Please have a look " \
                         "at the runinstance output", additional_data)
    def test_parse_output_noresultstring_noerror(self):
        runinstance_output_content = ["Bla\nBla\nBla\n"]
        with open("runsolver_positive.txt") as fh:
            runsolver_output_content = fh.readlines()

        cpu_time, wallclock_time, status, result, additional_data = \
            runsolver_wrapper.parse_output(self.config,
                                           runinstance_output_content,
                                           runsolver_output_content, 0.35)

        self.assertAlmostEqual(0.259524, wallclock_time)
        self.assertAlmostEqual(0.188011, cpu_time)
        self.assertEqual("CRASHED", status)
        self.assertAlmostEqual(result, 1)
        self.assertEqual("No result string returned. Please have a look " \
                         "at the runinstance output", additional_data)
Exemplo n.º 7
0
    def test_parse_output_noresultstring_errorrunsolver(self):
        runinstance_output_content = ["Bla\nBla\nBla\n"]
        with open("runsolver_did_not_end_properly.txt") as fh:
            runsolver_output_content = fh.readlines()

        cpu_time, wallclock_time, status, result, additional_data = \
            runsolver_wrapper.parse_output(self.config,
                                           runinstance_output_content,
                                           runsolver_output_content, 0.35)

        self.assertAlmostEqual(0.35, wallclock_time)
        self.assertAlmostEqual(1.32, cpu_time)
        self.assertEqual("CRASHED", status)
        self.assertAlmostEqual(result, 1)
        self.assertEqual("There is no result string and it seems that the "
                         "runsolver crashed. Please have a look at the "
                         "runsolver output file.", additional_data)
    def test_parse_output_noresultstring_errormemlimit(self):
        runinstance_output_content = ["Bla\nBla\nBla\n"]
        with open("runsolver_vsize_exceeded.txt") as fh:
            runsolver_output_content = fh.readlines()

        cpu_time, wallclock_time, status, result, additional_data = \
            runsolver_wrapper.parse_output(self.config,
                                           runinstance_output_content,
                                           runsolver_output_content, 0.35)

        self.assertAlmostEqual(0.039276, wallclock_time)
        self.assertAlmostEqual(0.016, cpu_time)
        self.assertEqual("CRASHED", status)
        self.assertAlmostEqual(result, 1)
        self.assertEqual(
            "VSize exceeded Please have a look at the runsolver "
            "output file.", additional_data)
    def test_parse_output_resultstring_errorrunsolver(self):
        runinstance_output_content = [
            "Bla\nBla\nBla\nResult for ParamILS: "
            "SAT, 0.35, 1, 0.5, -1, Random file"
        ]
        with open("runsolver_did_not_end_properly.txt") as fh:
            runsolver_output_content = fh.readlines()

        cpu_time, wallclock_time, status, result, additional_data = \
            runsolver_wrapper.parse_output(self.config,
                                           runinstance_output_content,
                                           runsolver_output_content, 0.35)

        self.assertAlmostEqual(0.35, wallclock_time)
        self.assertAlmostEqual(1.32, cpu_time)
        self.assertEqual("SAT", status)
        self.assertAlmostEqual(result, 0.5)
    def test_parse_output_resultstring_errormemout(self):
        runinstance_output_content = [
            "Bla\nBla\nBla\nResult for ParamILS: "
            "SAT, 0.35, 1, 0.5, -1, Random file"
        ]
        with open("runsolver_vsize_exceeded.txt") as fh:
            runsolver_output_content = fh.readlines()

        cpu_time, wallclock_time, status, result, additional_data = \
            runsolver_wrapper.parse_output(self.config,
                                           runinstance_output_content,
                                           runsolver_output_content, 0.35)

        self.assertAlmostEqual(0.039276, wallclock_time)
        self.assertAlmostEqual(0.016, cpu_time)
        self.assertEqual("CRASHED", status)
        self.assertAlmostEqual(result, 1)
    def test_parse_output_resultstring_noerror_notfinite(self):
        runinstance_output_content = [
            "Bla\nBla\nBla\nResult for ParamILS: "
            "SAT, 0.35, 1, NaN, -1, Random file"
        ]
        with open("runsolver_positive.txt") as fh:
            runsolver_output_content = fh.readlines()

        cpu_time, wallclock_time, status, result, additional_data = \
            runsolver_wrapper.parse_output(self.config,
                                           runinstance_output_content,
                                           runsolver_output_content, 0.35)

        self.assertAlmostEqual(0.259524, wallclock_time)
        self.assertAlmostEqual(0.188011, cpu_time)
        self.assertEqual("CRASHED", status)
        self.assertAlmostEqual(result, 1)
    def test_parse_output_noresultstring_errorrunsolver(self):
        runinstance_output_content = ["Bla\nBla\nBla\n"]
        with open("runsolver_did_not_end_properly.txt") as fh:
            runsolver_output_content = fh.readlines()

        cpu_time, wallclock_time, status, result, additional_data = \
            runsolver_wrapper.parse_output(self.config,
                                           runinstance_output_content,
                                           runsolver_output_content, 0.35)

        self.assertAlmostEqual(0.35, wallclock_time)
        self.assertAlmostEqual(1.32, cpu_time)
        self.assertEqual("CRASHED", status)
        self.assertAlmostEqual(result, 1)
        self.assertEqual(
            "There is no result string and it seems that the "
            "runsolver crashed. Please have a look at the "
            "runsolver output file.", additional_data)