def testGetIntersection(self): """Test if the list intersection method works""" lists = ( ([], [], []), ([], [1, 2], []), ([1], [1, 2], [1]), ([1], [2], []), ([1, 4], [2, 3], []), ([1, 2], [1, 2], [1, 2]), ) for list in lists: self.assertEqual(ListUtils.get_intersection(list[0], list[1]), list[2]) self.assertEqual(ListUtils.get_intersection(list[1], list[0]), list[2])
def is_distributable(self): """Return true if the command can be executed remotely, false otherwise. A compilation can be done remotely if it doesn't need linking. """ # if this has already been determinated, return the # cached value if self.__is_distributable != None: return self.__is_distributable if self.get_stop_step() < 4 \ and self.get_stop_step() > 1 \ and self.has_distributable_start_step() \ and (ListUtils.get_intersection(\ CompilerCommand_c.not_distributable_options,\ self.__command_arguments) == []): self.__is_distributable = 1 else: self.__is_distributable = 0 return self.__is_distributable