Skip to main content

Logic Tests (aka Unit Tests) and Application Tests (aka Integration Tests) with Jenkins and xcode

Motivation

Apple Developer: About Unit Testing

Logic Tests

  1. Apple Developer: Setting Up Unit-Testing in a Project
  2. Download convert OCUnit command line output to JUnit XML: OCUnit2JUnit and put it in your project
  3. Setup Freestyle project in Jenkins
  4. Add Execute shell step:
    • chmod +x ./pathtoscript/ocunit2junit.rb
    • xcodebuild -target myTarget -configuration myConfig -sdk iphonesimulator clean build | ./pathtoscript/ocunit2junit.rb
  5. Add post build action Publish JUnit Test Results with location:
    • test-reports/*.xml

Application Tests

  1. Apple Developer: Setting Up Unit-Testing in a Project
  2. Download the patched RunPlatformUnitTests script and put in your project
  3. Open the Build Phases - Run Script setting and change script path to "${PROJECT_DIR}/pathtoscript/RunPlatformUnitTests"
    • Download convert OCUnit command line output to JUnit XML: OCUnit2JUnit and put it in your project
    • Setup Freestyle project in Jenkins
    • Add Execute shell step:
      • chmod +x ./pathtoscript/ocunit2junit.rb
      • xcodebuild -target myTarget -configuration myConfig -sdk iphonesimulator TEST_AFTER_BUILD=YES clean build | ./pathtoscript/ocunit2junit.rb
    • Add post build action Publish JUnit Test Results with location:
      • test-reports/*.xml

    UI Automation Tests

    Upcoming...

    Comments

    Most Favorite Posts

    Pieceable Viewer

    Show your iOS apps on the web inside an interactive flash movie. Pieceable Viewer works with most iPhone applications. If you have a native binary that runs on the iOS Simulator, it should run in Pieceable Viewer. UIKit based applications work best. OpenGL and MapView based content runs but isn't rendered - these will be better supported in a later version. iPad applications will be supported in a later version. Pieceable

    Simple Reachability + Blocks

    I like this block-based approach much more as opposed to listening for notifications or having a delegate callback on a central Reachability instance. In most uses-cases I have seen so far you are probably just calling a method on the watching view controller and there it helps that the observer block can capture some state. Because of this we don’t need to use the C-level state passing. At the time of this writing the code for DTReachability is now present on the develop branch of DTFoundation, it will be merged into master for the next release. Since it has a dependency on the SystemConfiguration.framework I put it into its own static lib and Cocoapods sub spec to use individually. I am using this in AutoIngest for Mac now, but it should work without modification on iOS just the same. Your feedback is welcome. Cocoanetics

    Server-driven UI (SDUI): Meet Zalandos AppCraft and AirBnB Lona

    A short WTF: Joe Birch:  SERVER DRIVEN UI, PART 1: THE CONCEPT Zalando seems to follow the SDUI principle as well - defining a common design language and construct the screens on the backend while displaying them natively on the clients. They even go one step further; they implemented a mighty toolset to enable non-technical stakeholders to define their own native app screens Compass: Web tooling to create screens and bind data Beetroot: Backend service that combines the screen layout definition with the data Lapis/Golem: iOS/Android UI render engines Crazy cool! Good job, guys (when you do an open-source release?) To even move faster a Flutter based UI render engine implementation was great! See also AirBnB Lona SDUI approach Building a Visual Language Why Dropbox sunsetted its universal C++ mobile project and AirBnB its React Native implementation

    FF Chartwell: Defining pie chart, bar charts and many others via vector font!

      With FF Chartwell you can define Charts via OpenType font, and transform a string, e.g. " 60+ 30 + 10 " into a Pie Chart 60%-30%-10% including color support (not only b/w!) without rendering anything: directly via font without using any images! Check this out: FontBlog FF Chartwell So great!

    10 Coolest Keyboard Shortcuts You Never Knew About

    Keyboard shortcuts are the lifeblood of many productive Mac users. Not only can keyboard shortcuts make for a nicer user experience and cut down on the time needed to do a task, they can also just be plain cool. Mac OS X has many shortcuts ready and willing to do your bidding, but also has many hidden and unknown shortcuts. That's why we've compiled a list of 10 of the coolest keyboard shortcuts you never knew about. MacLife

    Facebook SDK 3.0 Beta for iOS

    1. Better user session management: In the past, managing auths, user sessions and tokens was hard. We've spent a lot of time working to make these takes easier for you. This release introduces FBSession, which manages, stores and refreshes user tokens with default behaviors you can override. It uses the block metaphor to notify your app when a user's token changes state. 2. Ready-to-Use Native UI Views: This SDK release includes a variety of pre-built user interface (UI) components for common functions. You can quickly drop them into your apps instead of building each one from scratch or using dialogs. This gives you a fast, native and consistent way to build common features. 3. Modern Objective-C language features support: With Automatic Reference Counting (ARC), you no longer have to spend as much time on memory management. Support for blocks means that it’s now more straightforward to handle sessions and calls to asynchronous Facebook APIs. This, along with inclusion o...

    Starting UIAutomation via command line

    You can do it now, starting with XCode 4.2 for iOS5 beta 4 From command line, you can run instruments pointing to the automation template and specify as environment variables the test script you want to execute and destination path for results: instruments -w device_id -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate application -e UIASCRIPT script -e UIARESULTSPATH results path DevForums Apple instruments Mac OS X Developer Tools Manual Page