Xcode no longer recognizes tests - objective-c

I've been troubleshooting this for a few days and am all out of ideas.
I was using unit testing in Xcode and it was working great. All of a sudden Xcode no longer recognizes my tests. If I go to the tests panel, it shows that I have zero tests. I actually have 13.
The ability to run individual tests or certain classes is now gone. It doesn't show the buttons in the gutter of the editor area.
I am still able to run all of my tests if I click the button to the right of the "0 Tests" in the test panel. When I click this it then starts populating all of my tests and they still appear to run properly. However, now that the tests are shown in the tests panel, they still are not linked to my tests in the classes. Usually if you click on a test, it will take you to it in the file where it lives. This functionality is gone.
I opened up another old project I had saved and it is having the same issue. However, I started a new project and it is working just fine and is showing no signs of any problems.
Any ideas as to what I may have done? I've found a few other threads out there about this on here, but none of them have gotten any helpful responses and are at least a number of months old. Hoping maybe creating a new thread will bump this again.
My next thought is to start the project over again and copy my files over. Not sure what else to do.

I had the same problem, and all my methods have the test prefix.
So, the problem is with Xcode indexing, as some targets could see all tests and some could not. To create a fresh index, follow these steps:
Quit Xcode
Go to ~/Library/Developer/Xcode/DerivedData/
Remove this folder. You can use rm -rf YourProjectDir
Done! When you open the project, wait for reindexing, and the tests should appear as usual.

All test method begin with "test":
func testValidateStudent()
{
// your code
}
make sure that your test methods begin with "test".

The test markers seem to be shown depending on the current scheme and whether the tests match that scheme.
(I tested that in Xcode 11, not sure about the time, when the question was asked originally. In my case I had to clear derived data to make the test markers appear again at all and then noticed the scheme dependency. The problem may have been triggered when I added a test with the same name to two different test targets.)
See screenshot below for a project with iOS and tvos targets. For instance the tests for the iOS target (on the left hand side in screenshot) will only be marked when the iOS target / scheme is selected. The tvos tests (on the right hand side in screenshot) will not show the markers in that case. Switching the scheme (red mark in top left) will hide the iOS test markers in the file on the left and show the tvos test markers in the file on the right.

Related

Camera in Roblox Studio (testing and building) is not working correctly

There are actually two camera problems.
The first is that sometimes the RMB to control the camera angle in Studio doesn't work. Sometimes using the LMB or movement keys helps, other times (like right now) it doesn't do anything. The hand cursor appears to shake in the direction I want to pan the camera but nothing happens. I did have an Advanced Camera plugin.
When I'm testing my game in Studio, I have NO camera control via RMB and zooming is nonfunctional. This is to say that I can turn using my mouse, but RMB doesn't change how mouseview works. Probably unrelated, but I cannot get scripts from the toolbox for run, crouch, zoom, etc. to work, either, even when I place them where instructed.
I get these errors in my game:
 16:36:47.313 ▼ ActivateCameraController did not select a module. (x3) - Client - CameraModule:362
     16:36:47.314    ActivateCameraController did not select a module.
     16:36:47.314    ActivateCameraController did not select a module.
I've been having trouble with Studio eating up too much bandwidth when NOT in use during actual gameplay in Roblox (exe), so I removed all the Studio plugins, thinking one of them might be the culprit (deliberate or accidental), and also hoping it might fix the camera issues. No such luck.
Probably unrelated, but I found a couple of apparently simple viruses (Vaccine and Fire) using clone() and spread() to reproduce within the confines that their simple scripts dictated. I removed all instances, as well as a presumably fake Antivirus. The first two were very basic scripts designed to spread the script and didn't do any damage (although the latter would damage players).
#Kylaaa came up with the answers, but there's no way for me to mark them as answers.
The problems did not occur in a new game until I copied all the stuff I'd added into it (from the troubled game).
Regarding RMB not working in the Studio:
Sometimes, if the Workspace Camera gets set to Scriptable, all mouse inputs stop working. You could try checking if switching the CameraType to Fixed or anything else fixes your problem. It should be in the Properties window when you select the Camera in the Workspace.
What I did: I changed the mode and the problem stopped. I suspect that the Advanced Camera plug-in that I had removed had something to do with the problem.
Regarding the camera not zooming and RMB not working during testing:
you have a malicious script somewhere in your Workspace. You can search/filter the workspace for Script and it will show all of the objects with scripts in them. I would recommend removing or Disabling the each of the scripts until you find which one is causing the errors
When you click on a Script in the Explorer, look in the Properties widget. There should be a checkbox titled Disabled. When you select that, it will prevent the script from running when the game starts
What I did: I deleted a bunch of stuff my son had added, and then disabled ALL scripts, then started enabling them one unique instance at a time (i.e. duplicates were enabled simultaneously). The camera problem didn't come back except when I edited a script during testing. I never located the problem script, despite going through and triggering all scripts.

VB.Net application highlights all files in background when running / getting focus

I have an App that I inherited in VB6 and have ported mostly to VB.net
When I compile / run the app - it highlights all the files in the current selected folder.
What makes it worse, is it's very difficult to search online as what search terms does one use?
The app was ported to VS 2005 - quite successfully - but this has me stumped...
I have tried commenting out all the code that's run on startup and it still does it, so it must be some sort of background thing...
Any ideas?
I can't find an old version of my app to see if it's changes I have made and I don't know where to begin. See the image:
The top part is before I run the app, the bottom is once the app is running and has focus. I hope it makes sense
Also, if I'm browsing and then run the app, and go back to the browser, when my app gets the focus again, the webpage goes back to the top...
The folder is just an example - Basically when I compile (or later run) my App, if I go to Windows Explorer - when the app gets focus - whatever folder I am in has all its files highlighted. If instead of going to Windows Explorer, I go to a web browser, when the app gets focus the browser goes to the top (similar to Home).
There is Windows Integratio, but I have commented out what I can and still am no closer.
Does this info help?
I found the problem - after going back to the vb6 project and removing everything except for the 5 modules needed to startup and I eventually tracked the problem.
There was some code being called when two edit boxes received focus which called send keys home and end - hence it would go home - select all files to the end. I had deactivated one of the edit boxes to not receive focus and it helped temporarily(obviously until the other box got focus), but since deactivating the send keys when they get focus has helped. Albeit an arbitrary problem, maybe it will help someone in the future..

changed product name in build settings, now app won't launch in simulator

I wanted a different title to be displayed in the sub-title under my iPad app's icon and changed the Product Name for my app under Build Settings.
This worked but has had a strange side effect. Whilst the app continued to work perfectly on a connected iPad, on the emulator it now behaves in a similar way to that described in [this question].1
Namely, it says it has finished running <my app> on iPad 6.0 Simulator
I tried changing the Product Name back but the problem persists.
I also tried some of the suggestions on the other question (e.g. removing armv7 frfom Required Device Capabilities) but nothing worked.
This isn't a showstopper at the moment as I have a real iPad to test on but I'd still like to understand what is going on, if anyone knows.
Sounds like time for a reboot of the Mac. Restarting Xcode might suffice. One other thing to try is to delete the app from the simulator.
I have seen this on iPhone simulator 6. Many a times, when you click "Run" again - it runs without problem.
However if that doesn't work, you may try one of the following:
Project->Command+Alt+Shift+K - a choice will appear saying something like clean folders. Do it.
In organizer, go to derived data folder (finder) using tiny arrow just at the right of your project. Try deleting your project from finder. If it doesnt delete at once, try it often.
Try resetting iPhone or iPad simulator.
Exit XCode and reopen project. Do the same with iPhone / iPad simulator.
If you are wondering why this is happening, no one really knows! It's just some flags gone bad, restored once you re-do everything for it to work, that's it.
Have you tried switching off the Debugger?
So Edit Schemes -> Debugger -> None
Also restarting the Simulator and Xcode and cleaning the project may help
Use another way: click on the azure icon of your project, keep the trackpad pressed until you see it allows to edit the name. Choose the name that you want, then a sheet like this will appear:
Click "rename" and you're done with it.

Titanium Mobile - Simulator exits without error

I have following problem:
In my titanium project I save an image ( from UIView.toImage() ) to a file in applicationDirectory. Then I have a Obj-C module, where I read out that file.
Then an image processing algorithm is applied from a C++ Lib.
Before the algorithm is applied to the image I have a function which gets the ARGB-values from
the values I get from the file. I make a Pixel Matrix out of them.
Then, after the algorithm is applied I transform the new Pixel Matrix back into an UIImage to save it to a file.
My problem is, that sometimes the program crashes BEFORE the algorithm is applied (I use NSLogs to see where it crashes, that is right, isn't it? ) and sometimes the whole Obj-C Module finishes its work ...
I don't get any error message in the Titanium Console... Is there some way to see why I get the crashs or is there a way to debug my titanium project efficiently?
I debug the modules that I work on by running my test project in XCode. When the app crashes, XCode will break at some unhelpful spot. BUT what is helpful is the stack trace. I can usually clean enough information from that to figure out what is going wrong, and where.
Let me be explicit about "test project".
- If you are running your module by doing "titanium run" from the terminal, I will open the generated project in XCode and run it from there (you'll see the path to it in the generated log statements after you "titanium run" your module).
- Or, if you have your module as part of an actual project, build the project once, and open it in XCode. Run it, crash it, and you'll get a stack trace to help you on your way.
Another option would be for you to stick your really problematic code in some of the core Titanium Mobile code -- like in the PlatformModule.m. This is a module like your own, except its source code is right there. Then you'll be able set breakpoints, inspect your variables, and enjoy the full benefits of using XCode to see what's going on in your objective-c.
I hope this helps, and gets you on your way! Let me know if I can clarify anything further. -Dawson

Why are Selenium IDE playback controls inactive? (How can I run recorded tests?)

I started learning how to use Selenium today. I have never used it before. I downloaded the Selenium IDE (1.0.10) plugin for FireFox (3.5.16). The way it's behaving is not matching up to the docs.
When I click the record button and perform actions in my browser, nothing happens in the IDE (nothing is recorded). (Actually, initially it did record, but now it doesn't) I tried restarting FireFox and that had no effect.
Also, the main controls are now inactive. I've included a screen shot to show what I mean by that. The controls remain inactive even it I click or double click on the name of a test case in the panel on the left.
And one final question -- it appears that a Selenium test case mentions Chrome in its default configuration even though the docs say you can only record tests using FireFox. Should I do anything about that?
If anyone can shed light on any of the above mysteries I would appreciate it. Thanks!
UPDATE
I restarted FireFox again and now it's recording actions, but the controls are still greyed-out as in the screenshot, so I can't play back the test.
The issue is that you are not in the HTML runner mode. The IDE has no concept of ruby or python or c# or Java. That is up to plugins which just essentially do a find an replace.
*chrome means Firefox Chrome. Something that has been around for a lot longer than Google Chrome the browser. It means use the browser chrome which removes a couple sandboxing issues.
If you want to play back the tests you can't go out of the table mode otherwise the IDE won't understand what to do. The code in the screenshot should be stored in a .rb file and that should be executed.
Let me try to unravel mysteries -
As soon as you launch the IDE it would be in recording mode. Do you see last Red button which is enabled.
IDE Tests can be executed only when in the selenese/html format (aka table format). I guess you have changed the format to ruby (I guess so), from Option > Format.
To be able to execute tests change it back to html from option > Format > HTML
Take my words, IDE is only and only for firefox