constants_test.go 601 Bytes
Newer Older
David Vorick's avatar
David Vorick committed
1 2 3 4 5 6 7 8 9 10 11
package types

import (
	"testing"

	"github.com/NebulousLabs/Sia/build"
)

// TestCheckBuildConstants checks that the required build constants have been
// set.
func TestCheckBuildConstants(t *testing.T) {
David Vorick's avatar
David Vorick committed
12
	// Verify that the build has been set to 'testing'.
David Vorick's avatar
David Vorick committed
13 14 15 16
	if build.Release != "testing" {
		t.Error("build.Release needs to be set to \"testing\"")
		t.Error(build.Release)
	}
David Vorick's avatar
David Vorick committed
17 18 19 20 21 22 23 24
	if testing.Short() {
		t.SkipNow()
	}
	// Verify that, for the longer tests, the 'debug' build tag has been used.
	if !build.DEBUG {
		t.Error("DEBUG needs to be enabled for testing to work.")
		t.Error(build.DEBUG)
	}
David Vorick's avatar
David Vorick committed
25
}