forked from codewars/codewars-runner-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.js
66 lines (64 loc) · 1.92 KB
/
run.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
var run = require('./lib/runner').run,
opts = require("nomnom")
.options({
code: {
abbr: 'c',
help: 'code to run'
},
fixture: {
abbr: 'f',
help: 'Test fixture code to test with'
},
setup: {
abbr: 's',
help: 'Setup code to be used for executing the code'
},
language: {
abbr: 'l',
help: 'The language to execute the code in'
},
languageVersion: {
abbr: 'lv',
help: 'The language version that should be used'
},
testFramework: {
abbr: 't',
full: 'test-framework',
help: 'The language specific framework to run in'
},
shell: {
abbr: 'sh',
help: 'An optional shell script which will be ran within the sandbox environment before the code is executed'
},
timeout: {
help: 'The timeout to be used for running the code. If not specified a language specific default will be used'
},
format: {
help: 'The output format that will be returned. Options are "default" and "json"',
default: 'default',
choices: ['default', 'json'],
abbr: 'fmt'
},
services: {
abbr: 'srv',
help: 'Enable a set of services, such as redis or mongodb. Multiple options can be specified',
list: true,
choices: ['mongodb', 'redis']
},
debug: {
abbr: 'd',
help: 'Print debugging info',
flag: true
},
version: {
abbr: 'v',
flag: true,
help: 'Print version and exit',
callback: function() {
return require('./lib/config').version;
}
}
})
.help('This utility will run code in a specified language, using the specified testing suite.')
.parse();
run(opts);