forked from alunny/node-xcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeaderSearchPaths.js
More file actions
59 lines (55 loc) · 2.25 KB
/
HeaderSearchPaths.js
File metadata and controls
59 lines (55 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
var fullProject = require('./fixtures/full-project')
fullProjectStr = JSON.stringify(fullProject),
pbx = require('../lib/pbxProject'),
pbxFile = require('../lib/pbxFile'),
proj = new pbx('.');
function cleanHash() {
return JSON.parse(fullProjectStr);
}
exports.setUp = function (callback) {
proj.hash = cleanHash();
callback();
}
var PRODUCT_NAME = '"KitchenSinktablet"';
exports.addAndRemoveToFromHeaderSearchPaths = {
'add should add the path to each configuration section':function(test) {
proj.addToHeaderSearchPaths({
path:'some/path/include'
});
var config = proj.pbxXCBuildConfigurationSection();
for (var ref in config) {
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
var lib = config[ref].buildSettings.HEADER_SEARCH_PATHS;
test.ok(lib[1].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') > -1);
}
test.done();
},
'add should not mangle string arguments and add to each config section':function(test) {
var includePath = '../../some/path';
proj.addToHeaderSearchPaths(includePath);
var config = proj.pbxXCBuildConfigurationSection();
for (var ref in config) {
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
var lib = config[ref].buildSettings.HEADER_SEARCH_PATHS;
test.ok(lib[1].indexOf(includePath) > -1);
}
test.done();
},
'remove should remove from the path to each configuration section':function(test) {
var libPath = 'some/path/include';
proj.addToHeaderSearchPaths({
path:libPath
});
proj.removeFromHeaderSearchPaths({
path:libPath
});
var config = proj.pbxXCBuildConfigurationSection();
for (var ref in config) {
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
var lib = config[ref].buildSettings.HEADER_SEARCH_PATHS;
test.ok(lib.length === 1);
test.ok(lib[0].indexOf('$(SRCROOT)/KitchenSinktablet/some/path/include') == -1);
}
test.done();
}
}