multi: run all test instances in parallel

This commit is contained in:
Olaoluwa Osuntokun
2017-06-17 00:59:20 +02:00
parent bb9bc9205a
commit 1be4d67ce4
30 changed files with 195 additions and 1 deletions

View File

@@ -162,6 +162,8 @@ func generateTests(t *testing.T) []deriveTest {
// TestDeriveIndex check the correctness of index derive function by testing
// the index corner cases.
func TestDeriveIndex(t *testing.T) {
t.Parallel()
for _, test := range generateTests(t) {
pos, err := test.from.deriveBitTransformations(test.to)
if err != nil {
@@ -218,6 +220,8 @@ var deriveElementTests = []struct {
// TestSpecificationDeriveElement is used to check the consistency with
// specification hash derivation function.
func TestSpecificationDeriveElement(t *testing.T) {
t.Parallel()
for _, test := range deriveElementTests {
// Generate seed element.
element, err := newElementFromStr(test.seed, rootIndex)

View File

@@ -10,6 +10,8 @@ import (
// TestShaChainProducerRestore checks the ability of shachain producer to be
// properly recreated from binary representation.
func TestShaChainProducerRestore(t *testing.T) {
t.Parallel()
var err error
seed := chainhash.DoubleHashH([]byte("shachaintest"))

View File

@@ -403,6 +403,8 @@ var tests = []struct {
// TestSpecificationShaChainInsert is used to check the consistency with
// specification hash insert function.
func TestSpecificationShaChainInsert(t *testing.T) {
t.Parallel()
for _, test := range tests {
receiver := NewRevocationStore()
@@ -433,6 +435,8 @@ func TestSpecificationShaChainInsert(t *testing.T) {
// TestShaChainStore checks the ability of shachain store to hold the produced
// secrets after recovering from bytes data.
func TestShaChainStore(t *testing.T) {
t.Parallel()
seed := chainhash.DoubleHashH([]byte("shachaintest"))
sender := NewRevocationProducer(seed)