Exemplo n.º 1
0
        info = self._get_project_info(bug)
        failing_module = self.failing_module(bug)

        for module in info['modules']:
            module_name = os.path.basename(module['baseDir'])
            if failing_module == module_name or failing_module == module[
                    'name']:
                return abs_to_rel(bug.working_directory, module['binTests'])
        return []

    def classpath(self, bug):
        info = self._get_project_info(bug)
        failing_module = self.failing_module(bug)

        deps = []

        for module in info['modules']:
            module_name = os.path.basename(module['baseDir'])
            if failing_module != module_name and failing_module != module[
                    'name']:
                deps += module['binSources']
        deps += info['classpath']

        return ":".join(deps)

    def compliance_level(self, bug):
        return 7


add_benchmark("Bugs.jar", BugDotJar)
Exemplo n.º 2
0
        cd %s;
        defects4j export -p cp.test 2> /dev/null;
        """ % (JAVA7_HOME, self._get_benchmark_path(),
               os.path.join(JAVA7_HOME, '..'), bug.working_directory)
        libs_split = subprocess.check_output(cmd, shell=True,
                                             stderr=FNULL).split(":")
        for lib_str in libs_split:
            lib = os.path.basename(lib_str)
            if lib[-4:] == ".jar":
                libs.append(lib)
        libs_path = os.path.join(self.path, "framework", "projects",
                                 bug.project, "lib")
        for (root, _, files) in os.walk(libs_path):
            for f in files:
                if f not in libs:
                    classpath += ":" + (os.path.join(root, f))
        libs_path = os.path.join(self.path, "framework", "projects", "lib")
        for (root, _, files) in os.walk(libs_path):
            for f in files:
                if f in libs:
                    classpath += ":" + (os.path.join(root, f))

        return classpath

    def compliance_level(self, bug):
        return self.project_data[bug.project]["complianceLevel"][str(
            bug.bug_id)]["source"]


add_benchmark("Defects4J", Defects4J)
Exemplo n.º 3
0
        return tests

    def source_folders(self, bug):
        return [os.path.join("src", "main", "java")]

    def test_folders(self, bug):
        return [os.path.join("src", "test", "java")]

    def bin_folders(self, bug):
        return [os.path.join("target", "classes")]

    def test_bin_folders(self, bug):
        return [os.path.join("target", "test-classes")]

    def classpath(self, bug):
        classpath = []
        m2_repository = os.path.expanduser("~/.m2/repository")
        classpath.append(
            os.path.join(m2_repository, "junit", "junit", "4.11",
                         "junit-4.11.jar"))
        classpath.append(
            os.path.join(m2_repository, "org", "hamcrest", "hamcrest-core",
                         "1.3", "hamcrest-core-1.3.jar"))
        return ":".join(classpath)

    def compliance_level(self, bug):
        return 8


add_benchmark("QuixBugs", QuixBugs)
Exemplo n.º 4
0
        failing_module = self.failing_module(bug)

        for module in info['modules']:
            module_name = os.path.basename(module['baseDir'])
            if failing_module == module_name or failing_module == module[
                    'name']:
                return abs_to_rel(bug.working_directory, module['binTests'])
        return []

    def classpath(self, bug):
        info = self._get_project_info(bug)
        failing_module = self.failing_module(bug)

        deps = []

        for module in info['modules']:
            module_name = os.path.basename(module['baseDir'])
            if failing_module != module_name and failing_module != module[
                    'name']:
                deps += module['binSources']
        deps += info['classpath']

        return ":".join(deps)

    def compliance_level(self, bug):
        info = self._get_project_info(bug)
        return info['complianceLevel']


add_benchmark("Bears", Bears)
Exemplo n.º 5
0
        return tests

    def source_folders(self, bug):
        return [os.path.join("src", "main", "java")]

    def test_folders(self, bug):
        return [os.path.join("src", "test", "java")]

    def bin_folders(self, bug):
        return [os.path.join("target", "classes")]

    def test_bin_folders(self, bug):
        return [os.path.join("target", "test-classes")]

    def classpath(self, bug):
        classpath = []
        m2_repository = os.path.expanduser("~/.m2/repository")
        classpath.append(
            os.path.join(m2_repository, "junit", "junit", "4.11",
                         "junit-4.11.jar"))
        classpath.append(
            os.path.join(m2_repository, "org", "hamcrest", "hamcrest-core",
                         "1.3", "hamcrest-core-1.3.jar"))
        return ":".join(classpath)

    def compliance_level(self, bug):
        return 7


add_benchmark("IntroClassJava", IntroClassJava)
Exemplo n.º 6
0
        cd %s;
        defects4j export -p cp.test 2> /dev/null;
        """ % (JAVA7_HOME, self._get_benchmark_path(),
               os.path.join(JAVA7_HOME, '..'), bug.working_directory)
        libs_split = subprocess.check_output(cmd, shell=True,
                                             stderr=FNULL).split(":")
        for lib_str in libs_split:
            lib = os.path.basename(lib_str)
            if lib[-4:] == ".jar":
                libs.append(lib)
        libs_path = os.path.join(self.path, "framework", "projects",
                                 bug.project, "lib")
        for (root, _, files) in os.walk(libs_path):
            for f in files:
                if f in libs:
                    classpath += ":" + (os.path.join(root, f))
        libs_path = os.path.join(self.path, "framework", "projects", "lib")
        for (root, _, files) in os.walk(libs_path):
            for f in files:
                if f in libs:
                    classpath += ":" + (os.path.join(root, f))

        return classpath

    def compliance_level(self, bug):
        return self.project_data[bug.project]["complianceLevel"][str(
            bug.bug_id)]["source"]


add_benchmark("Juliet", Juliet)