Making your test scheme runnable for Travis CI

I recently added unit tests to my ConvenientFileManager project however I ran into some trouble when attempting get this project to build and run my tests on Travis CI. I got the following error:

The command "xctool -project ConvenientFileManager.xcodeproj -scheme ConvenientFileManager build -scheme ConvenientFileManagerTests test -sdk iphonesimulator" exited with 1.

However when I ran the tests from my local Xcode installation through the UI everything was fine 🤔. Keen to avoid the infamous "it's fine on my computer" comment I attempted to run my tests through the command line using the same command as used on Travis CI:

xctool -project ConvenientFileManager.xcodeproj -scheme ConvenientFileManager build -scheme ConvenientFileManagerTests test -sdk iphonesimulator

With the above command I was able to reproduce the error and begin to make progress on how to address it. After investigation I stumbled upon the solution - I had to mark the ConvenientFileManagerTests scheme as runnable:

Test scheme marked as runnable

With that tick my build was working on Travis CI - all that hassle because when creating the project I didn't tick the other tickbox for automatically adding unit testing to my project.