Git Product home page Git Product logo

diagrams-backend-tests's Introduction

Backend Tests

This is a simple test framework for diagrams. To test diagrams, first configure

% cabal configure -fcairo

Supported backends are: cairo, svg, postscript. canvas (HTML5) used to be supported and hopefully will be again soon. You can also do

% cabal configure -fall

to make an executable called "all-test" which will test all backends side-by-side. Then build:

% cabal build

Then run:

% ./dist/build/cairo-test/cairo-test

This generates a file called cairo-index.html (or svg-index.html, etc). Open this in your browser.

% open cairo-index.html

That's it!

Adding tests

Edit src/Diagrams/Tests.hs, and add to the examples list. Feel free to use helper functions inside the Tests.hs file. The name of the test should be a (UNIX) filename (no spaces, no slashes, no stars, etc)

Adding backends

To add a new backend, see the templates in cabal, src/Diagrams/Test/, and tests/*hs.

Specifically:

  • Add a new -f option and Executable -test in diagrams-tests.cabal
  • Add a src/Diagrams/Test/.hs
  • Add a .hs in tests/ which just calls out to the above.
  • Add to tests/All.hs

Now you can use

% cabal configure -f

diagrams-backend-tests's People

Contributors

andygill avatar bergey avatar byorgey avatar cchalmers avatar fryguybob avatar jeffreyrosenbluth avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diagrams-backend-tests's Issues

all-test fails on pgf/clip-multi.pdf

Error: /undefinedfilename in (pgf/clip-multi.pdf)
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push
Dictionary stack:
   --dict:1199/1684(ro)(G)--   --dict:0/20(G)--   --dict:78/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.18: Unrecoverable error, exit code 1
all-test: Image 2 not read

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.