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 759 B

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