More consistent test interfaces + test skipping

This commit is contained in:
Taylor Gerring
2015-06-10 17:04:06 -04:00
parent b6d40a9312
commit ac0637c413
7 changed files with 108 additions and 78 deletions

View File

@ -30,20 +30,29 @@ type TransactionTest struct {
Transaction TtTransaction
}
func RunTransactionTests(file string, notWorking map[string]bool) error {
func RunTransactionTests(file string) error {
skipTest := make(map[string]bool, len(transSkipTests))
for _, name := range transSkipTests {
skipTest[name] = true
}
bt := make(map[string]TransactionTest)
if err := LoadJSON(file, &bt); err != nil {
return err
}
for name, in := range bt {
var err error
// TODO: remove this, we currently ignore some tests which are broken
if !notWorking[name] {
if err = runTest(in); err != nil {
return fmt.Errorf("bad test %s: %v", name, err)
}
fmt.Println("Transaction test passed:", name)
for name, test := range bt {
// if the test should be skipped, return
if skipTest[name] {
fmt.Println("Skipping state test", name)
return nil
}
// test the block
if err := runTest(test); err != nil {
return err
}
fmt.Println("Transaction test passed: ", name)
}
return nil
}