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

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package user
  5. import (
  6. "fmt"
  7. "os"
  8. "path/filepath"
  9. "testing"
  10. "code.gitea.io/gitea/models"
  11. "code.gitea.io/gitea/modules/setting"
  12. _ "github.com/mattn/go-sqlite3" // for the test engine
  13. )
  14. func TestMain(m *testing.M) {
  15. if err := models.CreateTestEngine("../../models/fixtures/"); err != nil {
  16. fmt.Printf("Error creating test engine: %v\n", err)
  17. os.Exit(1)
  18. }
  19. setting.AppURL = "https://try.gitea.io/"
  20. setting.RunUser = "runuser"
  21. setting.SSH.Port = 3000
  22. setting.SSH.Domain = "try.gitea.io"
  23. setting.RepoRootPath = filepath.Join(os.TempDir(), "repos")
  24. setting.AppDataPath = filepath.Join(os.TempDir(), "appdata")
  25. os.Exit(m.Run())
  26. }