File tree Expand file tree Collapse file tree 10 files changed +110
-30
lines changed Expand file tree Collapse file tree 10 files changed +110
-30
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ //go:build js
2
+
3
+ package field
4
+
5
+ import (
6
+ "testing"
7
+ "testing/quick"
8
+ )
9
+
10
+ //gopherjs:keep-original
11
+ func TestAliasing (t * testing.T ) {
12
+ // The test heavily uses 64-bit math, which is slow under GopherJS. Reducing
13
+ // the number of iterations makes run time more manageable.
14
+ t .Cleanup (quick .GopherJSInternalMaxCountCap (100 ))
15
+ _gopherjs_original_TestAliasing (t )
16
+ }
Original file line number Diff line number Diff line change
1
+ //go:build js
2
+
3
+ package field
4
+
5
+ import "testing/quick"
6
+
7
+ // Tests in this package use 64-bit math, which is slow under GopherJS. To keep
8
+ // test run time reasonable, we reduce the number of test iterations.
9
+ var quickCheckConfig1024 = & quick.Config {MaxCountScale : 10 }
Original file line number Diff line number Diff line change
1
+ //go:build js
2
+
3
+ package edwards25519
4
+
5
+ import "testing/quick"
6
+
7
+ // Tests in this package use 64-bit math, which is slow under GopherJS. To keep
8
+ // test run time reasonable, we reduce the number of test iterations.
9
+ var quickCheckConfig1024 = & quick.Config {MaxCountScale : 1 }
Original file line number Diff line number Diff line change
1
+ //go:build js
2
+
3
+ package edwards25519
4
+
5
+ import "testing/quick"
6
+
7
+ // Tests in this package use 64-bit math, which is slow under GopherJS. To keep
8
+ // test run time reasonable, we reduce the number of test iterations.
9
+ var quickCheckConfig32 = & quick.Config {MaxCountScale : 0.5 }
Original file line number Diff line number Diff line change
1
+ //go:build js
2
+
3
+ package x509
4
+
5
+ import "testing"
6
+
7
+ //gopherjs:keep-original
8
+ func TestConstraintCases (t * testing.T ) {
9
+ if testing .Short () {
10
+ // These tests are slow under GopherJS. Since GopherJS doesn't touch
11
+ // business logic behind them, there's little value in running them all.
12
+ // Instead, in the short mode we just just the first few as a smoke test.
13
+ nameConstraintsTests = nameConstraintsTests [0 :5 ]
14
+ }
15
+ _gopherjs_original_TestConstraintCases (t )
16
+ }
Original file line number Diff line number Diff line change
1
+ //go:build js
2
+
3
+ package gif
4
+
5
+ import "testing"
6
+
7
+ //gopherjs:keep-original
8
+ func FuzzDecode (t * testing.F ) {
9
+ if testing .Short () {
10
+ t .Skip ("FuzzDecode is slow, skipping in the short mode." )
11
+ }
12
+
13
+ _gopherjs_original_FuzzDecode (t )
14
+ }
Original file line number Diff line number Diff line change
1
+ //go:build js
2
+
3
+ package quick
4
+
5
+ var maxCountCap int = 0
6
+
7
+ // GopherJSInternalMaxCountCap sets an upper bound of iterations quick test may
8
+ // perform. THIS IS GOPHERJS-INTERNAL API, DO NOT USE IT OUTSIDE OF THE GOPHERJS
9
+ // CODEBASE, IT MAY CHANGE OR DISAPPEAR WITHOUT NOTICE.
10
+ //
11
+ // This function can be used to limit run time of standard library tests which
12
+ // use testing/quick with too many iterations for GopherJS to complete in a
13
+ // reasonable amount of time. This is a better compromise than disabling a slow
14
+ // test entirely.
15
+ //
16
+ // //gopherjs:keep-original
17
+ // func TestFoo(t *testing.T) {
18
+ // t.Cleanup(quick.GopherJSInternalMaxCountCap(100))
19
+ // _gopherjs_original_TestFoo(t)
20
+ // }
21
+
22
+ func GopherJSInternalMaxCountCap (newCap int ) (restore func ()) {
23
+ previousCap := maxCountCap
24
+ maxCountCap = newCap
25
+ return func () {
26
+ maxCountCap = previousCap
27
+ }
28
+ }
29
+
30
+ //gopherjs:keep-original
31
+ func (c * Config ) getMaxCount () (maxCount int ) {
32
+ maxCount = c ._gopherjs_original_getMaxCount ()
33
+ if maxCountCap > 0 && maxCount > maxCountCap {
34
+ maxCount = maxCountCap
35
+ }
36
+ return maxCount
37
+ }
You can’t perform that action at this time.
0 commit comments