Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
[app-tools][windows] Add test cases for skip option (#3648)
Browse files Browse the repository at this point in the history
Impacted tests(approved): new 5, update 0, delete 0
Unit test platform: Crosswalk Project for Windows 20.49.527.0
Unit test result summary: pass 5, fail 0, block 0

BUG=CTS-1750
  • Loading branch information
haoyunfeix authored and Honry committed Jun 12, 2016
1 parent 1e4ba25 commit 8179514
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 2 deletions.
69 changes: 69 additions & 0 deletions apptools/apptools-windows-tests/apptools/create_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,5 +491,74 @@ def test_create_package_release_without_argument_check_locale(self):
comm.clear("org.xwalk.test")
comm.clear("test-app")

def test_create_package_skip_dummy_using_s_option(self):
comm.setUp()
os.chdir(comm.XwalkPath)
comm.clear("org.xwalk.test")
os.mkdir("org.xwalk.test")
os.chdir('org.xwalk.test')
cmd = comm.HOST_PREFIX + comm.PackTools + \
"crosswalk-pkg --platforms=windows -s --crosswalk=" + comm.XwalkPath + comm.windowsCrosswalk.replace('.zip', '') + " -r " + comm.ConstPath + "/../testapp/create_package_basic/"
(return_code, output) = comm.getstatusoutput(cmd)
comm.clear("org.xwalk.test")
self.assertEquals(return_code, 0)
self.assertIn("Skipping host setup check", output[0])

def test_create_package_skip_dummy_using_skip_check_option(self):
comm.setUp()
os.chdir(comm.XwalkPath)
comm.clear("org.xwalk.test")
os.mkdir("org.xwalk.test")
os.chdir('org.xwalk.test')
cmd = comm.HOST_PREFIX + comm.PackTools + \
"crosswalk-pkg --platforms=windows --skip-check --crosswalk=" + comm.XwalkPath + comm.windowsCrosswalk.replace('.zip', '') + " -r " + comm.ConstPath + "/../testapp/create_package_basic/"
(return_code, output) = comm.getstatusoutput(cmd)
comm.clear("org.xwalk.test")
self.assertEquals(return_code, 0)
self.assertIn("Skipping host setup check", output[0])

def test_create_package_skip_dummy_default_in_subprocess(self):
comm.setUp()
os.chdir(comm.XwalkPath)
comm.clear("org.xwalk.test")
os.mkdir("org.xwalk.test")
os.chdir('org.xwalk.test')
cmd = comm.HOST_PREFIX + comm.PackTools + \
"crosswalk-pkg --platforms=windows --crosswalk=" + comm.XwalkPath + comm.windowsCrosswalk.replace('.zip', '') + " -r " + comm.ConstPath + "/../testapp/create_package_basic/"
(return_code, output) = comm.getstatusoutput(cmd)
comm.clear("org.xwalk.test")
self.assertEquals(return_code, 0)
self.assertIn("Skipping host setup check", output[0])

def test_create_package_skip_dummy_no(self):
comm.setUp()
os.chdir(comm.XwalkPath)
comm.clear("org.xwalk.test")
os.mkdir("org.xwalk.test")
os.chdir('org.xwalk.test')
cmd = comm.HOST_PREFIX + comm.PackTools + \
"crosswalk-pkg --platforms=windows -s no --crosswalk=" + comm.XwalkPath + comm.windowsCrosswalk.replace('.zip', '') + " -r " + comm.ConstPath + "/../testapp/create_package_basic/"
(return_code, output) = comm.getstatusoutput(cmd)
comm.clear("org.xwalk.test")
self.assertEquals(return_code, 0)
self.assertIn("Checking host setup", output[0])

def test_create_package_default_non_interactive(self):
comm.setUp()
os.chdir(comm.XwalkPath)
comm.clear("org.xwalk.test")
os.mkdir("org.xwalk.test")
os.chdir('org.xwalk.test')
cmd = comm.HOST_PREFIX + comm.PackTools + \
"crosswalk-pkg --platforms=windows --crosswalk=" + comm.XwalkPath + comm.windowsCrosswalk.replace('.zip', '') + " -r " + comm.ConstPath + "/../testapp/create_package_basic/ > 1.log 2>&1"
(return_code, output) = comm.getstatusoutput(cmd)
self.assertEquals(return_code, 0)
cmd = "type 1.log"
(return_code, output) = comm.getstatusoutput(cmd)
comm.clear("org.xwalk.test")
comm.clear("1.log")
self.assertEquals(return_code, 0)
self.assertIn("Skipping host setup check", output[0])

if __name__ == '__main__':
unittest.main()
2 changes: 1 addition & 1 deletion apptools/apptools-windows-tests/tests.full.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<test_script_entry>/opt/apptools-windows-tests/apptools/check_host.py</test_script_entry>
</description>
</testcase>
<testcase component="Crosswalk App Tools/CLI" execution_type="auto" id="Crosswalk_create_package" priority="P2" purpose="Windows - Validate if package can be created without a project" status="approved" type="Functional" subcase="23">
<testcase component="Crosswalk App Tools/CLI" execution_type="auto" id="Crosswalk_create_package" priority="P2" purpose="Windows - Validate if package can be created without a project" status="approved" type="Functional" subcase="28">
<description>
<test_script_entry>/opt/apptools-windows-tests/apptools/create_package.py</test_script_entry>
</description>
Expand Down
2 changes: 1 addition & 1 deletion apptools/apptools-windows-tests/tests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<test_script_entry>/opt/apptools-windows-tests/apptools/check_host.py</test_script_entry>
</description>
</testcase>
<testcase component="Crosswalk App Tools/CLI" execution_type="auto" id="Crosswalk_create_package" purpose="Windows - Validate if package can be created without a project" subcase="23">
<testcase component="Crosswalk App Tools/CLI" execution_type="auto" id="Crosswalk_create_package" purpose="Windows - Validate if package can be created without a project" subcase="28">
<description>
<test_script_entry>/opt/apptools-windows-tests/apptools/create_package.py</test_script_entry>
</description>
Expand Down

0 comments on commit 8179514

Please sign in to comment.