def dump(self, src_class):
        cmd = [
            self.bin, '-l', src_class.name, '-tolerance',
            self.tolerance_levels, '--gcc-path', self.compiler, '-dump',
            src_class.ws_files, '-gcc-options', self.compilation_flags
        ]
        print(" - Run '%s'" % ' '.join(cmd))
        try:
            subprocess.check_output(cmd, stderr=subprocess.STDOUT)
        except subprocess.CalledProcessError as e:
            error_msg = e.output.decode('utf-8')
            # check if the error is because no headers/object are found
            if "library objects are not found" in error_msg or \
               "header files are not found" in error_msg:
                self.empty_objects_found = True
                if self.no_fail_if_emtpy:
                    subinfo("Skip error on no headers/objects found")
                    return 0
                error("No headers/objects found in " + str(src_class))
            # check if the error is because compilation problems
            if "errors occurred when compiling headers" in error_msg:
                self.compilaton_errors_found = True
                # print error
                error_log_str = ""
                with open(self.get_dump_error_log(src_class)) as log:
                    error_log_str = log.read()
                    print(error_log_str)
                msg = "Compilation problems during compiling headers " + str(
                    src_class)
                self.generate_fake_report(msg + "<br /><br /><pre>" +
                                          error_log_str + "</pre>")
                error(msg)
            # If unknown error print it to help user debug
            print("\n" + error_msg)
            return 1

        return 0
Exemple #2
0
 def validate(self, ros_repo):
     # Check that repo exists in ROS
     if (not self.validate_repo(ros_repo)):
         error("ROS repository " + ros_repo +
               " not found in the rosdistro index")
 def validate(self, directory):
     if (not path.isdir(directory)):
         error("Path " + directory + " is not a directory")
     if not listdir(directory):
         error("Directory " + directory + "is empty")
Exemple #4
0
 def extract_deb_files(self):
     files = self.list_files('*.deb')
     for f in files:
         result = _check_call(['dpkg', '-x', f, self.ws_files])
         if result != 0:
             error("Failed to extract files")