Skip to content

Commit c4a9f17

Browse files
temp fix render.js
1 parent 5cb2640 commit c4a9f17

File tree

2 files changed

+41
-18
lines changed

2 files changed

+41
-18
lines changed

render.js

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
*/
44
var fs = require('fs');
55
var exec = require("child_process").execFileSync;
6+
var execAsync = require("child_process").execFile;
67
var glob = require("glob");
78

89
var devPath = __dirname.split("/").pop();
10+
var loader = "tests/qtloader.qml";
911
var paths = [
10-
"tests/Render/Simple/*.qml",
11-
"tests/QtQuick/qml/TextBasic.qml",
12-
"tests/QtQuick/qml/RectangleColor.qml"
12+
"tests/Tests/TestCase.qml",
13+
"tests/Tests/SimpleRenderTest.qml"
1314
];
1415

1516
function isRenderTest(file, callback) {
@@ -27,23 +28,45 @@ function isRenderTest(file, callback) {
2728
}
2829

2930
paths.forEach(function(path) {
30-
glob(path, function(er, files) {
31-
files.forEach(render);
32-
});
33-
glob("tests/**/*.qml", function(er, files) {
34-
files.forEach(function(file) {
35-
isRenderTest(file, function() { render(file); });
36-
});
37-
});
31+
// glob(path, function(er, files) {
32+
// console.log(path)
33+
render(path);
34+
//});
35+
// glob("tests/**/*.qml", function(er, files) {
36+
// files.forEach(function(file) {
37+
// isRenderTest(file, function() { render(file); });
38+
// });
39+
// });
3840
});
3941

42+
4043
function render(path) {
41-
console.log(path);
44+
//console.log(path);
4245
var png = path.replace(".qml", ".png");
43-
try {
44-
fs.accessSync(png, fs.F_OK);
45-
} catch (e) {
46-
exec(devPath + "/bin/shorty", [devPath + "/simple_screenshot.qml", path]);
47-
}
46+
execRender(devPath + "/bin/shorty", loader, path);
47+
// try {
48+
// fs.accessSync(png, fs.F_OK);
49+
// } catch (e) {
50+
// exec(devPath + "/bin/shorty", [devPath + "/simple_screenshot.qml", path]);
51+
// }
52+
// console.log(cwd)
53+
// console.log(devPath + "/bin/shorty")
54+
//
55+
// var files = [devPath + loader , devPath + path.replace("/", "\\")]
56+
// console.log(files)
57+
// execAsync(devPath + "\\bin\\shorty", files, function(err, stdout, stderr){
58+
// console.log(err);
59+
// console.log(stdout);
60+
// console.log(stderr);
61+
// });
62+
//console.log(output.toString('ascii'))
63+
}
4864

65+
function execRender(shorty, loader, file){
66+
//console.log(shorty, loader, file)
67+
//shorty = shorty.replace("/", "\\");
68+
//loader = loader.replace("/", "\\");
69+
//file = file.replace("/", "\\");
70+
console.log(shorty, loader, file)
71+
exec(shorty, [loader, file]);
4972
}

shorty

0 commit comments

Comments
 (0)