Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C193E18135 for ; Wed, 16 Sep 2015 12:06:15 +0000 (UTC) Received: (qmail 22577 invoked by uid 500); 16 Sep 2015 12:06:12 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 22456 invoked by uid 500); 16 Sep 2015 12:06:12 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 22434 invoked by uid 99); 16 Sep 2015 12:06:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Sep 2015 12:06:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 718D6E0332; Wed, 16 Sep 2015 12:06:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: an-selm@apache.org To: commits@cordova.apache.org Date: Wed, 16 Sep 2015 12:06:13 -0000 Message-Id: In-Reply-To: <6da150ea32cd427db5377489b37d45fa@git.apache.org> References: <6da150ea32cd427db5377489b37d45fa@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] cordova-lib git commit: CB-8615 Improves plugman tests for Windows CB-8615 Improves plugman tests for Windows * Adds Windows10 project to tests * Verifies copy dir * Verifies reference string * Adds tests for target-dir and versions attributes Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/eefd7af6 Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/eefd7af6 Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/eefd7af6 Branch: refs/heads/master Commit: eefd7af6589525c1d9f35ca884dec52c1c10b3b2 Parents: ccdf9a6 Author: sgrebnov Authored: Fri Sep 4 21:12:43 2015 +0300 Committer: Vladimir Kotikov Committed: Wed Sep 16 14:57:04 2015 +0300 ---------------------------------------------------------------------- .../spec-plugman/platforms/windows.spec.js | 68 ++++++++++++++++---- .../org.test.plugins.dummyplugin/plugin.xml | 2 + .../src/windows/dummy5.dll | 0 .../src/windows/dummy6.dll | 0 .../windows/CordovaApp.Windows10.jsproj | 61 ++++++++++++++++++ 5 files changed, 118 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eefd7af6/cordova-lib/spec-plugman/platforms/windows.spec.js ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/platforms/windows.spec.js b/cordova-lib/spec-plugman/platforms/windows.spec.js index ddaa9ce..f9fe6cb 100644 --- a/cordova-lib/spec-plugman/platforms/windows.spec.js +++ b/cordova-lib/spec-plugman/platforms/windows.spec.js @@ -73,7 +73,8 @@ beforeEach(function () { all: 'CordovaApp.projitems', phone: 'CordovaApp.Phone.jsproj', windows: 'CordovaApp.Windows.jsproj', - windows8: 'CordovaApp.Windows80.jsproj' + windows8: 'CordovaApp.Windows80.jsproj', + windows10: 'CordovaApp.Windows10.jsproj' }, windows8: { all: 'TestApp.jsproj', windows8: 'TestApp.jsproj' @@ -125,8 +126,35 @@ beforeEach(function () { projects.push(proj_files.master); } + // Check that installed framework reference is properly added to project. + var checkInstalledFrameworkReference = function (tag, elementToInstall, xml) { + var frameworkCustomPathElement = xml.find(xpath); + expect(frameworkCustomPathElement).not.toBe(null); + var frameworkCustomPath = frameworkCustomPathElement.text; + expect(frameworkCustomPath).not.toBe(null); + var targetDir = elementToInstall.targetDir || ''; + var frameworkCustomExpectedPath = path.join('plugins', dummy_id, targetDir, + path.basename(elementToInstall.src)); + expect(frameworkCustomPath).toEqual(frameworkCustomExpectedPath); + }; + + // Check that framework file was copied to correct path + var checkInstalledFrameworkPath = function (framework) { + var targetDir = framework.targetDir || ''; + var dest = path.join(cordovaProjectWindowsPlatformDir, 'plugins', dummy_id, targetDir, path.basename(framework.src)); + var copiedSuccessfully = fs.existsSync(path.resolve(dest)); + expect(copiedSuccessfully).toBe(true); + }; + var appendToRootFake = function (itemGroup) { expect(itemGroup).toContainXmlPath(xpath); + // In case we install framework with 'custom' attribute set to 'true' + // we verify that file is copied to correct dir and reference is added properly. + // This is not required in case of 'projectReference' attribute is used. + if (tag === 'framework' && elementToInstall.type !== 'projectReference') { + checkInstalledFrameworkReference(tag, elementToInstall, itemGroup); + checkInstalledFrameworkPath(elementToInstall); + } }; var projectsAddedToSpies = []; @@ -194,7 +222,7 @@ beforeEach(function () { validateInstalledProjects('lib-file', libfiles[0], xpath, ['all']); xpath = 'SDKReference[@Include="TestSDK2, Version=1.0"]'; - validateInstalledProjects('lib-file', libfiles[1], xpath, ['windows', 'phone']); + validateInstalledProjects('lib-file', libfiles[1], xpath, ['windows', 'phone', 'windows10']); xpath = 'SDKReference[@Include="TestSDK3, Version=1.0"]'; validateInstalledProjects('lib-file', libfiles[2], xpath, ['phone']); @@ -231,10 +259,16 @@ beforeEach(function () { validateInstalledProjects('framework', frameworks[1], xpath, ['all']); xpath = 'Reference[@Include="dummy3"]/HintPath'; - validateInstalledProjects('framework', frameworks[2], xpath, ['windows', 'windows8']); + validateInstalledProjects('framework', frameworks[2], xpath, ['windows', 'windows8', 'windows10']); xpath = 'Reference[@Include="dummy4"][@Condition="\'$(Platform)\'==\'ARM\'"]/HintPath'; validateInstalledProjects('framework', frameworks[3], xpath, ['phone']); + + xpath = 'Reference[@Include="dummy5"]/HintPath'; + validateInstalledProjects('framework', frameworks[4], xpath, ['phone']); + + xpath = 'Reference[@Include="dummy6"]/HintPath'; + validateInstalledProjects('framework', frameworks[5], xpath, ['windows', 'windows10', 'phone']); }); }); @@ -243,16 +277,16 @@ beforeEach(function () { it('should write to correct project files when conditions are specified', function () { var xpath = 'ProjectReference[@Include="' + windowsJoin(dummyplugin, 'src', 'windows', 'dummy1.vcxproj') + '"][@Condition="\'$(Platform)\'==\'x64\'"]'; - validateInstalledProjects('framework', frameworks[4], xpath, ['all']); + validateInstalledProjects('framework', frameworks[6], xpath, ['all']); xpath = 'ProjectReference[@Include="' + windowsJoin(dummyplugin, 'src', 'windows', 'dummy2.vcxproj') + '"]'; - validateInstalledProjects('framework', frameworks[5], xpath, ['windows8']); + validateInstalledProjects('framework', frameworks[7], xpath, ['windows8']); xpath = 'ProjectReference[@Include="' + windowsJoin(dummyplugin, 'src', 'windows', 'dummy3.vcxproj') + '"]'; - validateInstalledProjects('framework', frameworks[6], xpath, ['windows', 'windows8']); + validateInstalledProjects('framework', frameworks[8], xpath, ['windows', 'windows8', 'windows10']); xpath = 'ProjectReference[@Include="' + windowsJoin(dummyplugin, 'src', 'windows', 'dummy4.vcxproj') + '"][@Condition="\'$(Platform)\'==\'x86\'"]'; - validateInstalledProjects('framework', frameworks[7], xpath, ['windows', 'phone']); + validateInstalledProjects('framework', frameworks[9], xpath, ['windows', 'phone']); }); }); }); @@ -335,7 +369,7 @@ beforeEach(function () { incText = 'TestSDK2, Version=1.0'; targetConditions = {versions: '>=8.1', deviceTarget: undefined, arch: undefined}; - validateUninstalledProjects('lib-file', libfiles[1], path, incText, targetConditions, ['windows', 'phone']); + validateUninstalledProjects('lib-file', libfiles[1], path, incText, targetConditions, ['windows', 'phone', 'windows10']); incText = 'TestSDK3, Version=1.0'; targetConditions = {versions: undefined, deviceTarget: 'phone', arch: undefined}; @@ -369,12 +403,20 @@ beforeEach(function () { incText = 'dummy3'; targetConditions = {versions: undefined, deviceTarget: 'windows', arch: undefined}; - validateUninstalledProjects('framework', frameworks[2], path, incText, targetConditions, ['windows', 'windows8']); + validateUninstalledProjects('framework', frameworks[2], path, incText, targetConditions, ['windows', 'windows8', 'windows10']); incText = 'dummy4'; targetConditions = {versions: '8.1', deviceTarget: 'phone', arch: 'ARM'}; validateUninstalledProjects('framework', frameworks[3], path, incText, targetConditions, ['phone']); + incText = 'dummy5'; + targetConditions = {versions: undefined, deviceTarget: 'phone', arch: undefined}; + validateUninstalledProjects('framework', frameworks[4], path, incText, targetConditions, ['phone']); + + incText = 'dummy6'; + targetConditions = {versions: '>=8.1', deviceTarget: undefined, arch: undefined}; + validateUninstalledProjects('framework', frameworks[5], path, incText, targetConditions, ['windows', 'windows10', 'phone']); + done(); }); }); @@ -391,19 +433,19 @@ beforeEach(function () { var xmlPath = 'ItemGroup/ProjectReference'; var incText = windowsJoin(cordovaProjectPluginsDir , dummy_id, 'src', 'windows', 'dummy1.vcxproj'); var targetConditions = {versions: undefined, deviceTarget: undefined, arch: 'x64'}; - validateUninstalledProjects('framework', frameworks[4], xmlPath, incText, targetConditions, ['all']); + validateUninstalledProjects('framework', frameworks[6], xmlPath, incText, targetConditions, ['all']); incText = windowsJoin(cordovaProjectPluginsDir , dummy_id, 'src', 'windows', 'dummy2.vcxproj'); targetConditions = {versions: '<8.1', deviceTarget: undefined, arch: undefined}; - validateUninstalledProjects('framework', frameworks[5], xmlPath, incText, targetConditions, ['windows8']); + validateUninstalledProjects('framework', frameworks[7], xmlPath, incText, targetConditions, ['windows8']); incText = windowsJoin(cordovaProjectPluginsDir , dummy_id, 'src', 'windows', 'dummy3.vcxproj'); targetConditions = {versions: undefined, deviceTarget: 'win', arch: undefined}; - validateUninstalledProjects('framework', frameworks[6], xmlPath, incText, targetConditions, ['windows', 'windows8']); + validateUninstalledProjects('framework', frameworks[8], xmlPath, incText, targetConditions, ['windows', 'windows8', 'windows10']); incText = windowsJoin(cordovaProjectPluginsDir , dummy_id, 'src', 'windows', 'dummy4.vcxproj'); targetConditions = {versions: '8.1', deviceTarget: 'all', arch: 'x86'}; - validateUninstalledProjects('framework', frameworks[7], xmlPath, incText, targetConditions, ['windows', 'phone']); + validateUninstalledProjects('framework', frameworks[9], xmlPath, incText, targetConditions, ['windows', 'phone']); done(); }); http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eefd7af6/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/plugin.xml ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/plugin.xml b/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/plugin.xml index 02bb445..b8c4ec5 100644 --- a/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/plugin.xml +++ b/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/plugin.xml @@ -192,6 +192,8 @@ + + http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eefd7af6/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/dummy5.dll ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/dummy5.dll b/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/dummy5.dll new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eefd7af6/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/dummy6.dll ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/dummy6.dll b/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/dummy6.dll new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eefd7af6/cordova-lib/spec-plugman/projects/windows/CordovaApp.Windows10.jsproj ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/projects/windows/CordovaApp.Windows10.jsproj b/cordova-lib/spec-plugman/projects/windows/CordovaApp.Windows10.jsproj new file mode 100644 index 0000000..e4b9b06 --- /dev/null +++ b/cordova-lib/spec-plugman/projects/windows/CordovaApp.Windows10.jsproj @@ -0,0 +1,61 @@ + + + + build\windows\$(Configuration)\$(Platform)\ + build\windows\bld\ + true + + + + Debug + AnyCPU + + + Debug + ARM + + + Debug + x64 + + + Debug + x86 + + + Release + AnyCPU + + + Release + ARM + + + Release + x64 + + + Release + x86 + + + + f9b0ae20-c91c-42b9-9c6e-d3bc28b4509e + + + + 14.0 + + + + + UAP + 10.0.10240.0 + 10.0.10240.0 + 14.0 + + + 10.0 + 10.0 + + --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org