This repository has been archived by the owner on Feb 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
144 lines (141 loc) · 4.81 KB
/
Gruntfile.js
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options : {
jshintrc : '.jshintrc'
},
all : ['tests/*.js', 'Gruntfile.js']
},
watch: {
scripts: {
files: ['tests/generation/template.js'],
tasks: ['run'],
options: {
spawn: false,
},
},
},
batch_git_clone: {
TodoMVC: {
options: {
configFile:"Git2Clone.json",
npmInstall:true,
bowerInstall:true,
overWrite:true
},
},
},
run: {
master: {
cmd: 'tests/generation/generate.sh'
},
masterClean: {
cmd: 'tests/generation/generate-clean.sh'
},
tag130: {
cmd: 'tests/generation/generate-1.3.0-all.sh'
},
tag130Tested: {
cmd: 'tests/generation/generate-1.3.0-tested.sh'
},
tag130Clean: {
cmd: 'tests/generation/template-1.3.0-clean.sh'
},
checkout130:{
cmd: 'tests/generation/checkout.sh',
args: [
'--130'
]
},
checkoutMaster:{
cmd: 'tests/generation/checkout.sh',
args: [
'--master'
]
},
},
clean: {
tests: ["tests/test_*.js", "!tests/basicTest.js", "!tests/advancedTest.js"],
cleaners: ["tests/clean_*.js"],
results: ["tests/results"],
},
casper: {
options: {
test: true,
parallel : false,
concurrency : 1,
'log-level' : 'info',
'fail-fast' : false,
concise : false,
engine : 'phantomjs'
},
cleanFramework: {
src: ['tests/clean_*.js'],
},
basicTest: {
src: ['tests/basicTest.js']
},
basicTest_sljs: {
options: {
engine : 'slimerjs'
},
src: ['tests/basicTest.js']
},
advancedTest: {
src: ['tests/test_*.js'],
//https://github.com/iamchrismiller/grunt-casper/issues/68
//dest : function(input) {
// var str = input.replace('tests/', '');
// return 'tests/results/'+str.replace(/\.js$/,'phs.xml');
//}
},
advancedTest_sljs: {
options: {
engine : 'slimerjs'
},
src: ['tests/test_*.js'],
//https://github.com/iamchrismiller/grunt-casper/issues/68
//dest : function(input) {
// var str = input.replace('tests/', '');
// return 'tests/results/'+str.replace(/\.js$/,'sljs.xml');
//}
},
},
availabletasks: {
tasks: {
options: {
filter: 'exclude',
tasks: ['casper', 'batch_git_clone', 'clean', 'default', 'jshint', 'run', 'stop', 'verify', 'wait', 'watch', 'availabletasks']
}
}
}
});
grunt.loadNpmTasks('grunt-batch-git-clone');
grunt.loadNpmTasks('grunt-run');
grunt.loadNpmTasks('grunt-casper');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-available-tasks');
//Setup
grunt.registerTask('default', ['availabletasks']);
grunt.registerTask('setup', 'Setup TodoMVC App. and generate Tests [master]',['batch_git_clone', 'run:checkoutMaster']);
grunt.registerTask('setup-130', 'Setup TodoMVC App. and generate Tests [1.3.0]',['batch_git_clone', 'run:checkout130']);
grunt.registerTask('generate-master', 'Generate Tests for master branch', ['clean:tests', 'clean:results', 'run:checkoutMaster', 'run:master']);
grunt.registerTask('generate-130-all', 'Generate Tests for all Framework on 1.3.0 tag', ['clean:tests', 'clean:results', 'run:checkout130', 'run:tag130']);
grunt.registerTask('generate-130-tested', 'Generate Tests for all functionnal Framework on 1.3.0 tag', ['clean:tests', 'clean:results', 'run:checkout130', 'run:tag130Tested']);
grunt.registerTask('generate-clean', 'Generate todos cleaner', ['run:masterClean']);
grunt.registerTask('generate-130-clean', 'Generate todos cleaner', ['run:tag130Clean']);
//Clean
grunt.registerTask('clean-all', 'Delete all tests and results', ['clean:tests', 'clean:cleaners', 'clean:results']);
grunt.registerTask('clean-tests', 'Delete all tests',['clean:tests']);
grunt.registerTask('clean-results', 'Delete all results',['clean:results']);
grunt.registerTask('clean-todo', 'Delete all todos', ['casper:cleanFramework']);
//Test
//grunt.registerTask('test-basic-phjs', 'Launch basic test with PhantomJS',['casper:basicTest']);
//grunt.registerTask('test-basic-sljs', 'Launch basic test with SlimerJS',['casper:basicTest_sljs']);
grunt.registerTask('test-advanced-phjs', 'Launch all test with PhantomJS',['casper:advancedTest']);
//grunt.registerTask('test-advanced-sljs', 'Launch all test with SlimerJS',['casper:advancedTest_sljs']);
//Other
grunt.registerTask('verify', ['jshint']);
};