-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/adapt tests for warning (#70)
* changed each test to also check for warnings and specified which warning must be displayed Signed-off-by: Anton Utz <[email protected]> * implemented change requests Signed-off-by: Anton Utz <[email protected]> * linter issues Signed-off-by: Anton Utz <[email protected]> * added location of check Signed-off-by: Anton Utz <[email protected]> * added check class Signed-off-by: Anton Utz <[email protected]> * added test for xml conformity Signed-off-by: Anton Utz <[email protected]> * added check for validating xml with scheme, output not yet processed though Signed-off-by: Anton Utz <[email protected]> * created whole check out of validation function. introduced success and failure messages Signed-off-by: Anton Utz <[email protected]> * corrected double code Signed-off-by: Anton Utz <[email protected]> * moved check to extra file Signed-off-by: Anton Utz <[email protected]> * fixed imports and whitespaces Signed-off-by: Anton Utz <[email protected]> * changed if structure of _check method Signed-off-by: Anton Utz <[email protected]> * changed tests to all fullfill scheme version Signed-off-by: Anton Utz <[email protected]> * changed test data with source-file attribute to version 4 Signed-off-by: Anton Utz <[email protected]> * added case for package.xml version 4 Signed-off-by: Anton Utz <[email protected]> * removed todo Signed-off-by: Anton Utz <[email protected]> * adapted wrong test Signed-off-by: Anton Utz <[email protected]> * moved version checking and xml tree conversion to package.py Signed-off-by: Anton Utz <[email protected]> * refactor of schema check Signed-off-by: Anton Utz <[email protected]> * fixed bug Signed-off-by: Anton Utz <[email protected]> * implemented suggestions Signed-off-by: Anton Utz <[email protected]> --------- Signed-off-by: Anton Utz <[email protected]>
- Loading branch information
Showing
40 changed files
with
624 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||
<xs:simpleType name="VersionType"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
The version number must have the form "X.Y.Z" where X, Y, and Z | ||
are non-negative integers, and must not contain leading zeroes. | ||
</xs:documentation> | ||
</xs:annotation> | ||
<xs:restriction base="xs:token"> | ||
<xs:pattern value="(0|[1-9][0-9]*)(.(0|[1-9][0-9]*)){2}"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
|
||
<xs:complexType name="DescriptionType" mixed="true"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
The description allows any content but should be limited to XHTML. | ||
</xs:documentation> | ||
</xs:annotation> | ||
<xs:sequence> | ||
<xs:any processContents="skip" minOccurs="0" maxOccurs="unbounded"/> | ||
</xs:sequence> | ||
</xs:complexType> | ||
|
||
<xs:simpleType name="EmailType"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
A valid email address must follow several complex rules | ||
(see https://en.wikipedia.org/wiki/Email_address). | ||
For ROS packages only a few are enforced, and not the full character set | ||
is supported. | ||
</xs:documentation> | ||
</xs:annotation> | ||
<xs:restriction base="xs:token"> | ||
<xs:pattern value="[-a-zA-Z0-9_%+]+(\.[-a-zA-Z0-9_%+]+)*@[-a-zA-Z0-9%]+(\.[-a-zA-Z0-9%]+)*\.[a-zA-Z]{2,}"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
|
||
<xs:complexType name="PersonWithEmailType"> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:token"> | ||
<xs:attribute name="email" type="EmailType" use="required"/> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
|
||
<xs:complexType name="PersonWithOptionalEmailType"> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:token"> | ||
<xs:attribute name="email" type="EmailType" use="optional"/> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
|
||
<xs:simpleType name="UrlTypeEnum"> | ||
<xs:restriction base="xs:token"> | ||
<xs:enumeration value="website"/> | ||
<xs:enumeration value="bugtracker"/> | ||
<xs:enumeration value="repository"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
|
||
<xs:complexType name="UrlType"> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:anyURI"> | ||
<xs:attribute name="type" type="UrlTypeEnum" use="optional" default="website"/> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
|
||
<xs:simpleType name="VersionLimitType"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
The version limit must have the form "X.Y.Z", "X.Y", or "X". | ||
See documentation for VersionType for further details. | ||
</xs:documentation> | ||
</xs:annotation> | ||
<xs:restriction base="xs:token"> | ||
<xs:pattern value="(0|[1-9][0-9]*)(.(0|[1-9][0-9]*)){0,2}"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
|
||
<xs:complexType name="ExportType"> | ||
<xs:sequence> | ||
<xs:any processContents="skip" minOccurs="0" maxOccurs="unbounded"/> | ||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:schema> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||
<xs:include schemaLocation="package_common.xsd"/> | ||
|
||
<xs:complexType name="DependencyType"> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:token"> | ||
<!-- The dependency must have a version less than the specified limit. --> | ||
<xs:attribute name="version_lt" type="VersionLimitType" use="optional"/> | ||
<!-- The dependency must have a version less than or equal to the specified limit. --> | ||
<xs:attribute name="version_lte" type="VersionLimitType" use="optional"/> | ||
<!-- The dependency must have a version equal to the specified limit. --> | ||
<xs:attribute name="version_eq" type="VersionLimitType" use="optional"/> | ||
<!-- The dependency must have a version greater than or equal to the specified limit. --> | ||
<xs:attribute name="version_gte" type="VersionLimitType" use="optional"/> | ||
<!-- The dependency must have a version greater than the specified limit. --> | ||
<xs:attribute name="version_gt" type="VersionLimitType" use="optional"/> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
|
||
<xs:element name="package"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
Specified in REP 127 (see http://www.ros.org/reps/rep-0127.html). | ||
</xs:documentation> | ||
</xs:annotation> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element name="name" minOccurs="1" maxOccurs="1"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
The package name should be unique within the ROS community. | ||
It may differ from the folder name into which it is checked out, | ||
but that is not recommended. | ||
It must start with a lower-case letter and consist of only | ||
lower-case letters, numbers and underscores. | ||
It must not have two consecutive underscores. | ||
</xs:documentation> | ||
</xs:annotation> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:token"> | ||
<xs:pattern value="[a-z](_?[a-z0-9]+)*"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="version" type="VersionType" minOccurs="1" maxOccurs="1"/> | ||
<xs:element name="description" type="DescriptionType" minOccurs="1" maxOccurs="1"/> | ||
<xs:element name="maintainer" type="PersonWithEmailType" minOccurs="1" maxOccurs="unbounded"/> | ||
<xs:element name="license" type="xs:token" minOccurs="1" maxOccurs="unbounded"/> | ||
|
||
<xs:element name="url" type="UrlType" minOccurs="0" maxOccurs="unbounded"/> | ||
<xs:element name="author" type="PersonWithOptionalEmailType" minOccurs="0" maxOccurs="unbounded"/> | ||
|
||
<xs:choice minOccurs="0" maxOccurs="unbounded"> | ||
<xs:element type="DependencyType" name="build_depend"/> | ||
<xs:element type="DependencyType" name="buildtool_depend"/> | ||
<xs:element type="DependencyType" name="run_depend"/> | ||
<xs:element type="DependencyType" name="test_depend"/> | ||
<xs:element type="DependencyType" name="conflict"/> | ||
<xs:element type="DependencyType" name="replace"/> | ||
</xs:choice> | ||
|
||
<xs:element name="export" type="ExportType" minOccurs="0" maxOccurs="1"/> | ||
</xs:sequence> | ||
<xs:attribute name="format" fixed="1" use="optional"/> | ||
</xs:complexType> | ||
</xs:element> | ||
</xs:schema> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||
<xs:include schemaLocation="package_common.xsd"/> | ||
|
||
<xs:complexType name="DependencyType"> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:token"> | ||
<!-- The dependency must have a version less than the specified limit. --> | ||
<xs:attribute name="version_lt" type="VersionLimitType" use="optional"/> | ||
<!-- The dependency must have a version less than or equal to the specified limit. --> | ||
<xs:attribute name="version_lte" type="VersionLimitType" use="optional"/> | ||
<!-- The dependency must have a version equal to the specified limit. --> | ||
<xs:attribute name="version_eq" type="VersionLimitType" use="optional"/> | ||
<!-- The dependency must have a version greater than or equal to the specified limit. --> | ||
<xs:attribute name="version_gte" type="VersionLimitType" use="optional"/> | ||
<!-- The dependency must have a version greater than the specified limit. --> | ||
<xs:attribute name="version_gt" type="VersionLimitType" use="optional"/> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
|
||
<xs:element name="package"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
Specified in REP 140 (see http://www.ros.org/reps/rep-0140.html). | ||
</xs:documentation> | ||
</xs:annotation> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element name="name" minOccurs="1" maxOccurs="1"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
The package name should be unique within the ROS community. | ||
It may differ from the folder name into which it is checked out, | ||
but that is not recommended. | ||
It must start with a lower-case letter and consist of only | ||
lower-case letters, numbers and underscores. | ||
It must not have two consecutive underscores. | ||
</xs:documentation> | ||
</xs:annotation> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:token"> | ||
<xs:pattern value="[a-z](_?[a-z0-9]+)*"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="version" type="VersionType" minOccurs="1" maxOccurs="1"/> | ||
<xs:element name="description" type="DescriptionType" minOccurs="1" maxOccurs="1"/> | ||
<xs:element name="maintainer" type="PersonWithEmailType" minOccurs="1" maxOccurs="unbounded"/> | ||
<xs:element name="license" type="xs:token" minOccurs="1" maxOccurs="unbounded"/> | ||
|
||
<xs:element name="url" type="UrlType" minOccurs="0" maxOccurs="unbounded"/> | ||
<xs:element name="author" type="PersonWithOptionalEmailType" minOccurs="0" maxOccurs="unbounded"/> | ||
|
||
<xs:choice minOccurs="0" maxOccurs="unbounded"> | ||
<xs:element type="DependencyType" name="build_depend"/> | ||
<xs:element type="DependencyType" name="build_export_depend"/> | ||
<xs:element type="DependencyType" name="buildtool_depend"/> | ||
<xs:element type="DependencyType" name="buildtool_export_depend"/> | ||
<xs:element type="DependencyType" name="exec_depend"/> | ||
<xs:element type="DependencyType" name="depend"/> | ||
<xs:element type="DependencyType" name="doc_depend"/> | ||
<xs:element type="DependencyType" name="test_depend"/> | ||
<xs:element type="DependencyType" name="conflict"/> | ||
<xs:element type="DependencyType" name="replace"/> | ||
</xs:choice> | ||
|
||
<xs:element name="export" type="ExportType" minOccurs="0" maxOccurs="1"/> | ||
</xs:sequence> | ||
<xs:attribute name="format" fixed="2" use="required"/> | ||
</xs:complexType> | ||
</xs:element> | ||
</xs:schema> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||
<xs:include schemaLocation="package_common.xsd"/> | ||
|
||
<xs:complexType name="ConditionalType"> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:token"> | ||
<xs:attribute name="condition" use="optional"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:token"> | ||
<xs:pattern value="[$A-Za-z0-9_\s<>!=()-]*"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:attribute> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
|
||
<xs:complexType name="DependencyType"> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:token"> | ||
<!-- The dependency must have a version less than the specified limit. --> | ||
<xs:attribute name="version_lt" type="VersionLimitType" use="optional"/> | ||
<!-- The dependency must have a version less than or equal to the specified limit. --> | ||
<xs:attribute name="version_lte" type="VersionLimitType" use="optional"/> | ||
<!-- The dependency must have a version equal to the specified limit. --> | ||
<xs:attribute name="version_eq" type="VersionLimitType" use="optional"/> | ||
<!-- The dependency must have a version greater than or equal to the specified limit. --> | ||
<xs:attribute name="version_gte" type="VersionLimitType" use="optional"/> | ||
<!-- The dependency must have a version greater than the specified limit. --> | ||
<xs:attribute name="version_gt" type="VersionLimitType" use="optional"/> | ||
<xs:attribute name="condition" use="optional"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:token"> | ||
<xs:pattern value="[$A-Za-z0-9_\s"'<>!=()-]*"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:attribute> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
|
||
<xs:complexType name="LicenseType"> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:token"> | ||
<xs:attribute name="file" type="xs:token" use="optional"/> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
|
||
<xs:complexType name="VersionWithOptionalCompatibilityType"> | ||
<xs:simpleContent> | ||
<xs:extension base="VersionType"> | ||
<xs:attribute name="compatibility" type="VersionLimitType" use="optional"/> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
|
||
<xs:element name="package"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
Specified in REP 149 (see http://www.ros.org/reps/rep-0149.html). | ||
</xs:documentation> | ||
</xs:annotation> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element name="name" minOccurs="1" maxOccurs="1"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
The package name should be unique within the ROS community. | ||
It may differ from the folder name into which it is checked out, | ||
but that is not recommended. | ||
It must start with a lower-case letter and consist of only | ||
lower-case letters, numbers and underscores. | ||
It must not have two consecutive underscores. | ||
</xs:documentation> | ||
</xs:annotation> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:token"> | ||
<xs:pattern value="[a-z](_?[a-z0-9]+)*"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="version" type="VersionType" minOccurs="1" maxOccurs="1"/> | ||
<xs:element name="description" type="DescriptionType" minOccurs="1" maxOccurs="1"/> | ||
<xs:element name="maintainer" type="PersonWithEmailType" minOccurs="1" maxOccurs="unbounded"/> | ||
<xs:element name="license" type="LicenseType" minOccurs="1" maxOccurs="unbounded"/> | ||
|
||
<xs:element name="url" type="UrlType" minOccurs="0" maxOccurs="unbounded"/> | ||
<xs:element name="author" type="PersonWithOptionalEmailType" minOccurs="0" maxOccurs="unbounded"/> | ||
|
||
<xs:choice minOccurs="0" maxOccurs="unbounded"> | ||
<xs:element type="DependencyType" name="build_depend"/> | ||
<xs:element type="DependencyType" name="build_export_depend"/> | ||
<xs:element type="DependencyType" name="buildtool_depend"/> | ||
<xs:element type="DependencyType" name="buildtool_export_depend"/> | ||
<xs:element type="DependencyType" name="exec_depend"/> | ||
<xs:element type="DependencyType" name="depend"/> | ||
<xs:element type="DependencyType" name="doc_depend"/> | ||
<xs:element type="DependencyType" name="test_depend"/> | ||
<xs:element type="DependencyType" name="conflict"/> | ||
<xs:element type="DependencyType" name="replace"/> | ||
</xs:choice> | ||
|
||
<xs:element name="group_depend" type="ConditionalType" minOccurs="0" maxOccurs="unbounded"/> | ||
<xs:element name="member_of_group" type="ConditionalType" minOccurs="0" maxOccurs="unbounded"/> | ||
|
||
<xs:element name="export" type="ExportType" minOccurs="0" maxOccurs="1"/> | ||
</xs:sequence> | ||
<xs:attribute name="format" fixed="3" use="required"/> | ||
</xs:complexType> | ||
</xs:element> | ||
</xs:schema> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.