Question

I have a couple of SenTestCase subclasses (Logic tests) in by test target, with STFail macros in the test methods. I added the test target through Xcode, when I first created the project (checked "Include Unit Tests").

When I run my tests, I get a spinner saying they are running, and that they succeeded, but they obviously have not run (or they would have failed).

My test scheme config LOOKS good, with each of my test showing up in there and being checked.

My test classes are of the form <CustomName>Tests, and each of the test methods is of the form: - (void)test<MyTestName>. All of my classes have been added to the test target.

What could be wrong here?

Was it helpful?

Solution

In my case the problem was the following:

I had renamed my app's main target since creating the project. I had to reconcile this with the testing target, but changing the "Bundle Loader" setting appropriately, replacing the old target name with the new target name.

A bit random, but there it is.

OTHER TIPS

Please provide more information in your questions. You wouldn't send a text to the auto repair shop that said "My car will not start. Why does it not start?"

There are lots of reasons your tests may not be running.

Did you add them with the Xcode helper (the add-file-wizard), or manually? In each case, there are some things that must be done.

A small checklist...

Class names must end in Test. Test methods must begin with test. Did you add them as Application or Logic test type? - they are different. Did you add them to the Test target?

(I removed a link to an out-dated SO link - I guess I saved the wrong one)

Glad to see you solved your problem... and another reason it's good to provide complete context :-)

I had the same problem, but it still didn't work after having replaced all occurrences of the old project name. However, resetting the iOS Simulator worked for me:

"iOS Simulator" > "Reset Content and Settings..." in the iOS simulator menu.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top