title: How to run one-time setup code before executing any XCTest
body: <p>I have the following problem. I want to execute a piece of code before all test classes are executed. For instance: I don't want my game to use the SoundEngine singleton during executing, but the SilentSoundEngine. I would like to activate the SilentSoundEngine one time not in all tests. All my tests look like this:</p>
  
  <pre><code>class TestBasketExcercise : XCTestCase {        
      override func setUp() {
          SilentSoundEngine.activate () // SoundEngine is a singleton
      }
      // The tests 
  }
  </code></pre>
  
  <p>-Edit- 
  Most of the answers are directed at providing custom superclass for the TestCase. I am looking for a more general and cleaner way to provide the environment that all tests need to execute. Isn't there a "main" function/ Appdelegate like feature  somewhere for tests? </p>