Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrender.js
More file actions
Latest commit
76 lines (67 loc) · 1.89 KB
/
Copy pathrender.js
File metadata and controls
76 lines (67 loc) · 1.89 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/**
* Created by henrikrudstrom on 29.02.16.
*/
varfs=require('fs');
varexecFile=require("child_process").execFileSync;
varexec=require("child_process").execSync;
varglob=require("glob");
vardevPath=__dirname.split("/").pop();
varloader="dev/loader.qml";
varpaths=[
"tests/Tests/qml/*.qml",
//"tests/Tests/SimpleRenderTest.qml"
];
functionisRenderTest(file,callback){
varlineReader=require('readline').createInterface({
input: require('fs').createReadStream(file)
});
lineReader.on('line',function(line){
if(line.indexOf("@Render")!=-1){
callback();
}
lineReader.close();
});
}
if(process.argv.length==2){
paths.forEach(function(paths){
glob(paths,function(er,files){
files.forEach(function(file){
console.log("Rendering "+file)
render(file);
});
});
// glob("tests/**/*.qml", function(er, files) {
// files.forEach(function(file) {
// isRenderTest(file, function() { render(file); });
// });
// });
});
}elseif(process.argv.length==3){
render(process.argv[2])
}
functionrender(path){
//console.log(path);
varpng=path.replace(".qml",".png");
execRender(devPath+"/bin/qtqmltest",loader,path);
exec("sleep 1")
// try {
// fs.accessSync(png, fs.F_OK);
// } catch (e) {
// exec(devPath + "/bin/shorty", [devPath + "/simple_screenshot.qml", path]);
// }
// console.log(cwd)
// console.log(devPath + "/bin/shorty")
//
// var files = [devPath + loader , devPath + path.replace("/", "\\")]
// console.log(files)
// execAsync(devPath + "\\bin\\shorty", files, function(err, stdout, stderr){
// console.log(err);
// console.log(stdout);
// console.log(stderr);
// });
//console.log(output.toString('ascii'))
}
functionexecRender(shorty,loader,file){
console.log(shorty,loader,file)
execFile(shorty,[loader,file]);
}