How start GHUnit tests without tapping Run button?

I use GHUnit framework for testing static library. At this moment I need tap the button Run to start my tests. But I would like to start tests when application launched because I need teamcity launch my testApp. So how can I modified standart UI and start tests automatic?

-------------Problems Reply------------

Do Product -> Edit Scheme… -> Arguments -> Environment Variables, then set GHUNIT_AUTORUN to YES.

Make your unit test target dependent on your application, so that you always built the application before the unit tests.

Then, simply add a "setUp()" method to launch your app (and wait for it to be launched) before continuing.

  1. Check that your application is already running:

    NSArray* apps = [[NSWorkspace sharedWorkspace] valueForKeyPath:@"launchedApplications.NSApplicationBundleIdentifier"]; BOOL myAppIsRunning = [apps containsObject: com.mycompany.myapp];

  2. Launch your application (in setUP()) and wait:

    [[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier: com.mycompany.myapp options: NSWorkspaceLaunchWithoutActivation additionalEventParamDescriptor: NULL launchIdentifier: nil]; while (![self isRunning]) // see above { sleep(1); }

Category:objective c Views:0 Time:2011-04-04

Related post

  • Dealing with rapid tapping on Buttons 2010-05-22

    I have a Button with an OnClickListener. For illustrative purposes, consider a button that shows a modal dialog: public class SomeActivity ... { protected void onCreate(Bundle state) { super.onCreate(state); findViewById(

  • wpf - validation - how to show tooltips and disable "run" button 2011-01-01

    Hi I need to validate some of textboxes in my application. I decied to use validation rule "DataErrorValidationRule". That's why in my class I implemented IDataErrorInfo interface and wrote aproperiate functions. In my xaml code I added bindings and

  • How to lock "Run" button in TeamCity 2011-03-25

    I made a build in TeamCity which deploys code to live server. As a precaution I want to disable that button "run" can be clicked by mistake.So I want to have an additional level of checking "whether I'm sure" I want to click "run" button. Is it possi

  • run button in xcode 4 2011-05-17

    Whenever I re-run my application by selecting the run button in xcode for, it says simulator already in use. So I have to stop it every time before re-running. So my question is, is there any option or setting to avoid this. I want to run the applica

  • I am making a game, and I want a number to be added to a label when the user taps a button 2011-05-27

    I am making a game, and I want a number to be added to a label when the user taps a button. Like it adds 5 points when the button. --------------Solutions------------- Declare IBOutlet UILabel *scoreLabel; and implement this method: -(IBAction)button

  • Distinguishing between tapping a button and holding a button down on iPhone 2011-06-14

    In my app, I have a button that triggers an action. However, I'd like to do the following instead. If the user taps the button, then trigger tapAction. If the user holds the button down for, say 1 second (getting a sense of the right length of time h

  • RUN button no enable in QtCreator for QML project 2011-07-08

    I am using QTCreator 2.2.1, based on QT 4.7.4(32 bit) on Windows XP. I made a QML project from new -> QML project menu but the RUN button is not enable. How do I run QML project. --------------Solutions------------- Have you created a new QML file

  • iOS: Action Method to Dial Phone Number Upon User Tapping a Button 2011-07-09

    I would like to provide the functionality whereby a user can dial a phone number by tapping a button next to a label that shows the number. I have the basic button action method: -(IBAction)Call:(id)sender{ //Define function } ... but I don't underst

  • How are Ant vs Eclipse run buttons related? 2011-10-08

    Hi guys : I'm getting the dreaded "classnotfound" exception in eclipse in an Ant managed project. I notice that there is an "ant" icon right next to my standard green button for running java projects, with very similar options. What is the relationsh

  • How to show UIKeyboard upon tapping a button? 2011-12-16

    I want to show the UIKeyboard upon tapping a UIButton and display the text (typed by the user) on a UILabel. Is this possible? --------------Solutions------------- You can create a hidden UITextField, and set it as firstResponder. As you inputing any

  • Count tap on button xcode 2012-01-04

    I got a (stupid) question. I'm busy with a 'tap' app (i dont know how to name it) it's a game with a button in the middle of the screen and when a play start tapping the button it need's to count the click's. Does anoyone know what i need to use (cla

  • iPhone Keyboard Rapidly tapping 'Next' Button 2012-01-10

    In my app, it causes problems if the 'Next' button (return key) is tapped rapidly. Is there a way I can stop the user from doing this? I can't think of a solution myself. I am in a UIScrollView with many pages and on a certain page I have a keyboard

  • How to mute and unmute audio in iPad by tapping a button 2012-03-07

    I'd like to know how to make the mute and unmute the audio on my iPad application by tapping a button. I already have a working code in my viewDidLoad method that plays a music when the app is launched. All I need to do is to create a button that wil

  • How to keep data associated with MKAnnotation from being lost after a callout pops up and user taps disclosure button? 2012-03-21

    How do I keep data associated with an MKAnnotation object after the user taps the pin, sees a callout, and taps the disclosure button which opens a detailed view controller? I want to display all data associated with the pin in the detail view contro

  • Disabling the "Run" button in Internet Explorer Download Dialog box 2013-05-07

    I have been successful to disable the buttons such as "Save" in the download dialog box through the registery editor but I would like to be able disable the "Run" button; Windows XP standard user or guest are still able to execute application from th

  • L925 (WP8.1) shows "Deleting" while tapping "Share" button to share multiple photos- is this expected? 2012-04-17

    My device L925 (WP8.1) shows "Deleting" while tapping "Share" button to share multiple photos steps here; go to PHOTOS tap "Select" icon select more number of photos (30 count) tap "Share" button now the screen shows "Deleting" , but goes to share sc

  • Lost Run Button 2012-04-25

    When I click on start I cant find my run button anymore! Please help! --------------Solutions------------- You only have to post your question once in these Forums. One question = One post. These are not Chat Rooms.

  • RUN button turned into RUN.lnk 2012-07-31

    my pc's RUN button turned into RUN.lnk & every time when i clicking on thefrom start button, its saying not velid --------------Solutions------------- Press +R to show the Run box, type RSTRUI and press Enter. Choose a date before the problem sta

  • Download Bar Won't Let Me Use Run Button 2012-10-31

    I'm running Internet Explorer 10 under Windows 7. Normally when I download a program, I select the Run button on the yellow download bar that appears at the bottom of the screen. It asks, "So you want to run or save...", but for the last few days the

Copyright (C), All Rights Reserved.

processed in 0.066 (s). 11 q(s)