graph/graphs/gen: make tests parallel
MODIFY
graph/graphs/gen/batagelj_brandes_test.go
graph/graphs/gen/batagelj_brandes_test.go
@@ -53,6 +53,7 @@ func (g *gnDirected) SetEdge(e graph.Edge) {
}
func TestGnpUndirected(t *testing.T) {
+ t.Parallel()
for n := 2; n <= 20; n++ {
for p := 0.; p <= 1; p += 0.1 {
g := &gnUndirected{UndirectedBuilder: simple.NewUndirectedGraph()}
@@ -79,6 +80,7 @@ func TestGnpUndirected(t *testing.T) {
}
func TestGnpDirected(t *testing.T) {
+ t.Parallel()
for n := 2; n <= 20; n++ {
for p := 0.; p <= 1; p += 0.1 {
g := &gnDirected{DirectedBuilder: simple.NewDirectedGraph()}
@@ -102,6 +104,7 @@ func TestGnpDirected(t *testing.T) {
}
func TestGnmUndirected(t *testing.T) {
+ t.Parallel()
for n := 2; n <= 20; n++ {
nChoose2 := (n - 1) * n / 2
for m := 0; m <= nChoose2; m++ {
@@ -129,6 +132,7 @@ func TestGnmUndirected(t *testing.T) {
}
func TestGnmDirected(t *testing.T) {
+ t.Parallel()
for n := 2; n <= 20; n++ {
nChoose2 := (n - 1) * n / 2
for m := 0; m <= nChoose2*2; m++ {
@@ -153,6 +157,7 @@ func TestGnmDirected(t *testing.T) {
}
func TestSmallWorldsBBUndirected(t *testing.T) {
+ t.Parallel()
for n := 2; n <= 20; n++ {
for d := 1; d <= (n-1)/2; d++ {
for p := 0.; p < 1; p += 0.1 {
@@ -181,6 +186,7 @@ func TestSmallWorldsBBUndirected(t *testing.T) {
}
func TestSmallWorldsBBDirected(t *testing.T) {
+ t.Parallel()
for n := 2; n <= 20; n++ {
for d := 1; d <= (n-1)/2; d++ {
for p := 0.; p < 1; p += 0.1 {
@@ -206,6 +212,7 @@ func TestSmallWorldsBBDirected(t *testing.T) {
}
func TestPowerLawUndirected(t *testing.T) {
+ t.Parallel()
for n := 2; n <= 20; n++ {
for d := 1; d <= 5; d++ {
g := multi.NewUndirectedGraph()
@@ -236,6 +243,7 @@ func TestPowerLawUndirected(t *testing.T) {
}
func TestPowerLawDirected(t *testing.T) {
+ t.Parallel()
for n := 2; n <= 20; n++ {
for d := 1; d <= 5; d++ {
g := multi.NewDirectedGraph()
@@ -266,6 +274,7 @@ func TestPowerLawDirected(t *testing.T) {
}
func TestBipartitePowerLawUndirected(t *testing.T) {
+ t.Parallel()
for n := 2; n <= 20; n++ {
for d := 1; d <= 5; d++ {
g := multi.NewUndirectedGraph()
@@ -315,6 +324,7 @@ func TestBipartitePowerLawUndirected(t *testing.T) {
}
func TestBipartitePowerLawDirected(t *testing.T) {
+ t.Parallel()
for n := 2; n <= 20; n++ {
for d := 1; d <= 5; d++ {
g := multi.NewDirectedGraph()

MODIFY
graph/graphs/gen/duplication_test.go
graph/graphs/gen/duplication_test.go
@@ -33,6 +33,7 @@ func (g *duplication) SetEdge(e graph.Edge) {
}
func TestDuplication(t *testing.T) {
+ t.Parallel()
for n := 2; n <= 50; n++ {
for alpha := 0.1; alpha <= 1; alpha += 0.1 {
for delta := 0.; delta <= 1; delta += 0.2 {

MODIFY
graph/graphs/gen/holme_kim_test.go
graph/graphs/gen/holme_kim_test.go
@@ -11,6 +11,7 @@ import (
)
func TestTunableClusteringScaleFree(t *testing.T) {
+ t.Parallel()
for n := 2; n <= 20; n++ {
for m := 0; m < n; m++ {
for p := 0.; p <= 1; p += 0.1 {
@@ -39,6 +40,7 @@ func TestTunableClusteringScaleFree(t *testing.T) {
}
func TestPreferentialAttachment(t *testing.T) {
+ t.Parallel()
for n := 2; n <= 20; n++ {
for m := 0; m < n; m++ {
g := &gnUndirected{UndirectedBuilder: simple.NewUndirectedGraph()}

MODIFY
graph/graphs/gen/small_world_test.go
graph/graphs/gen/small_world_test.go
@@ -17,6 +17,7 @@ var smallWorldDimensionParameters = [][]int{
}
func TestNavigableSmallWorldUndirected(t *testing.T) {
+ t.Parallel()
for p := 1; p < 5; p++ {
for q := 0; q < 10; q++ {
for r := 0.5; r < 10; r++ {
@@ -51,6 +52,7 @@ func TestNavigableSmallWorldUndirected(t *testing.T) {
}
func TestNavigableSmallWorldDirected(t *testing.T) {
+ t.Parallel()
for p := 1; p < 5; p++ {
for q := 0; q < 10; q++ {
for r := 0.5; r < 10; r++ {

graph/graphs/gen: make tests parallel