示例#1
0
文件: test.py 项目: mateoqac/unqTip
    def run(self):
        if "board" in self.annotations.keys():
            if not self.annotations["board"].value is None:
                board = os.path.join(module_dir(self),
                                     self.annotations["board"].value)
            else:
                board = os.path.join(module_dir(self),
                                     self.filename[:-4] + ".gbb")
        else:
            board = os.path.join(parent_dir(__file__), "boards/empty.gbb")
        results = run_gobstones(self.filename, board)
        if results[0] == "OK":
            passed = True
            if self.annotation_present("assert"):
                passed = passed and self.check_assert(results[1])

            if passed:
                return "PASSED"
            else:
                return "FAILED"
        else:
            return results[0]

        def check_assert(self, results):
            pass
示例#2
0
文件: test.py 项目: mateoqac/unqTip
 def run(self):
     if "board" in self.annotations.keys():
         if not self.annotations["board"].value is None:
             board = os.path.join(module_dir(self), self.annotations["board"].value)
         else:
             board = os.path.join(module_dir(self), self.filename[:-4] + ".gbb") 
     else:
         board = os.path.join(parent_dir(__file__), "boards/empty.gbb")
     results = run_gobstones(self.filename, board)
     if results[0] == "OK":            
         if self.annotation_present("assert"):
             passed, failed = self.check_assert(results[1])
         else:
             res = dict(results[1])
             passed, failed = int(res["passed"]), int(res["failed"]) 
         
         return (passed, failed, 0, passed + failed)
     else:
         return (0, 0, 1, 1)
     
     def check_assert(self, results):
         pass
示例#3
0
文件: test.py 项目: ebonelli/unqTip
 def run(self):
     if "board" in self.annotations.keys():
         if not self.annotations["board"].value is None:
             board = os.path.join(module_dir(self), self.annotations["board"].value)
         else:
             board = os.path.join(module_dir(self), self.filename[:-4] + ".gbb") 
     else:
         board = os.path.join(parent_dir(__file__), "boards/empty.gbb")
     results = run_gobstones(self.filename, board)
     if results[0] == "OK":
         passed = True
         if self.annotation_present("assert"):
             passed = passed and self.check_assert(results[1])
         
         if passed:
             return "PASSED"
         else:
             return "FAILED"
     else:
         return results[0]
     
     def check_assert(self, results):
         pass
示例#4
0
文件: test.py 项目: ebonelli/unqTip
def cleanup():
    clean_dir = os.path.join(parent_dir(__file__), "examples")
    delete_files_in_dir(clean_dir, ["README"])
示例#5
0
文件: test.py 项目: ebonelli/unqTip
 def get_gobstones_tests(self):
     PATH = os.path.join(parent_dir(__file__), self.name)
     return [ GobstonesFileTest(os.path.join(PATH, f)) for f in os.listdir(PATH) if ".gbs" in f and self.is_test_file(PATH, f)]        
示例#6
0
文件: test.py 项目: mateoqac/unqTip
 def get_gobstones_tests(self):
     PATH = os.path.join(parent_dir(__file__), self.name)
     return [
         GobstonesFileTest(os.path.join(PATH, f)) for f in os.listdir(PATH)
         if ".gbs" in f and self.is_test_file(PATH, f)
     ]
示例#7
0
文件: test.py 项目: mateoqac/unqTip
def cleanup():
    clean_dir = os.path.join(parent_dir(__file__), "examples")
    delete_files_in_dir(clean_dir, ["README"])