Git Product home page Git Product logo

dharma's Introduction

Dharma

Build Status

Requirements

---

None

Examples

--- Generate a single test-case.
% ./dharma.py -grammars grammars/webcrypto.dg

Generate a single test case with multiple grammars.

% ./dharma.py -grammars grammars/canvas2d.dg grammars/mediarecorder.dg

Generating test-cases as files.

% ./dharma.py -grammars grammars/webcrypto.dg -storage . -count 5

Generate test-cases, send each over WebSocket to Firefox, observe the process for crashes and bucket them.

% ./dharma.py -server -grammars grammars/canvas2d.dg -template grammars/var/templates/html5/default.html
% ./framboise.py -setup inbound64-release -debug -worker 4 -testcase ~/dev/projects/fuzzers/dharma/grammars/var/index.html

Benchmark the generator.

% time ./dharma.py -grammars grammars/webcrypto.dg -count 10000 > /dev/null

Screenshots

Dharma Demo Dharma Menu

Grammar Cheetsheet

comment

``` %%% comment ```

controls

``` %const% name := value ```

sections

``` %section% := value %section% := variable %section% := variance ```

extension methods

``` %range%(0-9) %range%(0.0-9.0) %range%(a-z) %range%(!-~) %range%(0x100-0x200)

%repeat%(+variable+) %repeat%(+variable+, ", ")

%uri%(path) %uri%(lookup_key)

%block%(path)

%choice%(foo, "bar", 1)


<h4>assigning values</h4>

digit := %range%(0-9)

sign := + -

value := +sign+%repeat%(+digit+)


<h4>using values</h4>

+value+


<h4>assigning variables</h4>

variable := @variable@ = new Foo();


<h4>using variables</h4>

value := !variable!.bar();


<h4>referencing values from common.dg</h4>

value := attribute=+common:number+


<h4>calling javascript library functions</h4>

foo := Random.pick([0,1]);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.