xcodebuild-helper 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. metadata +4 -220
  3. data/.codeclimate.yml +0 -20
  4. data/.gitignore +0 -1
  5. data/.rspec +0 -2
  6. data/.travis.yml +0 -7
  7. data/Gemfile +0 -6
  8. data/Gemfile.lock +0 -114
  9. data/Guardfile +0 -18
  10. data/README.md +0 -7
  11. data/Rakefile +0 -7
  12. data/assets/style.css +0 -110
  13. data/bin/oclint +0 -5
  14. data/bin/oclint-0.8 +0 -5
  15. data/bin/oclint-json-compilation-database +0 -5
  16. data/bin/oclint-xcodebuild +0 -5
  17. data/externals/oclint/LICENSE +0 -69
  18. data/externals/oclint/bin/oclint +0 -0
  19. data/externals/oclint/bin/oclint-0.10.2 +0 -0
  20. data/externals/oclint/bin/oclint-json-compilation-database +0 -88
  21. data/externals/oclint/bin/oclint-xcodebuild +0 -218
  22. data/externals/oclint/lib/clang/3.7.0/asan_blacklist.txt +0 -13
  23. data/externals/oclint/lib/clang/3.7.0/include/Intrin.h +0 -958
  24. data/externals/oclint/lib/clang/3.7.0/include/__stddef_max_align_t.h +0 -43
  25. data/externals/oclint/lib/clang/3.7.0/include/__wmmintrin_aes.h +0 -72
  26. data/externals/oclint/lib/clang/3.7.0/include/__wmmintrin_pclmul.h +0 -34
  27. data/externals/oclint/lib/clang/3.7.0/include/adxintrin.h +0 -88
  28. data/externals/oclint/lib/clang/3.7.0/include/altivec.h +0 -13528
  29. data/externals/oclint/lib/clang/3.7.0/include/ammintrin.h +0 -215
  30. data/externals/oclint/lib/clang/3.7.0/include/arm_acle.h +0 -304
  31. data/externals/oclint/lib/clang/3.7.0/include/arm_neon.h +0 -68419
  32. data/externals/oclint/lib/clang/3.7.0/include/avx2intrin.h +0 -1256
  33. data/externals/oclint/lib/clang/3.7.0/include/avx512bwintrin.h +0 -1250
  34. data/externals/oclint/lib/clang/3.7.0/include/avx512cdintrin.h +0 -131
  35. data/externals/oclint/lib/clang/3.7.0/include/avx512dqintrin.h +0 -242
  36. data/externals/oclint/lib/clang/3.7.0/include/avx512erintrin.h +0 -285
  37. data/externals/oclint/lib/clang/3.7.0/include/avx512fintrin.h +0 -2457
  38. data/externals/oclint/lib/clang/3.7.0/include/avx512vlbwintrin.h +0 -1907
  39. data/externals/oclint/lib/clang/3.7.0/include/avx512vldqintrin.h +0 -353
  40. data/externals/oclint/lib/clang/3.7.0/include/avx512vlintrin.h +0 -1982
  41. data/externals/oclint/lib/clang/3.7.0/include/avxintrin.h +0 -1308
  42. data/externals/oclint/lib/clang/3.7.0/include/bmi2intrin.h +0 -99
  43. data/externals/oclint/lib/clang/3.7.0/include/bmiintrin.h +0 -153
  44. data/externals/oclint/lib/clang/3.7.0/include/cpuid.h +0 -209
  45. data/externals/oclint/lib/clang/3.7.0/include/cuda_builtin_vars.h +0 -110
  46. data/externals/oclint/lib/clang/3.7.0/include/emmintrin.h +0 -1480
  47. data/externals/oclint/lib/clang/3.7.0/include/f16cintrin.h +0 -63
  48. data/externals/oclint/lib/clang/3.7.0/include/float.h +0 -124
  49. data/externals/oclint/lib/clang/3.7.0/include/fma4intrin.h +0 -236
  50. data/externals/oclint/lib/clang/3.7.0/include/fmaintrin.h +0 -234
  51. data/externals/oclint/lib/clang/3.7.0/include/fxsrintrin.h +0 -55
  52. data/externals/oclint/lib/clang/3.7.0/include/htmintrin.h +0 -226
  53. data/externals/oclint/lib/clang/3.7.0/include/htmxlintrin.h +0 -363
  54. data/externals/oclint/lib/clang/3.7.0/include/ia32intrin.h +0 -101
  55. data/externals/oclint/lib/clang/3.7.0/include/immintrin.h +0 -203
  56. data/externals/oclint/lib/clang/3.7.0/include/inttypes.h +0 -102
  57. data/externals/oclint/lib/clang/3.7.0/include/iso646.h +0 -43
  58. data/externals/oclint/lib/clang/3.7.0/include/limits.h +0 -118
  59. data/externals/oclint/lib/clang/3.7.0/include/lzcntintrin.h +0 -72
  60. data/externals/oclint/lib/clang/3.7.0/include/mm3dnow.h +0 -167
  61. data/externals/oclint/lib/clang/3.7.0/include/mm_malloc.h +0 -75
  62. data/externals/oclint/lib/clang/3.7.0/include/mmintrin.h +0 -507
  63. data/externals/oclint/lib/clang/3.7.0/include/module.modulemap +0 -196
  64. data/externals/oclint/lib/clang/3.7.0/include/nmmintrin.h +0 -35
  65. data/externals/oclint/lib/clang/3.7.0/include/pmmintrin.h +0 -122
  66. data/externals/oclint/lib/clang/3.7.0/include/popcntintrin.h +0 -50
  67. data/externals/oclint/lib/clang/3.7.0/include/prfchwintrin.h +0 -39
  68. data/externals/oclint/lib/clang/3.7.0/include/rdseedintrin.h +0 -59
  69. data/externals/oclint/lib/clang/3.7.0/include/rtmintrin.h +0 -59
  70. data/externals/oclint/lib/clang/3.7.0/include/s390intrin.h +0 -39
  71. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/allocator_interface.h +0 -66
  72. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/asan_interface.h +0 -155
  73. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/common_interface_defs.h +0 -118
  74. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/coverage_interface.h +0 -63
  75. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/dfsan_interface.h +0 -114
  76. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/linux_syscall_hooks.h +0 -3070
  77. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/lsan_interface.h +0 -84
  78. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/msan_interface.h +0 -107
  79. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/tsan_interface_atomic.h +0 -222
  80. data/externals/oclint/lib/clang/3.7.0/include/shaintrin.h +0 -79
  81. data/externals/oclint/lib/clang/3.7.0/include/smmintrin.h +0 -487
  82. data/externals/oclint/lib/clang/3.7.0/include/stdalign.h +0 -35
  83. data/externals/oclint/lib/clang/3.7.0/include/stdarg.h +0 -52
  84. data/externals/oclint/lib/clang/3.7.0/include/stdatomic.h +0 -190
  85. data/externals/oclint/lib/clang/3.7.0/include/stdbool.h +0 -44
  86. data/externals/oclint/lib/clang/3.7.0/include/stddef.h +0 -137
  87. data/externals/oclint/lib/clang/3.7.0/include/stdint.h +0 -707
  88. data/externals/oclint/lib/clang/3.7.0/include/stdnoreturn.h +0 -30
  89. data/externals/oclint/lib/clang/3.7.0/include/tbmintrin.h +0 -154
  90. data/externals/oclint/lib/clang/3.7.0/include/tgmath.h +0 -1374
  91. data/externals/oclint/lib/clang/3.7.0/include/tmmintrin.h +0 -230
  92. data/externals/oclint/lib/clang/3.7.0/include/unwind.h +0 -282
  93. data/externals/oclint/lib/clang/3.7.0/include/vadefs.h +0 -65
  94. data/externals/oclint/lib/clang/3.7.0/include/varargs.h +0 -26
  95. data/externals/oclint/lib/clang/3.7.0/include/vecintrin.h +0 -8946
  96. data/externals/oclint/lib/clang/3.7.0/include/wmmintrin.h +0 -42
  97. data/externals/oclint/lib/clang/3.7.0/include/x86intrin.h +0 -81
  98. data/externals/oclint/lib/clang/3.7.0/include/xmmintrin.h +0 -1008
  99. data/externals/oclint/lib/clang/3.7.0/include/xopintrin.h +0 -809
  100. data/externals/oclint/lib/clang/3.7.0/include/xtestintrin.h +0 -41
  101. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib +0 -0
  102. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib +0 -0
  103. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.builtins-i386.a +0 -0
  104. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.builtins-x86_64.a +0 -0
  105. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.profile_osx.a +0 -0
  106. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.safestack_osx.a +0 -0
  107. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib +0 -0
  108. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib +0 -0
  109. data/externals/oclint/lib/oclint/reporters/libHTMLReporter.dylib +0 -0
  110. data/externals/oclint/lib/oclint/reporters/libJSONReporter.dylib +0 -0
  111. data/externals/oclint/lib/oclint/reporters/libPMDReporter.dylib +0 -0
  112. data/externals/oclint/lib/oclint/reporters/libTextReporter.dylib +0 -0
  113. data/externals/oclint/lib/oclint/reporters/libXMLReporter.dylib +0 -0
  114. data/externals/oclint/lib/oclint/reporters/libXcodeReporter.dylib +0 -0
  115. data/externals/oclint/lib/oclint/rules/libAvoidBranchingStatementAsLastInLoopRule.dylib +0 -0
  116. data/externals/oclint/lib/oclint/rules/libAvoidDefaultArgumentsOnVirtualMethodsRule.dylib +0 -0
  117. data/externals/oclint/lib/oclint/rules/libAvoidPrivateStaticMembersRule.dylib +0 -0
  118. data/externals/oclint/lib/oclint/rules/libBaseClassDestructorShouldBeVirtualOrProtectedRule.dylib +0 -0
  119. data/externals/oclint/lib/oclint/rules/libBitwiseOperatorInConditionalRule.dylib +0 -0
  120. data/externals/oclint/lib/oclint/rules/libBrokenNullCheckRule.dylib +0 -0
  121. data/externals/oclint/lib/oclint/rules/libBrokenOddnessCheckRule.dylib +0 -0
  122. data/externals/oclint/lib/oclint/rules/libCollapsibleIfStatementsRule.dylib +0 -0
  123. data/externals/oclint/lib/oclint/rules/libConstantConditionalOperatorRule.dylib +0 -0
  124. data/externals/oclint/lib/oclint/rules/libConstantIfExpressionRule.dylib +0 -0
  125. data/externals/oclint/lib/oclint/rules/libCoveredSwitchStatementsDontNeedDefaultRule.dylib +0 -0
  126. data/externals/oclint/lib/oclint/rules/libCyclomaticComplexityRule.dylib +0 -0
  127. data/externals/oclint/lib/oclint/rules/libDeadCodeRule.dylib +0 -0
  128. data/externals/oclint/lib/oclint/rules/libDefaultLabelNotLastInSwitchStatementRule.dylib +0 -0
  129. data/externals/oclint/lib/oclint/rules/libDestructorOfVirtualClassRule.dylib +0 -0
  130. data/externals/oclint/lib/oclint/rules/libDoubleNegativeRule.dylib +0 -0
  131. data/externals/oclint/lib/oclint/rules/libEmptyCatchStatementRule.dylib +0 -0
  132. data/externals/oclint/lib/oclint/rules/libEmptyDoWhileStatementRule.dylib +0 -0
  133. data/externals/oclint/lib/oclint/rules/libEmptyElseBlockRule.dylib +0 -0
  134. data/externals/oclint/lib/oclint/rules/libEmptyFinallyStatementRule.dylib +0 -0
  135. data/externals/oclint/lib/oclint/rules/libEmptyForStatementRule.dylib +0 -0
  136. data/externals/oclint/lib/oclint/rules/libEmptyIfStatementRule.dylib +0 -0
  137. data/externals/oclint/lib/oclint/rules/libEmptySwitchStatementRule.dylib +0 -0
  138. data/externals/oclint/lib/oclint/rules/libEmptyTryStatementRule.dylib +0 -0
  139. data/externals/oclint/lib/oclint/rules/libEmptyWhileStatementRule.dylib +0 -0
  140. data/externals/oclint/lib/oclint/rules/libForLoopShouldBeWhileLoopRule.dylib +0 -0
  141. data/externals/oclint/lib/oclint/rules/libGotoStatementRule.dylib +0 -0
  142. data/externals/oclint/lib/oclint/rules/libInvertedLogicRule.dylib +0 -0
  143. data/externals/oclint/lib/oclint/rules/libJumbledIncrementerRule.dylib +0 -0
  144. data/externals/oclint/lib/oclint/rules/libLongClassRule.dylib +0 -0
  145. data/externals/oclint/lib/oclint/rules/libLongLineRule.dylib +0 -0
  146. data/externals/oclint/lib/oclint/rules/libLongMethodRule.dylib +0 -0
  147. data/externals/oclint/lib/oclint/rules/libLongVariableNameRule.dylib +0 -0
  148. data/externals/oclint/lib/oclint/rules/libMisplacedNullCheckRule.dylib +0 -0
  149. data/externals/oclint/lib/oclint/rules/libMissingBreakInSwitchStatementRule.dylib +0 -0
  150. data/externals/oclint/lib/oclint/rules/libMultipleUnaryOperatorRule.dylib +0 -0
  151. data/externals/oclint/lib/oclint/rules/libNPathComplexityRule.dylib +0 -0
  152. data/externals/oclint/lib/oclint/rules/libNcssMethodCountRule.dylib +0 -0
  153. data/externals/oclint/lib/oclint/rules/libNestedBlockDepthRule.dylib +0 -0
  154. data/externals/oclint/lib/oclint/rules/libNonCaseLabelInSwitchStatementRule.dylib +0 -0
  155. data/externals/oclint/lib/oclint/rules/libObjCAssignIvarOutsideAccessorsRule.dylib +0 -0
  156. data/externals/oclint/lib/oclint/rules/libObjCBoxedExpressionsRule.dylib +0 -0
  157. data/externals/oclint/lib/oclint/rules/libObjCContainerLiteralsRule.dylib +0 -0
  158. data/externals/oclint/lib/oclint/rules/libObjCNSNumberLiteralsRule.dylib +0 -0
  159. data/externals/oclint/lib/oclint/rules/libObjCObjectSubscriptingRule.dylib +0 -0
  160. data/externals/oclint/lib/oclint/rules/libObjCVerifyIsEqualHashRule.dylib +0 -0
  161. data/externals/oclint/lib/oclint/rules/libObjCVerifyMustCallSuperRule.dylib +0 -0
  162. data/externals/oclint/lib/oclint/rules/libObjCVerifyProhibitedCallRule.dylib +0 -0
  163. data/externals/oclint/lib/oclint/rules/libObjCVerifyProtectedMethodRule.dylib +0 -0
  164. data/externals/oclint/lib/oclint/rules/libObjCVerifySubclassMustImplementRule.dylib +0 -0
  165. data/externals/oclint/lib/oclint/rules/libParameterReassignmentRule.dylib +0 -0
  166. data/externals/oclint/lib/oclint/rules/libPreferEarlyExitRule.dylib +0 -0
  167. data/externals/oclint/lib/oclint/rules/libRedundantConditionalOperatorRule.dylib +0 -0
  168. data/externals/oclint/lib/oclint/rules/libRedundantIfStatementRule.dylib +0 -0
  169. data/externals/oclint/lib/oclint/rules/libRedundantLocalVariableRule.dylib +0 -0
  170. data/externals/oclint/lib/oclint/rules/libRedundantNilCheckRule.dylib +0 -0
  171. data/externals/oclint/lib/oclint/rules/libReturnFromFinallyBlockRule.dylib +0 -0
  172. data/externals/oclint/lib/oclint/rules/libShortVariableNameRule.dylib +0 -0
  173. data/externals/oclint/lib/oclint/rules/libSwitchStatementsShouldHaveDefaultRule.dylib +0 -0
  174. data/externals/oclint/lib/oclint/rules/libThrowExceptionFromFinallyBlockRule.dylib +0 -0
  175. data/externals/oclint/lib/oclint/rules/libTooFewBranchesInSwitchStatementRule.dylib +0 -0
  176. data/externals/oclint/lib/oclint/rules/libTooManyFieldsRule.dylib +0 -0
  177. data/externals/oclint/lib/oclint/rules/libTooManyMethodsRule.dylib +0 -0
  178. data/externals/oclint/lib/oclint/rules/libTooManyParametersRule.dylib +0 -0
  179. data/externals/oclint/lib/oclint/rules/libUnnecessaryElseStatementRule.dylib +0 -0
  180. data/externals/oclint/lib/oclint/rules/libUnnecessaryNullCheckForCXXDeallocRule.dylib +0 -0
  181. data/externals/oclint/lib/oclint/rules/libUnusedLocalVariableRule.dylib +0 -0
  182. data/externals/oclint/lib/oclint/rules/libUnusedMethodParameterRule.dylib +0 -0
  183. data/externals/oclint/lib/oclint/rules/libUselessParenthesesRule.dylib +0 -0
  184. data/lib/coverage_html_converter.rb +0 -141
  185. data/lib/coverage_plan.rb +0 -27
  186. data/lib/device.rb +0 -27
  187. data/lib/execute.rb +0 -7
  188. data/lib/lint_plan.rb +0 -41
  189. data/lib/rules.rb +0 -23
  190. data/lib/test_plan.rb +0 -11
  191. data/lib/version.rb +0 -3
  192. data/lib/xcode.rb +0 -128
  193. data/lib/xcodebuild-helper.rb +0 -135
  194. data/spec/coverage_html_coverter_spec.rb +0 -55
  195. data/spec/coverage_plan_spec.rb +0 -23
  196. data/spec/device_spec.rb +0 -24
  197. data/spec/lint_plan_spec.rb +0 -35
  198. data/spec/rule_spec.rb +0 -37
  199. data/spec/spec_helper.rb +0 -17
  200. data/spec/test_plan_spec.rb +0 -11
  201. data/spec/xcode_dsl_actions_spec.rb +0 -227
  202. data/spec/xcode_dsl_spec.rb +0 -176
  203. data/spec/xcode_spec.rb +0 -85
  204. data/xcodebuild-helper.gemspec +0 -27
@@ -1,227 +0,0 @@
1
- require 'xcodebuild-helper'
2
- require 'nokogiri'
3
- require 'fileutils'
4
-
5
- RSpec.describe "DSL actions" do
6
- before(:each) do
7
- allow(XCodeBuildHelper).to receive(:gem_location).and_return('gem/location')
8
- end
9
- context "build" do
10
- before(:each) do
11
- XCodeBuildHelper.define :default do
12
- workspace "WORK SPACE"
13
- scheme "SCHEME"
14
- sdk "SDK"
15
- config "CONFIG"
16
- device :ipad do
17
- platform "PLATFORM"
18
- name "NAME"
19
- os "OS"
20
- end
21
- end
22
- end
23
-
24
- it "should create the proper CLI to build the app" do
25
- expect(XCodeBuildHelper::Execute).to receive(:call).with("xcodebuild -workspace \"WORK SPACE.xcworkspace\" -scheme SCHEME -sdk SDK -config CONFIG clean build | bundle exec xcpretty --color --report json-compilation-database")
26
- XCodeBuildHelper.build(:default)
27
- end
28
-
29
- it "should create the proper CLI for the ipad" do
30
- expect(XCodeBuildHelper::Execute).to receive(:call).with("xcodebuild -workspace \"WORK SPACE.xcworkspace\" -scheme SCHEME -sdk SDK -config CONFIG -destination 'platform=PLATFORM,name=NAME,OS=OS' clean build | bundle exec xcpretty --color --report json-compilation-database")
31
- XCodeBuildHelper.build(:default, :ipad)
32
- end
33
- end
34
-
35
- context "test_suite" do
36
- before(:each) do
37
- XCodeBuildHelper.define :default do
38
- workspace "WORK SPACE"
39
- scheme "SCHEME"
40
- sdk "SDK"
41
- config "CONFIG"
42
-
43
- device :ipad do
44
- platform "PLATFORM"
45
- name "NAME"
46
- os "OS"
47
- end
48
-
49
- test_plan :plan_a do
50
- report_type 'html'
51
- end
52
- end
53
- end
54
-
55
- it "should create the proper CLI for testing" do
56
- expect(XCodeBuildHelper::Execute).to receive(:call).with("xcodebuild -workspace \"WORK SPACE.xcworkspace\" -scheme SCHEME -sdk SDK -config CONFIG test | bundle exec xcpretty --color --report html")
57
- XCodeBuildHelper.test_suite(:default, :plan_a)
58
- end
59
-
60
- it "should create the proper CLI for testing for ipad" do
61
- expect(XCodeBuildHelper::Execute).to receive(:call).with("xcodebuild -workspace \"WORK SPACE.xcworkspace\" -scheme SCHEME -sdk SDK -config CONFIG -destination 'platform=PLATFORM,name=NAME,OS=OS' test | bundle exec xcpretty --color --report html")
62
- XCodeBuildHelper.test_suite(:default, :plan_a, :ipad)
63
- end
64
- end
65
-
66
- context "code coverage" do
67
- before(:each) do
68
- XCodeBuildHelper.define :default do
69
- workspace "WORK SPACE"
70
- scheme "SCHEME"
71
- sdk "SDK"
72
- config "CONFIG"
73
-
74
- device :ipad do
75
- platform "PLATFORM"
76
- name "NAME"
77
- os "OS"
78
- end
79
-
80
- coverage_plan :plan_a do
81
- report_type "xml"
82
- source_files ["path/to/files/*"]
83
- output "/build/reports"
84
- end
85
- end
86
- allow(FileUtils).to receive(:mkdir_p)
87
- allow(FileUtils).to receive(:cp)
88
- end
89
-
90
- it "will find the base app directory" do
91
- expect(XCodeBuildHelper::Execute).to receive(:call).with("xcodebuild -workspace \"WORK SPACE.xcworkspace\" -scheme SCHEME -sdk SDK -config CONFIG -showBuildSettings")
92
- XCodeBuildHelper.base_app_location(XCodeBuildHelper[:default])
93
- end
94
-
95
- it "will find the app binary" do
96
- allow(XCodeBuildHelper).to receive(:base_app_location).and_return("/path/to/app")
97
- expect(Dir).to receive(:glob).with("/path/to/app/CodeCoverage/SCHEME/Products/CONFIG-SDK/WORK\\ SPACE.app/WORK\\ SPACE").and_return([])
98
- XCodeBuildHelper.app_binary_location(XCodeBuildHelper[:default])
99
- end
100
-
101
- it "will find the app profdata" do
102
- allow(XCodeBuildHelper).to receive(:base_app_location).and_return("/path/to/app")
103
- expect(Dir).to receive(:glob).with("/path/to/app/CodeCoverage/SCHEME/Coverage.profdata").and_return([])
104
- XCodeBuildHelper.profdata_location(XCodeBuildHelper[:default])
105
- end
106
-
107
- it "will return the CLI for finding code coverage" do
108
- allow(XCodeBuildHelper).to receive(:app_binary_location).and_return("/path/to/app/bin")
109
- allow(XCodeBuildHelper).to receive(:profdata_location).and_return("/path/to/app/prof")
110
- allow(Dir).to receive(:glob).with('path/to/files/*').and_return(['path/to/files/file.m', 'path/to/files/supporting files/file.h'])
111
- expect(XCodeBuildHelper::Execute).to receive(:call).with("xcrun llvm-cov show -instr-profile \"/path/to/app/prof\" \"/path/to/app/bin\" path/to/files/file.m path/to/files/supporting\\ files/file.h").and_return("")
112
- XCodeBuildHelper.generate_coverage(:default, :plan_a)
113
- end
114
-
115
- context "converting results to html" do
116
- it "will parse the results and call convert to html" do
117
- allow(XCodeBuildHelper::Execute).to receive(:call).and_return("/path/to/file/FILE_A\n0 | 1|# some random code\n\nwarning: something went wrong here\n/path/to/file/FILE_B\n0| 2|#other random code")
118
-
119
- mockIndex = double(Nokogiri::HTML::Builder)
120
- allow(mockIndex).to receive(:to_html).and_return("INDEX STUFF")
121
- allow(XCodeBuildHelper::CoverageHtmlConverter).to receive(:create_index).and_return(mockIndex)
122
- allow(File).to receive(:write)
123
-
124
- expect(XCodeBuildHelper::CoverageHtmlConverter).to receive(:convert_file).twice
125
- XCodeBuildHelper.generate_coverage(:default, :plan_a)
126
- end
127
-
128
- it "will save the results to a the file name header" do
129
- mockHtml = double(Nokogiri::HTML::Builder)
130
- allow(mockHtml).to receive(:to_html).and_return("HTML STUFF")
131
- converted_result = { :content => mockHtml, :title => "/path/to/file/FILE_A"}
132
-
133
- mockIndex = double(Nokogiri::HTML::Builder)
134
- allow(mockIndex).to receive(:to_html).and_return("INDEX STUFF")
135
- allow(XCodeBuildHelper::CoverageHtmlConverter).to receive(:create_index).and_return(mockIndex)
136
- allow(File).to receive(:write)
137
-
138
- allow(XCodeBuildHelper::Execute).to receive(:call).and_return("warning:something went wrong\nFILE_A:\nHTML STUFF")
139
- allow(XCodeBuildHelper::CoverageHtmlConverter).to receive(:convert_file).with("FILE_A:\nHTML STUFF").and_return(converted_result)
140
- expect(File).to receive(:write).with("/build/reports/FILE_A.html", "HTML STUFF")
141
-
142
- XCodeBuildHelper.generate_coverage(:default, :plan_a)
143
- end
144
-
145
- it "needs to create the output directory first" do
146
- mockHtml = double(Nokogiri::HTML::Builder)
147
- allow(mockHtml).to receive(:to_html).and_return("HTML STUFF")
148
- converted_result = { :content => mockHtml, :title => "/path/to/file/FILE_A"}
149
-
150
- mockIndex = double(Nokogiri::HTML::Builder)
151
- allow(mockIndex).to receive(:to_html).and_return("INDEX STUFF")
152
- allow(XCodeBuildHelper::CoverageHtmlConverter).to receive(:create_index).and_return(mockIndex)
153
-
154
- allow(XCodeBuildHelper::Execute).to receive(:call).and_return("FILE_A:\nHTML STUFF")
155
- allow(XCodeBuildHelper::CoverageHtmlConverter).to receive(:convert_file).and_return(converted_result)
156
- expect(FileUtils).to receive(:mkdir_p).with('/build/reports')
157
- allow(File).to receive(:write)
158
-
159
- XCodeBuildHelper.generate_coverage(:default, :plan_a)
160
- end
161
-
162
- it "will create an index page" do
163
- mockHtml = double(Nokogiri::HTML::Builder)
164
- allow(mockHtml).to receive(:to_html).and_return("HTML STUFF")
165
- converted_result = { :content => mockHtml, :title => "/path/to/file/FILE_A"}
166
-
167
- mockIndex = double(Nokogiri::HTML::Builder)
168
- allow(mockIndex).to receive(:to_html).and_return("INDEX STUFF")
169
- allow(XCodeBuildHelper::CoverageHtmlConverter).to receive(:create_index).and_return(mockIndex)
170
-
171
- allow(XCodeBuildHelper::Execute).to receive(:call).and_return("FILE_A:\nHTML STUFF")
172
- allow(XCodeBuildHelper::CoverageHtmlConverter).to receive(:convert_file).and_return(converted_result)
173
- allow(File).to receive(:write).with("/build/reports/FILE_A.html", "HTML STUFF")
174
- expect(File).to receive(:write).with("/build/reports/index.html", "INDEX STUFF")
175
-
176
- XCodeBuildHelper.generate_coverage(:default, :plan_a)
177
- end
178
-
179
- it "should copy the assets" do
180
- mockHtml = double(Nokogiri::HTML::Builder)
181
- allow(mockHtml).to receive(:to_html).and_return("HTML STUFF")
182
- converted_result = { :content => mockHtml, :title => "/path/to/file/FILE_A"}
183
-
184
- mockIndex = double(Nokogiri::HTML::Builder)
185
- allow(mockIndex).to receive(:to_html).and_return("INDEX STUFF")
186
- allow(XCodeBuildHelper::CoverageHtmlConverter).to receive(:create_index).and_return(mockIndex)
187
-
188
- allow(XCodeBuildHelper::Execute).to receive(:call).and_return("FILE_A:\nHTML STUFF")
189
- allow(XCodeBuildHelper::CoverageHtmlConverter).to receive(:convert_file).and_return(converted_result)
190
- allow(File).to receive(:write)
191
- expect(FileUtils).to receive(:cp).with('gem/location/assets/style.css', '/build/reports')
192
-
193
- XCodeBuildHelper.generate_coverage(:default, :plan_a)
194
- end
195
- end
196
- end
197
-
198
- context "lint" do
199
- before(:each) do
200
- XCodeBuildHelper.define :default do
201
- workspace "WORK SPACE"
202
- scheme "SCHEME"
203
- sdk "SDK"
204
- config "CONFIG"
205
-
206
- device :ipad do
207
- platform "PLATFORM"
208
- name "NAME"
209
- os "OS"
210
- end
211
-
212
- lint_plan :plan_a do
213
- report_type "REPORT_TYPE"
214
- output "OUTPUT"
215
- ignore "IGNORE"
216
- rules do
217
- long_line 120
218
- end
219
- end
220
- end
221
- end
222
- it "should call the correct CLI for the lint" do
223
- expect(XCodeBuildHelper::Execute).to receive(:call).with("bundle exec oclint-json-compilation-database -e \"IGNORE\" -- -report-type REPORT_TYPE -o OUTPUT -rc LONG_LINE=120")
224
- XCodeBuildHelper.lint(:default, :plan_a)
225
- end
226
- end
227
- end
@@ -1,176 +0,0 @@
1
- require 'xcodebuild-helper'
2
-
3
- RSpec.describe "DSL" do
4
- context "define" do
5
- before(:each) do
6
- XCodeBuildHelper.define :default do
7
- workspace "WORK SPACE"
8
- scheme "SCHEME"
9
- end
10
- end
11
-
12
- it "should register the default with a workspace" do
13
- expect(XCodeBuildHelper[:default].get_workspace).to eq("WORK SPACE")
14
- end
15
-
16
- it "should register the default with a scheme" do
17
- expect(XCodeBuildHelper[:default].get_scheme).to eq("SCHEME")
18
- end
19
- end
20
-
21
- context "registering a device" do
22
- before(:each) do
23
- XCodeBuildHelper.define :default do
24
- workspace "WORK SPACE"
25
- scheme "SCHEME"
26
- device :ipad do
27
- platform "PLATFORM"
28
- name "NAME"
29
- os "9.2"
30
- end
31
-
32
- device :iphone do
33
- platform "PLATFORM_2"
34
- name "NAME_2"
35
- os "7.0"
36
- end
37
- end
38
- end
39
- it "should register an ipad on the project" do
40
- expect(XCodeBuildHelper[:default].get_device(:ipad).get_platform).to eq "PLATFORM"
41
- end
42
-
43
- it "should register an iphone on the project" do
44
- expect(XCodeBuildHelper[:default].get_device(:iphone).get_os).to eq "7.0"
45
- end
46
-
47
- it "should not overwrite the device" do
48
- XCodeBuildHelper.define :default do
49
- device :ipad do
50
- name "IPAD"
51
- end
52
- end
53
- expect(XCodeBuildHelper[:default].get_device(:ipad).get_platform).to eq "PLATFORM"
54
- expect(XCodeBuildHelper[:default].get_device(:ipad).get_name).to eq "IPAD"
55
- end
56
- end
57
-
58
- context "register a test plan" do
59
- before(:each) do
60
- XCodeBuildHelper.define :default do
61
- workspace "WORK SPACE"
62
- scheme "SCHEME"
63
- test_plan :plan_a do
64
- report_type 'junit'
65
- end
66
- end
67
- end
68
-
69
- it "should register a test plan a on the project" do
70
- report_type = XCodeBuildHelper[:default].get_test_plan(:plan_a).get_report_type
71
- expect(report_type).to eq 'junit'
72
- end
73
-
74
- it "should not overwrite the test plan" do
75
- XCodeBuildHelper.define :default do
76
- test_plan :plan_a do
77
- end
78
- end
79
-
80
- report_type = XCodeBuildHelper[:default].get_test_plan(:plan_a).get_report_type
81
- expect(report_type).to eq 'junit'
82
- end
83
- end
84
-
85
- context "register a coverage plan" do
86
- before(:each) do
87
- XCodeBuildHelper.define :default do
88
- workspace "WORK SPACE"
89
- scheme "SCHEME"
90
- coverage_plan :plan_a do
91
- source_files ['/path/to/files/*.m']
92
- report_type "REPORT_TYPE"
93
- end
94
- end
95
- end
96
- it "should set the source files" do
97
- expect(XCodeBuildHelper[:default].get_coverage_plan(:plan_a).get_source_files).to eq ['/path/to/files/*.m']
98
- end
99
-
100
- it "should not overwrite the coverage plan" do
101
- XCodeBuildHelper.define :default do
102
- coverage_plan :plan_a do
103
- report_type "EXPECTED"
104
- end
105
- end
106
-
107
- expect(XCodeBuildHelper[:default].get_coverage_plan(:plan_a).get_report_type).to eq "EXPECTED"
108
- expect(XCodeBuildHelper[:default].get_coverage_plan(:plan_a).get_source_files).to eq ['/path/to/files/*.m']
109
- end
110
- end
111
-
112
- context "register a lint plan" do
113
- before(:each) do
114
- XCodeBuildHelper.define :default do
115
- workspace "WORK SPACE"
116
- lint_plan :plan_a do
117
- report_type "REPORT_TYPE"
118
- output "OUTPUT"
119
- ignore "IGNORE"
120
- rules do
121
- long_line 120
122
- short_variable_name 3
123
- end
124
- end
125
- end
126
-
127
- end
128
-
129
- it "should set the lint plan" do
130
- expect(XCodeBuildHelper[:default].get_lint_plan(:plan_a).get_report_type).to eq "REPORT_TYPE"
131
- end
132
-
133
- it "should set the rules" do
134
- expect(XCodeBuildHelper[:default].get_lint_plan(:plan_a).get_rules.get_long_line).to eq 120
135
- end
136
-
137
- it "should not overwrite the lint_plan" do
138
- XCodeBuildHelper.define :default do
139
- lint_plan :plan_a do
140
- report_type "EXPECTED"
141
- end
142
- end
143
-
144
- expect(XCodeBuildHelper[:default].get_lint_plan(:plan_a).get_report_type).to eq "EXPECTED"
145
- expect(XCodeBuildHelper[:default].get_lint_plan(:plan_a).get_output).to eq "OUTPUT"
146
- end
147
-
148
- it "should not overwrite previous rules" do
149
- XCodeBuildHelper.define :default do
150
- lint_plan :plan_a do
151
- rules do
152
- long_line 100
153
- end
154
- end
155
- end
156
-
157
- expect(XCodeBuildHelper[:default].get_lint_plan(:plan_a).get_rules.get_long_line).to eq 100
158
- expect(XCodeBuildHelper[:default].get_lint_plan(:plan_a).get_rules.get_short_variable_name).to eq 3
159
- end
160
- end
161
-
162
- context "edit an existing build plan" do
163
- it "should overwrite the workspace but not the scheme" do
164
- XCodeBuildHelper.define :default do
165
- workspace "WORK SPACE"
166
- scheme "SCHEME"
167
- end
168
-
169
- XCodeBuildHelper.define :default do
170
- workspace "EXPECTED"
171
- end
172
- expect(XCodeBuildHelper[:default].get_workspace).to eq "EXPECTED"
173
- expect(XCodeBuildHelper[:default].get_scheme).to eq "SCHEME"
174
- end
175
- end
176
- end
data/spec/xcode_spec.rb DELETED
@@ -1,85 +0,0 @@
1
- require 'xcode'
2
- require 'test_plan'
3
- require 'device'
4
-
5
- RSpec.describe XCodeBuildHelper::XCode do
6
- before(:each) do
7
- @xcode = XCodeBuildHelper::XCode.new
8
- @xcode.workspace "WORK SPACE"
9
- @xcode.scheme "SCHEME"
10
- @xcode.sdk "iphonesimulator"
11
- @xcode.config "Debug"
12
- end
13
-
14
- context "setter methods" do
15
- it "should have set the workspace attribute" do
16
- expect(@xcode.get_workspace).to eq "WORK SPACE"
17
- end
18
-
19
- it "should have set the scheme attribute" do
20
- expect(@xcode.get_scheme).to eq "SCHEME"
21
- end
22
-
23
- it "should have set the sdk" do
24
- expect(@xcode.get_sdk).to eq "iphonesimulator"
25
- end
26
-
27
- it "should set the config" do
28
- expect(@xcode.get_config).to eq "Debug"
29
- end
30
- end
31
-
32
- context "registering a device" do
33
- before(:each) do
34
- @device = XCodeBuildHelper::Device.new
35
- @device.platform "PLATFORM"
36
- end
37
- it "should set the device on the project" do
38
- @xcode.device(:ipad, @device)
39
- expect(@xcode.get_device(:ipad).get_platform).to eq "PLATFORM"
40
- end
41
- end
42
-
43
- context "register a test plan" do
44
- before(:each) do
45
- @test_plan = XCodeBuildHelper::TestPlan.new
46
- @test_plan.report_type "REPORT_TYPE"
47
- end
48
-
49
- it "should register a test plan on the project" do
50
- @xcode.test_plan(:plan_a, @test_plan)
51
- expect(@xcode.get_test_plan(:plan_a).get_report_type).to eq "REPORT_TYPE"
52
- end
53
- end
54
-
55
- context "register a code coverage plan" do
56
- before(:each) do
57
- @coverage_plan = XCodeBuildHelper::CoveragePlan.new
58
- @coverage_plan.source_files ["path/to/files/*.m"]
59
- @coverage_plan.output "/path/to/output"
60
- end
61
-
62
- it "should set the source files" do
63
- @xcode.coverage_plan(:plan_a, @coverage_plan)
64
- expect(@xcode.get_coverage_plan(:plan_a).get_source_files).to eq ["path/to/files/*.m"]
65
- end
66
-
67
- it "should get the output directory" do
68
- @xcode.coverage_plan(:plan_a, @coverage_plan)
69
- expect(@xcode.get_coverage_plan(:plan_a).get_output).to eq "/path/to/output"
70
- end
71
- end
72
-
73
-
74
- context "register a lint plan" do
75
- before(:each) do
76
- @lint_plan = XCodeBuildHelper::LintPlan.new
77
- @lint_plan.report_type "REPORT_TYPE"
78
- end
79
-
80
- it "should set the report type" do
81
- @xcode.lint_plan(:plan_a, @lint_plan)
82
- expect(@xcode.get_lint_plan(:plan_a).get_report_type).to eq "REPORT_TYPE"
83
- end
84
- end
85
- end
@@ -1,27 +0,0 @@
1
- lib = File.expand_path('../lib', __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require 'version'
4
-
5
- Gem::Specification.new do |s|
6
- s.name = 'xcodebuild-helper'
7
- s.version = XCodeBuildHelper::VERSION
8
- s.date = '2016-03-30'
9
- s.summary = 'DSL to help call xcode CLI more easliy'
10
- s.description = 'Very useful when writing scripts to automate xcode development or when creating ci scripts to automate deployment'
11
- s.authors = ['Joshua Rasmussen']
12
- s.email = 'xlr8runner@gmail.com'
13
- s.files = `git ls-files`.split($\)
14
- s.require_paths = ['lib']
15
- s.executables = s.files.grep(%r{^bin/}){ |f| File.basename(f) }
16
- s.test_files = s.files.grep(%r{^(spec)})
17
- s.license = 'MIT'
18
- s.homepage = 'https://github.com/xlr8runner/xcodebuild-helper'
19
-
20
- s.add_development_dependency "rspec", ["~> 3.4"]
21
- s.add_development_dependency "guard-rspec", ["~> 4.6"]
22
- s.add_development_dependency "rake", ["~> 11.1"]
23
-
24
- s.add_dependency "xcpretty", ["~> 0.2"]
25
- s.add_dependency "xcodeproj", ["~> 0.28"]
26
- s.add_dependency "nokogiri", ["~> 1.6"]
27
- end