integrate: make tests parallel

This commit is contained in:
Egon Elbre
2020-03-14 12:46:32 +02:00
parent 8f4a280bc3
commit e1429629f0
6 changed files with 12 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ import (
)
func TestHermite(t *testing.T) {
t.Parallel()
for cas, test := range []struct {
n int
f func(float64) float64
@@ -70,6 +71,7 @@ func TestHermite(t *testing.T) {
}
func TestHermiteLocations(t *testing.T) {
t.Parallel()
// Test the hermite locations and weights against other precomputed table.
// Data from http://dlmf.nist.gov/3.5.
for _, test := range []struct {
@@ -139,6 +141,7 @@ func TestHermiteLocations(t *testing.T) {
}
func TestHermiteInitialGuesses(t *testing.T) {
t.Parallel()
for _, test := range []struct {
n int
want []float64
@@ -164,6 +167,7 @@ func TestHermiteInitialGuesses(t *testing.T) {
}
func TestHermiteLocationsAsy0(t *testing.T) {
t.Parallel()
for _, test := range []struct {
n int
x []float64
@@ -199,6 +203,7 @@ func TestHermiteLocationsAsy0(t *testing.T) {
}
func TestHermiteAsyAiry(t *testing.T) {
t.Parallel()
for _, test := range []struct {
n int
theta []float64

View File

@@ -12,6 +12,7 @@ import (
)
func TestLegendre(t *testing.T) {
t.Parallel()
for i, test := range []struct {
f func(float64) float64
min, max float64
@@ -43,6 +44,7 @@ func TestLegendre(t *testing.T) {
}
func TestLegendreSingle(t *testing.T) {
t.Parallel()
for c, test := range []struct {
n int
min, max float64

View File

@@ -13,6 +13,7 @@ import (
)
func TestFixed(t *testing.T) {
t.Parallel()
for i, test := range []struct {
f func(float64) float64
min, max float64
@@ -85,6 +86,7 @@ func (l legendreNonSingle) FixedLocations(x, weight []float64, min, max float64)
}
func TestFixedNonSingle(t *testing.T) {
t.Parallel()
// TODO(btracey): Add tests with infinite bounds when we have native support
// for indefinite integrals.
for i, test := range []struct {

View File

@@ -13,6 +13,7 @@ import (
)
func TestRomberg(t *testing.T) {
t.Parallel()
for i, test := range []struct {
integral testquad.Integral
n int

View File

@@ -14,6 +14,7 @@ import (
)
func TestSimpsons(t *testing.T) {
t.Parallel()
rnd := rand.New(rand.NewSource(1))
for i, test := range []struct {
integral testquad.Integral

View File

@@ -14,6 +14,7 @@ import (
)
func TestTrapezoidal(t *testing.T) {
t.Parallel()
rnd := rand.New(rand.NewSource(1))
for i, test := range []struct {
integral testquad.Integral