You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

main_test.go 826 B

8 years ago
8 years ago
8 years ago
1234567891011121314151617181920212223242526272829303132333435
  1. package models
  2. import (
  3. "fmt"
  4. "os"
  5. "path/filepath"
  6. "testing"
  7. "code.gitea.io/gitea/modules/setting"
  8. _ "github.com/mattn/go-sqlite3" // for the test engine
  9. "github.com/stretchr/testify/assert"
  10. )
  11. // TestFixturesAreConsistent assert that test fixtures are consistent
  12. func TestFixturesAreConsistent(t *testing.T) {
  13. assert.NoError(t, PrepareTestDatabase())
  14. CheckConsistencyForAll(t)
  15. }
  16. func TestMain(m *testing.M) {
  17. if err := CreateTestEngine("fixtures/"); err != nil {
  18. fmt.Printf("Error creating test engine: %v\n", err)
  19. os.Exit(1)
  20. }
  21. setting.AppURL = "https://try.gitea.io/"
  22. setting.RunUser = "runuser"
  23. setting.SSH.Port = 3000
  24. setting.SSH.Domain = "try.gitea.io"
  25. setting.RepoRootPath = filepath.Join(os.TempDir(), "repos")
  26. setting.AppDataPath = filepath.Join(os.TempDir(), "appdata")
  27. os.Exit(m.Run())
  28. }