cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shazron <...@git.apache.org>
Subject [GitHub] cordova-ios pull request #265: CB-11952 - Introduce buildFlag option
Date Fri, 07 Oct 2016 08:03:43 GMT
Github user shazron commented on a diff in the pull request:

    https://github.com/apache/cordova-ios/pull/265#discussion_r82344533
  
    --- Diff: tests/spec/unit/build.spec.js ---
    @@ -0,0 +1,255 @@
    +/**
    + Licensed to the Apache Software Foundation (ASF) under one
    + or more contributor license agreements.  See the NOTICE file
    + distributed with this work for additional information
    + regarding copyright ownership.  The ASF licenses this file
    + to you under the Apache License, Version 2.0 (the
    + "License"); you may not use this file except in compliance
    + with the License.  You may obtain a copy of the License at
    +
    + http://www.apache.org/licenses/LICENSE-2.0
    +
    + Unless required by applicable law or agreed to in writing,
    + software distributed under the License is distributed on an
    + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + KIND, either express or implied.  See the License for the
    + specific language governing permissions and limitations
    + under the License.
    + */
    +
    +var path = require('path');
    +var rewire = require('rewire');
    +var build = rewire('../../../bin/templates/scripts/cordova/lib/build');
    +
    +describe('build', function () {
    +    var testProjectPath = path.join('/test', 'project', 'path');
    +
    +    describe('getXcodeBuildArgs method', function() {
    +
    +        var getXcodeBuildArgs = build.__get__('getXcodeBuildArgs');
    +        build.__set__('__dirname', path.join('/test', 'dir'));
    +
    +        it('should generate appropriate args if a single buildFlag is passed in', function(done)
{
    +            var isDevice = true;
    +            var buildFlags = '-xcconfig TestXcconfigFlag';
    +
    +            var args = getXcodeBuildArgs('TestProjectName', testProjectPath, 'TestConfiguration',
isDevice, buildFlags);
    +            expect(args[0]).toEqual('-xcconfig');
    +            expect(args[1]).toEqual('TestXcconfigFlag');
    +            expect(args[2]).toEqual('-project');
    +            expect(args[3]).toEqual('TestProjectName.xcodeproj');
    +            expect(args[4]).toEqual('ARCHS=armv7 arm64');
    +            expect(args[5]).toEqual('-target');
    +            expect(args[6]).toEqual('TestProjectName');
    +            expect(args[7]).toEqual('-configuration');
    +            expect(args[8]).toEqual('TestConfiguration');
    +            expect(args[9]).toEqual('-sdk');
    +            expect(args[10]).toEqual('iphoneos');
    +            expect(args[11]).toEqual('build');
    +            expect(args[12]).toEqual('VALID_ARCHS=armv7 arm64');
    +            expect(args[13]).toEqual('CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath,
'build', 'device'));
    +            expect(args[14]).toEqual('SHARED_PRECOMPS_DIR=' + path.join(testProjectPath,
'build', 'sharedpch'));
    +            expect(args.length).toEqual(15);
    +            done();
    +        });
    --- End diff --
    
    Tests need to be updated once the missing flags are put back.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message