aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata/artifacts-map-race-condition/artifacts-map-race-condition.qbs
blob: af568ae45936092ebca694a1c445d8c29713454b (plain)
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
import qbs

Product {
    name: "p"
    type: ["custom1", "custom2", "custom3", "custom4", "custom5"]
    Rule {
        multiplex: true
        outputFileTags: "custom1"
        prepare: {
            var cmd = new JavaScriptCommand();
            cmd.description = "reader1";
            cmd.sourceCode = function()
            {
                for (var i = 0; i < 1000; ++i) {
                    for (var t in product.artifacts) {
                        var l = product.artifacts[t];
                        for (var j = 0; j < l.length; ++j)
                            var fileName = l[j].fileName;
                    }
                }
            };
            return cmd;
        }
    }
    Rule {
        multiplex: true
        outputFileTags: "helper"
        prepare: {
            var cmd = new JavaScriptCommand();
            cmd.description = "helper";
            cmd.sourceCode = function() { };
            return cmd;
        }
    }

    Rule {
        inputs: ["helper"]
        outputFileTags: ["custom2", "custom3", "custom4"]
        outputArtifacts: {
            console.info("writer");
            var artifacts = [];
            for (var i = 0; i < 1000; ++i) {
                artifacts.push({ filePath: "dummyt1" + i, fileTags: ["custom2"] });
                artifacts.push({ filePath: "dummyt2" + i, fileTags: ["custom3"] });
                artifacts.push({ filePath: "dummyt3" + i, fileTags: ["custom4"] });
            }
            return artifacts;
        }
        prepare: {
            var cmd = new JavaScriptCommand();
            cmd.description = "writer dummy command";
            cmd.sourceCode = function() { };
            return cmd;
        }
    }
    Rule {
        multiplex: true
        outputFileTags: "custom5"
        prepare: {
            var cmd = new JavaScriptCommand();
            cmd.description = "reader2";
            cmd.sourceCode = function()
            {
                for (var i = 0; i < 1000; ++i) {
                    for (var t in product.artifacts) {
                        var l = product.artifacts[t];
                        for (var j = 0; j < l.length; ++j)
                            var fileName = l[j].fileName;
                    }
                }
            };
            return cmd;
        }
    }
}