main_test.go raw

   1  package relay
   2  
   3  import (
   4  	"os"
   5  	"testing"
   6  
   7  	"git.smesh.lol/torly/pkg/sigtrap"
   8  )
   9  
  10  // TestMain installs the signal dispositions a normal program gets and a test
  11  // binary does not. These tests write to sockets that the relay closes, and under
  12  // TinyGo an EPIPE on those writes is a fatal signal: without this the test
  13  // process dies silently part way through a shutdown test.
  14  func TestMain(m *testing.M) {
  15  	sigtrap.IgnorePipe()
  16  	os.Exit(m.Run())
  17  }
  18