|
| 1 | +import unittest |
| 2 | + |
| 3 | +from helpers._os_lib import CleanupFolder, runAUT, FileExists |
| 4 | +from helpers._tns_lib import Build, iosRuntimeSymlinkPath, \ |
| 5 | + tnsPath, CreateProject, PlatformAdd, Prepare, CreateProjectAndAddPlatform |
| 6 | + |
| 7 | + |
| 8 | +class Plugins_OSX_Xcconfig(unittest.TestCase): |
| 9 | + |
| 10 | + def setUp(self): |
| 11 | + |
| 12 | + print "" |
| 13 | + print "#####" |
| 14 | + print self.id() |
| 15 | + print "#####" |
| 16 | + print "" |
| 17 | + |
| 18 | + runAUT("rm -rf ~/Library/Developer/Xcode/DerivedData/*") # Delete derived data |
| 19 | + CleanupFolder('./TNS_App') |
| 20 | + |
| 21 | + def tearDown(self): |
| 22 | + pass |
| 23 | + |
| 24 | + def test_001_PluginAdd_Xcconfig_Before_PlatformAdd_iOS(self): |
| 25 | + CreateProject(projName="TNS_App"); |
| 26 | + |
| 27 | + output = runAUT(tnsPath + " plugin add QA-TestApps/CocoaPods/xcconfig-plugin --path TNS_App") |
| 28 | + assert ("Successfully installed plugin xcconfig-plugin." in output) |
| 29 | + assert FileExists("TNS_App/node_modules/xcconfig-plugin/package.json") |
| 30 | + assert FileExists("TNS_App/node_modules/xcconfig-plugin/platforms/ios/build.xcconfig") |
| 31 | + assert FileExists("TNS_App/node_modules/xcconfig-plugin/platforms/ios/module.modulemap") |
| 32 | + assert FileExists("TNS_App/node_modules/xcconfig-plugin/platforms/ios/XcconfigPlugin.h") |
| 33 | + |
| 34 | + output = runAUT("cat TNS_App/package.json") |
| 35 | + assert ("xcconfig-plugin" in output) |
| 36 | + |
| 37 | + PlatformAdd(platform="ios", frameworkPath=iosRuntimeSymlinkPath, path="TNS_App", symlink=True) |
| 38 | + output = Prepare(platform="ios", path="TNS_App") |
| 39 | + assert ("Successfully prepared plugin xcconfig-plugin for ios." in output) |
| 40 | + |
| 41 | + output = runAUT("cat TNS_App/platforms/ios/plugins-debug.xcconfig") |
| 42 | + assert ("OTHER_LDFLAGS = $(inherited) -l\"sqlite3\"" in output) |
| 43 | + output = runAUT("cat TNS_App/platforms/ios/plugins-release.xcconfig") |
| 44 | + assert ("OTHER_LDFLAGS = $(inherited) -l\"sqlite3\"" in output) |
| 45 | + |
| 46 | + output = runAUT("cat TNS_App/platforms/ios/TNSApp/build-debug.xcconfig") |
| 47 | + assert ("#include \"../plugins-debug.xcconfig\"" in output) |
| 48 | + output = runAUT("cat TNS_App/platforms/ios/TNSApp/build-release.xcconfig") |
| 49 | + assert ("#include \"../plugins-release.xcconfig\"" in output) |
| 50 | + |
| 51 | + Build(platform="ios", path="TNS_App") |
| 52 | + |
| 53 | + def test_202_PluginAdd_Xcconfig_After_PlatformAdd_iOS(self): |
| 54 | + CreateProjectAndAddPlatform(projName="TNS_App", platform="ios", frameworkPath=iosRuntimeSymlinkPath, symlink=True) |
| 55 | + |
| 56 | + output = runAUT(tnsPath + " plugin add QA-TestApps/CocoaPods/xcconfig-plugin --path TNS_App") |
| 57 | + assert ("Successfully installed plugin xcconfig-plugin." in output) |
| 58 | + assert FileExists("TNS_App/node_modules/xcconfig-plugin/package.json") |
| 59 | + assert FileExists("TNS_App/node_modules/xcconfig-plugin/platforms/ios/build.xcconfig") |
| 60 | + assert FileExists("TNS_App/node_modules/xcconfig-plugin/platforms/ios/module.modulemap") |
| 61 | + assert FileExists("TNS_App/node_modules/xcconfig-plugin/platforms/ios/XcconfigPlugin.h") |
| 62 | + |
| 63 | + output = runAUT("cat TNS_App/package.json") |
| 64 | + assert ("xcconfig-plugin" in output) |
| 65 | + |
| 66 | + output = Build(platform="ios", path="TNS_App") |
| 67 | + assert ("Successfully prepared plugin xcconfig-plugin for ios." in output) |
| 68 | + |
| 69 | + output = runAUT("cat TNS_App/platforms/ios/plugins-debug.xcconfig") |
| 70 | + assert ("OTHER_LDFLAGS = $(inherited) -l\"sqlite3\"" in output) |
| 71 | + output = runAUT("cat TNS_App/platforms/ios/plugins-release.xcconfig") |
| 72 | + assert ("OTHER_LDFLAGS = $(inherited) -l\"sqlite3\"" in output) |
| 73 | + |
| 74 | + output = runAUT("cat TNS_App/platforms/ios/TNSApp/build-debug.xcconfig") |
| 75 | + assert ("#include \"../plugins-debug.xcconfig\"" in output) |
| 76 | + output = runAUT("cat TNS_App/platforms/ios/TNSApp/build-release.xcconfig") |
| 77 | + assert ("#include \"../plugins-release.xcconfig\"" in output) |
0 commit comments