diff --git a/graph/layout/isomap_noasm_test.go b/graph/layout/isomap_noasm_test.go new file mode 100644 index 00000000..212cfa22 --- /dev/null +++ b/graph/layout/isomap_noasm_test.go @@ -0,0 +1,12 @@ +// Copyright ©2019 The Gonum Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build noasm appengine safe + +package layout + +// Change the testdata path for calculations done without assembly kernels. +func init() { + tag = "_noasm" +} diff --git a/graph/layout/isomap_test.go b/graph/layout/isomap_test.go index 20345be3..babcf7cb 100644 --- a/graph/layout/isomap_test.go +++ b/graph/layout/isomap_test.go @@ -15,6 +15,10 @@ import ( "gonum.org/v1/plot/vg" ) +// tag is modified in isomap_noasm_test.go to "_noasm" when any +// build tag prevents use of the assembly numerical kernels. +var tag string + var isomapR2Tests = []struct { name string g graph.Graph @@ -160,7 +164,7 @@ func TestIsomapR2(t *testing.T) { } p.Add(render{o}) p.HideAxes() - path := filepath.Join("testdata", test.name+".png") + path := filepath.Join("testdata", test.name+tag+".png") err = p.Save(10*vg.Centimeter, 10*vg.Centimeter, path) if err != nil { t.Errorf("unexpected error: %v", err) diff --git a/graph/layout/testdata/line_isomap_noasm_golden.png b/graph/layout/testdata/line_isomap_noasm_golden.png new file mode 100644 index 00000000..d39f8387 Binary files /dev/null and b/graph/layout/testdata/line_isomap_noasm_golden.png differ diff --git a/graph/layout/testdata/sheet_isomap_noasm_golden.png b/graph/layout/testdata/sheet_isomap_noasm_golden.png new file mode 100644 index 00000000..b4397e26 Binary files /dev/null and b/graph/layout/testdata/sheet_isomap_noasm_golden.png differ diff --git a/graph/layout/testdata/square_isomap_noasm_golden.png b/graph/layout/testdata/square_isomap_noasm_golden.png new file mode 100644 index 00000000..130f3821 Binary files /dev/null and b/graph/layout/testdata/square_isomap_noasm_golden.png differ diff --git a/graph/layout/testdata/tetrahedron_isomap_noasm_golden.png b/graph/layout/testdata/tetrahedron_isomap_noasm_golden.png new file mode 100644 index 00000000..cbbdda58 Binary files /dev/null and b/graph/layout/testdata/tetrahedron_isomap_noasm_golden.png differ diff --git a/graph/layout/testdata/tube_isomap_noasm_golden.png b/graph/layout/testdata/tube_isomap_noasm_golden.png new file mode 100644 index 00000000..68681e8b Binary files /dev/null and b/graph/layout/testdata/tube_isomap_noasm_golden.png differ diff --git a/graph/layout/testdata/wp_page_isomap_noasm_golden.png b/graph/layout/testdata/wp_page_isomap_noasm_golden.png new file mode 100644 index 00000000..7846140f Binary files /dev/null and b/graph/layout/testdata/wp_page_isomap_noasm_golden.png differ