servicetest_unix_test.go 517 B

1234567891011121314151617181920212223
  1. // Copyright 2016 Lawrence Woodman <[email protected]>
  2. // Use of this source code is governed by a zlib-style
  3. // license that can be found in the LICENSE file.
  4. // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
  5. package service_test
  6. import (
  7. "os"
  8. "testing"
  9. )
  10. func interruptProcess(t *testing.T) {
  11. pid := os.Getpid()
  12. p, err := os.FindProcess(pid)
  13. if err != nil {
  14. t.Fatalf("FindProcess: %s", err)
  15. }
  16. if err := p.Signal(os.Interrupt); err != nil {
  17. t.Fatalf("Signal: %s", err)
  18. }
  19. }