Skip to content

Commit

Permalink
Update setUp/tearDownClass of Build_With_CopyTo tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasil Chimev authored and Vasil Chimev committed Oct 28, 2015
1 parent e61e6b0 commit 3799f6c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
14 changes: 10 additions & 4 deletions tests/build_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import platform
import unittest

from helpers._os_lib import CleanupFolder, runAUT, FileExists
from helpers._os_lib import CleanupFolder, remove, runAUT, FileExists
from helpers._tns_lib import tnsPath, CreateProject, CreateProjectAndAddPlatform, \
androidRuntimePath, Prepare, androidKeyStorePath, androidKeyStorePassword, \
androidKeyStoreAlias, androidKeyStoreAliasPassword, PlatformAdd, \
Expand All @@ -13,9 +13,12 @@ class Build_Linux(unittest.TestCase):

@classmethod
def setUpClass(cls):
remove("TNSApp-debug.apk")
remove("TNSApp-release.apk")

CleanupFolder('./TNS_App')
CreateProjectAndAddPlatform(projName="TNS_App", platform="android", frameworkPath=androidRuntimePath)
CreateProjectAndAddPlatform(projName="TNS_App", platform="android", frameworkPath=androidRuntimePath)

def setUp(self):

print ""
Expand All @@ -27,12 +30,15 @@ def setUp(self):
CleanupFolder('./tns-app');
CleanupFolder('./TNSAppNoPlatform')
CleanupFolder('./TNS_App/platforms/android/build/outputs')

def tearDown(self):
pass

@classmethod
def tearDownClass(cls):
remove("TNSApp-debug.apk")
remove("TNSApp-release.apk")

CleanupFolder('./TNS_App')
CleanupFolder('./TNSAppNoPlatform')
CleanupFolder('./TNS_AppSymlink')
Expand Down
24 changes: 15 additions & 9 deletions tests/build_osx.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import os
import unittest

from helpers._os_lib import CleanupFolder, runAUT, FileExists
from helpers._os_lib import CleanupFolder, remove, runAUT, FileExists
from helpers._tns_lib import tnsPath, CreateProject, Prepare, \
CreateProjectAndAddPlatform, iosRuntimeSymlinkPath


class Build_OSX(unittest.TestCase):

@classmethod
def setUpClass(cls):
remove("TNSApp.app")
remove("TNSApp.ipa")

CleanupFolder('./TNS_App')
CleanupFolder('./TNSAppNoSym')
#CreateProjectAndAddPlatform(projName="TNS_App", platform="ios", frameworkPath=iosRuntimeSymlinkPath, symlink=True)
#CreateProjectAndAddPlatform(projName="TNSAppNoSym", platform="ios", frameworkPath=iosRuntimeSymlinkPath)
runAUT("rm -rf ~/Library/Developer/Xcode/DerivedData/*") # Delete derived data
runAUT("sudo find /var/folders/ -name '*tnsapp-*' -exec rm -rf {} \;") # Delete precompiled headers

def setUp(self):

print ""
Expand All @@ -29,16 +32,19 @@ def setUp(self):
CleanupFolder('./tns app')
CleanupFolder('./my-ios-app')
CleanupFolder('./TNS_AppNoPlatform')
CleanupFolder('TNS_AppNoPlatform/platforms/ios/build')
CleanupFolder('TNS_AppNoPlatform/platforms/ios/build')

CleanupFolder('./TNS_App')
CleanupFolder('./TNSAppNoSym')
CleanupFolder('./TNSAppNoSym')

def tearDown(self):
pass

@classmethod
def tearDownClass(cls):
remove("TNSApp.app")
remove("TNSApp.ipa")

CleanupFolder('./TNS_App')
CleanupFolder('./TNS_AppNoPlatform')
CleanupFolder('./tns-app')
Expand Down Expand Up @@ -192,7 +198,7 @@ def test_302_Build_iOS_WithiOSinPath(self):
assert FileExists("my-ios-app/platforms/ios/myiosapp/myiosapp-Prefix.pch")


def test_310_Build_iOS(self):
def test_310_Build_iOS_With_CopyTo(self):
CreateProjectAndAddPlatform(projName="TNS_App", platform="ios", frameworkPath=iosRuntimeSymlinkPath, symlink=True)
output = runAUT(tnsPath + " build ios --path TNS_App --copy-to ./")
assert ("Project successfully prepared" in output)
Expand All @@ -202,7 +208,7 @@ def test_310_Build_iOS(self):
assert FileExists("TNS_App/platforms/ios/build/emulator/TNSApp.app")
assert FileExists("TNSApp.app")

def test_311_Build_iOS_Release(self):
def test_311_Build_iOS_Release_With_CopyTo(self):
CreateProjectAndAddPlatform(projName="TNS_App", platform="ios", frameworkPath=iosRuntimeSymlinkPath, symlink=True)
output = runAUT(tnsPath + " build ios --path TNS_App --forDevice --release --copy-to ./")
assert ("Project successfully prepared" in output)
Expand Down

0 comments on commit 3799f6c

Please sign in to comment.