From 9c5b4955726e04bd2fcf20ec00e56c060b7beb6f Mon Sep 17 00:00:00 2001 From: dodikk Date: Wed, 28 Mar 2012 21:45:59 +0300 Subject: [PATCH 1/6] mentioned the library and the *.c file from the previous pull request --- Coverage/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Coverage/README.md b/Coverage/README.md index aad5bd3..d5fd0fb 100644 --- a/Coverage/README.md +++ b/Coverage/README.md @@ -32,4 +32,5 @@ size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d ) } ``` -Add the code above to any .c file that is going to be linked into your application (must be in app itself, not the tests bundle). \ No newline at end of file +Add the code above to any .c file that is going to be linked into your application (must be in app itself, not the tests bundle). You can find this file in the source tree above. +Alternatively, you can link libCoverageFopenFix.a to it. This is a "fat" library that can be used both with for device and the simulator build. From 92be173ed897a5b1e2cacf8aea87a1e4212ce194 Mon Sep 17 00:00:00 2001 From: dodikk Date: Sun, 8 Apr 2012 11:39:35 +0300 Subject: [PATCH 2/6] added run script template to a separate file --- Tests/Jasmine/RunAutomationScript.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 Tests/Jasmine/RunAutomationScript.sh diff --git a/Tests/Jasmine/RunAutomationScript.sh b/Tests/Jasmine/RunAutomationScript.sh new file mode 100755 index 0000000..99b126e --- /dev/null +++ b/Tests/Jasmine/RunAutomationScript.sh @@ -0,0 +1,5 @@ + +TPL=/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate +APP=/Users/USERNAME/Library/Developer/Xcode/DerivedData/APP-RANDOMHASH/Build/Products/CONFIG-iphonesimulator/APPNAME.app + +instruments -t "$TPL" "$APP" -e UIASCRIPT PATHTOYOUR/suite.js -e UIARESULTSPATH PATHTO/ARTIFACTS From 6c616bb641fba30546fb8fecab03511ab9537fce Mon Sep 17 00:00:00 2001 From: dodikk Date: Sun, 8 Apr 2012 11:42:10 +0300 Subject: [PATCH 3/6] added sample spec to a separate file --- Tests/Jasmine/SampleSpec.sh | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Tests/Jasmine/SampleSpec.sh diff --git a/Tests/Jasmine/SampleSpec.sh b/Tests/Jasmine/SampleSpec.sh new file mode 100644 index 0000000..6d2af3e --- /dev/null +++ b/Tests/Jasmine/SampleSpec.sh @@ -0,0 +1,38 @@ +describe("PocketCasts", function() { + var target = UIATarget.localTarget(); + + function dumpTree() { + UIATarget.localTarget().frontMostApp().logElementTree(); + } + + function pickVideoWithIndex(i) { + target.frontMostApp().mainWindow().tableViews()[0].visibleCells()[i].tap(); + } + + function firstTableGroup() { + return target.frontMostApp().mainWindow().tableViews()[0].groups()[0]; + } + + function goBack() { + target.frontMostApp().navigationBar().leftButton().tap(); + } + + afterEach(function(){ + goBack(); + }); + + it("should show download button for video, that is not downloaded", function(){ + pickVideoWithIndex(0); + expect(firstTableGroup().name()).toEqual("Tap to download video"); + }); + + it("should show play button for video that is downloaded", function(){ + pickVideoWithIndex(1); + expect(firstTableGroup().name()).toEqual("Tap to play video"); + }); + + it("should show subscribe button for pro video when there's no subscription", function(){ + pickVideoWithIndex(2); + expect(firstTableGroup().name()).toEqual("Tap to subscribe at railscasts.com"); + }); +}); From a29c3c9531423e1110d58739117766570fb50fea Mon Sep 17 00:00:00 2001 From: dodikk Date: Sun, 8 Apr 2012 11:46:15 +0300 Subject: [PATCH 4/6] added compatibility for xCode 4.3 --- Tests/Jasmine/README.md | 6 ++++-- Tests/Jasmine/RunAutomationScript.sh | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Tests/Jasmine/README.md b/Tests/Jasmine/README.md index 555e0ed..2114684 100644 --- a/Tests/Jasmine/README.md +++ b/Tests/Jasmine/README.md @@ -11,7 +11,9 @@ UI Automation has a few issues, to make it work on simulator you need to launch it as follows: ```shell -TPL=/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate + +XCODE_PATH=`xcode-select -print-path` +TPL=$XCODE_PATH/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugI$ APP=/Users/USERNAME/Library/Developer/Xcode/DerivedData/APP-RANDOMHASH/Build/Products/CONFIG-iphonesimulator/APPNAME.app instruments -t "$TPL" "$APP" -e UIASCRIPT PATHTOYOUR/suite.js -e UIARESULTSPATH PATHTO/ARTIFACTS @@ -79,4 +81,4 @@ describe("PocketCasts", function() { 2012-02-10 10:07:19 +0000 Fail: Expected 'Tap to download video' to equal 'Tap to subscribe at railscasts.com'. Instruments Trace Complete (Duration : 8.940802s; Output : /Users/farcaller/Developer/Active/pocketcasts/PocketCasts/instrumentscli4.trace) -``` \ No newline at end of file +``` diff --git a/Tests/Jasmine/RunAutomationScript.sh b/Tests/Jasmine/RunAutomationScript.sh index 99b126e..5df3bdf 100755 --- a/Tests/Jasmine/RunAutomationScript.sh +++ b/Tests/Jasmine/RunAutomationScript.sh @@ -1,5 +1,6 @@ -TPL=/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate +XCODE_PATH=`xcode-select -print-path` +TPL=$XCODE_PATH/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate APP=/Users/USERNAME/Library/Developer/Xcode/DerivedData/APP-RANDOMHASH/Build/Products/CONFIG-iphonesimulator/APPNAME.app instruments -t "$TPL" "$APP" -e UIASCRIPT PATHTOYOUR/suite.js -e UIARESULTSPATH PATHTO/ARTIFACTS From 71855592004b29ea191acb4df934c9e30f63cc8d Mon Sep 17 00:00:00 2001 From: dodikk Date: Sun, 8 Apr 2012 11:55:24 +0300 Subject: [PATCH 5/6] fixed wrong copypaste --- Tests/Jasmine/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Jasmine/README.md b/Tests/Jasmine/README.md index 2114684..a0ec669 100644 --- a/Tests/Jasmine/README.md +++ b/Tests/Jasmine/README.md @@ -13,7 +13,7 @@ UI Automation has a few issues, to make it work on simulator you need to launch ```shell XCODE_PATH=`xcode-select -print-path` -TPL=$XCODE_PATH/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugI$ +TPL=$XCODE_PATH/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate APP=/Users/USERNAME/Library/Developer/Xcode/DerivedData/APP-RANDOMHASH/Build/Products/CONFIG-iphonesimulator/APPNAME.app instruments -t "$TPL" "$APP" -e UIASCRIPT PATHTOYOUR/suite.js -e UIARESULTSPATH PATHTO/ARTIFACTS From b693a5d3b330f897a251cb8d23c33fc3ec91376f Mon Sep 17 00:00:00 2001 From: dodikk Date: Mon, 23 Apr 2012 19:33:20 +0300 Subject: [PATCH 6/6] added html export script for CI --- Coverage/ExportHtml.automator | 22 ++++++++++++++++++++++ Coverage/ExportHtmlComment.txt | 1 + 2 files changed, 23 insertions(+) create mode 100644 Coverage/ExportHtml.automator create mode 100644 Coverage/ExportHtmlComment.txt diff --git a/Coverage/ExportHtml.automator b/Coverage/ExportHtml.automator new file mode 100644 index 0000000..573fe7f --- /dev/null +++ b/Coverage/ExportHtml.automator @@ -0,0 +1,22 @@ +on run argv + + tell application "/Applications/CoverStory.app" + + quit + + activate + + set x to open (item 1 of argv) + + tell x to export to HTML in (item 2 of argv) + + quit + + end tell + + + + return item 1 of argv & "|" & item 2 of argv + +end run + diff --git a/Coverage/ExportHtmlComment.txt b/Coverage/ExportHtmlComment.txt new file mode 100644 index 0000000..3ef6022 --- /dev/null +++ b/Coverage/ExportHtmlComment.txt @@ -0,0 +1 @@ +http://jorudolph.wordpress.com/category/ios-continous-integration-series/