2
2
* Created by henrikrudstrom on 29.02.16.
3
3
*/
4
4
var fs = require ( 'fs' ) ;
5
- var exec = require ( "child_process" ) . execFileSync ;
6
- var execAsync = require ( "child_process" ) . execFile ;
5
+ var execFile = require ( "child_process" ) . execFileSync ;
6
+ var exec = require ( "child_process" ) . execSync ;
7
7
var glob = require ( "glob" ) ;
8
8
9
9
var devPath = __dirname . split ( "/" ) . pop ( ) ;
10
- var loader = "tests/qtloader .qml" ;
10
+ var loader = "dev/loader .qml" ;
11
11
var paths = [
12
- "tests/Tests/TestCase .qml" ,
13
- "tests/Tests/SimpleRenderTest.qml"
12
+ "tests/Tests/qml/* .qml" ,
13
+ // "tests/Tests/SimpleRenderTest.qml"
14
14
] ;
15
15
16
16
function isRenderTest ( file , callback ) {
@@ -26,24 +26,31 @@ function isRenderTest(file, callback) {
26
26
} ) ;
27
27
28
28
}
29
+ if ( process . argv . length == 2 ) {
30
+ paths . forEach ( function ( paths ) {
31
+ glob ( paths , function ( er , files ) {
29
32
30
- paths . forEach ( function ( path ) {
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
- // });
40
- } ) ;
33
+ files . forEach ( function ( file ) {
34
+ console . log ( "Rendering " + file )
35
+ render ( file ) ;
36
+ } ) ;
37
+ } ) ;
38
+ // glob("tests/**/*.qml", function(er, files) {
39
+ // files.forEach(function(file) {
40
+ // isRenderTest(file, function() { render(file); });
41
+ // });
42
+ // });
43
+ } ) ;
44
+ } else if ( process . argv . length == 3 ) {
45
+ render ( process . argv [ 2 ] )
46
+ }
41
47
42
48
43
49
function render ( path ) {
44
50
//console.log(path);
45
51
var png = path . replace ( ".qml" , ".png" ) ;
46
- execRender ( devPath + "/bin/shorty" , loader , path ) ;
52
+ execRender ( devPath + "/bin/qtqmltest" , loader , path ) ;
53
+ exec ( "sleep 1" )
47
54
// try {
48
55
// fs.accessSync(png, fs.F_OK);
49
56
// } catch (e) {
@@ -63,10 +70,6 @@ function render(path) {
63
70
}
64
71
65
72
function execRender ( shorty , loader , file ) {
66
- //console.log(shorty, loader, file)
67
- //shorty = shorty.replace("/", "\\");
68
- //loader = loader.replace("/", "\\");
69
- //file = file.replace("/", "\\");
70
73
console . log ( shorty , loader , file )
71
- exec ( shorty , [ loader , file ] ) ;
74
+ execFile ( shorty , [ loader , file ] ) ;
72
75
}
0 commit comments