testutil.go 377 B

1234567891011121314
  1. // Copyright 2022 The Gogs 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 testutil
  5. import (
  6. "os"
  7. "strings"
  8. )
  9. // InTest is ture if the current binary looks like a test artifact.
  10. var InTest = len(os.Args) > 0 && strings.HasSuffix(strings.TrimSuffix(os.Args[0], ".exe"), ".test")