3
3
*/
4
4
var fs = require ( 'fs' ) ;
5
5
var exec = require ( "child_process" ) . execFileSync ;
6
+ var execAsync = require ( "child_process" ) . execFile ;
6
7
var glob = require ( "glob" ) ;
7
8
8
9
var devPath = __dirname . split ( "/" ) . pop ( ) ;
10
+ var loader = "tests/qtloader.qml" ;
9
11
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"
13
14
] ;
14
15
15
16
function isRenderTest ( file , callback ) {
@@ -27,23 +28,45 @@ function isRenderTest(file, callback) {
27
28
}
28
29
29
30
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
+ // });
38
40
} ) ;
39
41
42
+
40
43
function render ( path ) {
41
- console . log ( path ) ;
44
+ // console.log(path);
42
45
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
+ }
48
64
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 ] ) ;
49
72
}
0 commit comments