Skip to content

Commit

Permalink
Merge pull request #14 from lobingera/wip-07-ready
Browse files Browse the repository at this point in the history
WIP 0.6
  • Loading branch information
lobingera authored Jan 14, 2018
2 parents 6bbd2a5 + bcc11c8 commit 734501d
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 23 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ os:
- linux
- osx
julia:
- 0.4
- 0.5
- 0.6
- nightly
notifications:
email: false
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ Rsvg.jl
=======

[![Build Status](https://travis-ci.org/lobingera/Rsvg.jl.svg?branch=master)](https://travis-ci.org/lobingera/Rsvg.jl)
[![Rsvg](http://pkg.julialang.org/badges/Rsvg_0.4.svg)](http://pkg.julialang.org/?pkg=Rsvg)
[![Rsvg](http://pkg.julialang.org/badges/Rsvg_0.5.svg)](http://pkg.julialang.org/?pkg=Rsvg)
[![Rsvg](http://pkg.julialang.org/badges/Rsvg_0.6.svg)](http://pkg.julialang.org/?pkg=Rsvg)

Adaptation of the [librsvg](https://wiki.gnome.org/LibRsvg?action=show).

Expand Down
10 changes: 5 additions & 5 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
julia 0.4
Gtk 0.8.6
Cairo 0.2.30
BinDeps 0.3.9
Compat 0.7.20
julia 0.6
Gtk
Cairo
BinDeps
Compat
@osx Homebrew
@windows WinRPM
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
environment:
matrix:
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.4/julia-0.4-latest-win64.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"

branches:
Expand Down
7 changes: 5 additions & 2 deletions src/Rsvg.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

__precompile__()
module Rsvg

depsjl = joinpath(dirname(@__FILE__), "..", "deps", "deps.jl")
Expand All @@ -13,7 +13,10 @@ include("calls.jl")

export RsvgDimensionData, RsvgHandle

Rsvg.set_default_dpi(72.0)

function __init__()
Rsvg.set_default_dpi(72.0)
end

end # module

Expand Down
41 changes: 31 additions & 10 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,40 @@ using Rsvg
using Cairo
using Gtk


using Base.Test

include("test.jl")

pkg_dir = dirname(dirname(@__FILE__))

@printf("\nTest: dimension of known images")

@testset "dimensions of known images " begin

d = test_get_dimension(joinpath(pkg_dir,"data","mulberry.svg"));
@test (d.height == 512) & (d.width == 513)

@test d.height == 512
@test d.width == 513

d = test_get_dimension(joinpath(pkg_dir,"data","diag.svg"));
@test (d.height == 400) & (d.width == 400)

@test d.height == 400
@test d.width == 400

d = test_get_dimension(joinpath(pkg_dir,"data","lotus.svg"));
@test (d.height == 720) & (d.width == 576)

@test d.height == 720
@test d.width == 576

d = test_get_dimension(joinpath(pkg_dir,"data","star.svg"));
@test (d.height == 198) & (d.width == 224)

@printf("\nTest: render to png")
@test d.height == 198
@test d.width == 224

end


@testset "render to png " begin

f = tempname() * ".png"
test_render_to_png(joinpath(pkg_dir,"data","mulberry.svg"),f);
Expand All @@ -40,18 +53,26 @@ f = tempname() * ".png"
test_render_to_png(joinpath(pkg_dir,"data","star.svg"),f);
@test stat(f).size > 0

@printf("\nTest: render string to png")
end


@testset "render string to png " begin

f = tempname() * ".png"
test_render_string_to_png(f);
@test stat(f).size > 0

@printf("\nTest: roundtrip, render svg to svg")
end

@testset "roundtrip, render svg to svg" begin

f = tempname() * ".svg"
test_roundtrip(joinpath(pkg_dir,"data","lotus.svg"),f);

@test stat(f).size > 0

d = test_get_dimension(f);
@test (d.height == 720) & (d.width == 576)
@test d.height == 720
@test d.width == 576

@printf("\n");
end

0 comments on commit 734501d

Please sign in to comment.