draw2d/pdf2d/samples_test.go

39 lines
902 B
Go

// See also test_test.go
package pdf2d_test
import (
"testing"
"github.com/stanim/draw2d"
"github.com/stanim/draw2d.samples"
"github.com/stanim/draw2d.samples/android"
"github.com/stanim/draw2d.samples/frameimage"
"github.com/stanim/draw2d.samples/gopher"
"github.com/stanim/draw2d.samples/helloworld"
"github.com/stanim/draw2d.samples/line"
)
func TestSampleAndroid(t *testing.T) {
test(t, android.Main)
}
func TestSampleGopher(t *testing.T) {
test(t, gopher.Main)
}
func TestSampleHelloWorld(t *testing.T) {
// Set the global folder for searching fonts
// The pdf backend needs for every ttf file its corresponding json
// file which is generated by gofpdf/makefont.
draw2d.SetFontFolder(samples.Dir("helloworld", "../"))
test(t, helloworld.Main)
}
func TestSampleFrameImage(t *testing.T) {
test(t, frameimage.Main)
}
func TestSampleLine(t *testing.T) {
test(t, line.Main)
}