-
-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inkscape: add unit test for ps2pdf plugin
to prevent future regressen add a smal test, to check if ps2pdf plugin is working by createing a .ps / .eps file and converting it back to svg
- Loading branch information
tuxcoder
committed
Apr 19, 2024
1 parent
9bf31ea
commit fae8ec3
Showing
2 changed files
with
30 additions
and
0 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
27 changes: 27 additions & 0 deletions
27
pkgs/applications/graphics/inkscape/test-ps2pdf-plugin.nix
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,27 @@ | ||
{ inkscape, runCommand, writeTextFile }: | ||
|
||
let | ||
svg_file = writeTextFile { | ||
name = "test.svg"; | ||
text = '' | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<svg width="50" height="50" version="1.1"> | ||
<ellipse cx="1" cy="1" rx="1" ry="1" /> | ||
</svg>''; | ||
}; | ||
in | ||
runCommand "inkscape-test-eps" | ||
{ | ||
nativeBuildInputs = [ inkscape ]; | ||
} '' | ||
echo ps test | ||
inkscape ${svg_file} --export-type=ps -o test.ps | ||
inkscape test.ps -o test.ps.svg | ||
echo eps test | ||
inkscape ${svg_file} --export-type=eps -o test.eps | ||
inkscape test.eps -o test.eps.svg | ||
# inkscape does not return an error code, only does not create files | ||
[[ -f test.ps.svg && -f test.eps.svg ]] && touch $out | ||
'' |