forked from google/clusterfuzz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Revert "Revert "Integrate Peach Mutation strategy (google#1480)" (google#1552)" This reverts commit 40ad6a1. * Updated environment variable name for pit filename * peach mutator update * Updated peach mutator
- Loading branch information
Showing
13 changed files
with
283 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
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,109 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Peach xmlns="http://peachfuzzer.com/2012/Peach" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://peachfuzzer.com/2012/Peach /peach/peach.xsd"> | ||
<Defaults> | ||
<Number signed="false" /> | ||
</Defaults> | ||
|
||
<!-- A sequence of consecutive white-space characters are is considered as one white-space character --> | ||
<DataModel name="WhiteSpace"> | ||
<Choice maxOccurs="1"> | ||
<Number name="NULL" valueType="hex" value="0x00" size="8"/> | ||
<Number name="HT" valueType="hex" value="0x09" size="8"/> | ||
<Number name="LF" valueType="hex" value="0x0A" size="8"/> | ||
<Number name="FF" valueType="hex" value="0x0C" size="8"/> | ||
<Number name="CR" valueType="hex" value="0x0D" size="8"/> | ||
<Number name="SP" valueType="hex" value="0x20" size="8"/> | ||
</Choice> | ||
</DataModel> | ||
|
||
<DataModel name="NewLine"> | ||
<Number valueType="hex" value="0x0A" size="8"/> | ||
</DataModel> | ||
|
||
<DataModel name="Space"> | ||
<Number valueType="hex" value="0x20" size="8" token="true"/> | ||
</DataModel> | ||
|
||
<DataModel name="GenericObj"> | ||
<Blob name="data"/> | ||
</DataModel> | ||
|
||
<DataModel name="NullObj" ref="GenericObj"/> | ||
<DataModel name="BooleanObj" ref="GenericObj"/> | ||
<DataModel name="NumericObj" ref="GenericObj"/> | ||
<DataModel name="StringObj" ref="GenericObj"/> | ||
<DataModel name="NameObj" ref="GenericObj"/> | ||
<DataModel name="ArrayObj" ref="GenericObj"/> | ||
<DataModel name="DictionaryObj" ref="GenericObj"/> | ||
<DataModel name="StreamObj" ref="GenericObj"/> | ||
|
||
<DataModel name="IndirectObj"> | ||
<String name="startToken" value="obj" token="true"/> | ||
<Choice> | ||
<Block ref="NullObj"/> | ||
<Block ref="BooleanObj"/> | ||
<Block ref="NumericObj"/> | ||
<Block ref="StringObj"/> | ||
<Block ref="NameObj"/> | ||
<Block ref="ArrayObj"/> | ||
<Block ref="DictionaryObj"/> | ||
<Block ref="StreamObj"/> | ||
</Choice> | ||
<String name="endToken" value="endobj" token="true"/> | ||
<!--<Block name="space3" ref="WhiteSpace" maxOccurs="10"/>--> | ||
</DataModel> | ||
|
||
<DataModel name="CrossReferenceTable"> | ||
<String name="startToken" value="xref" token="true"/> | ||
<Blob name="data"/> | ||
</DataModel> | ||
|
||
<DataModel name="PDF"> | ||
<!-- Header --> | ||
<Choice name="Version"> | ||
<String value="%PDF-1.0" token="true"/> | ||
<String value="%PDF-1.1" token="true"/> | ||
<String value="%PDF-1.2" token="true"/> | ||
<String value="%PDF-1.3" token="true"/> | ||
<String value="%PDF-1.4" token="true"/> | ||
<String value="%PDF-1.5" token="true"/> | ||
<String value="%PDF-1.6" token="true"/> | ||
<String value="%PDF-1.7" token="true"/> | ||
</Choice> | ||
<Blob name="CommentAndOther"/> | ||
<String name="startToken" value="obj" token="true"/> | ||
<Choice> | ||
<Block ref="NullObj"/> | ||
<Block ref="BooleanObj"/> | ||
<Block ref="NumericObj"/> | ||
<Block ref="StringObj"/> | ||
<Block ref="NameObj"/> | ||
<Block ref="ArrayObj"/> | ||
<Block ref="DictionaryObj"/> | ||
<Block ref="StreamObj"/> | ||
</Choice> | ||
<String name="endToken" value="endobj" token="true"/> | ||
<!-- Body --> | ||
|
||
|
||
<!-- | ||
<Choice name="PDFObjects" minOccurs="1" maxOccurs="30000"> | ||
<Block name="Body" ref="IndirectObj"/> | ||
</Choice> | ||
--> | ||
|
||
<Block name="Objs" maxOccurs="1000"> | ||
<Blob name="DummySpace"/> | ||
<Block name="PDFObj" ref="IndirectObj"/> | ||
</Block> | ||
|
||
|
||
<!-- Cross-reference table --> | ||
|
||
<Blob name="EndPdf"/> | ||
</DataModel> | ||
|
||
|
||
</Peach> | ||
<!-- end --> |
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
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
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,13 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. |
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,35 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Dictionary to keep track of pit information.""" | ||
|
||
import os | ||
|
||
from metrics import logs | ||
from system import environment | ||
|
||
|
||
def get_path(grammar): | ||
"""Return the path of the peach pit for the given grammar. Return None if the | ||
Pit does not exist or the grammar is None.""" | ||
|
||
pit_dir = os.path.join(environment.get_platform_resources_directory(), | ||
'peach', 'pits') | ||
pit_path = os.path.join(pit_dir, grammar + '.xml') | ||
|
||
if not os.path.exists(pit_path): | ||
logs.log_error( | ||
'Pit file for "%s" grammar is not found.' % grammar, pit_path=pit_path) | ||
return None | ||
|
||
return pit_path |
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
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
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.