-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cgtest.php
160 lines (156 loc) · 4.99 KB
/
.cgtest.php
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
/**
* CGTest v1.16.0 by Balint Toth [TBali]
* A multi-language offline batch test runner for CodinGame (or other) solo I/O puzzles.
*
* configuration file
*/
declare(strict_types=1);
namespace TBali\CGTest;
return [
// == The following default config options can be overriden:
// 'dry-run' => false,
// 'run-only' => false,
// 'alt' => false,
// 'ansi' => true,
// 'verbose' => true,
// 'stats' => false,
// 'lang-versions' => false,
// 'clean' => false,
// 'create' => '',
// 'test-case' => 'all',
// 'slowThreshold' => 5, // in seconds
// 'inputPath' => '.tests/input/',
// 'inputPattern' => '%p_i%t.txt',
// 'expectedPath' => '.tests/expected/',
// 'expectedPattern' => '%p_e%t.txt',
// 'outputPath' => '.tests/output/',
// 'outputPattern' => '%p_o%t_%l.txt',
// 'buildPath' => '.tests/temp/',
// 'debugLog' => '.tests/output/_debug_log.txt',
// 'buildLog' => '.tests/temp/_build_log.txt',
// == Patterns available in 'inputPattern', 'expectedPattern', 'outputPattern':
// %l languageName
// %p puzzleName
// %t testIndex [01..99]
// == Tests will be run in the following languages:
// Note: can be overriden via the '--lang=...' command-line option
'languages' => array_merge(PHP_OS_FAMILY != 'Windows' ? [
'bash', // tested on Linux only
// 'objective-c', // untested
'ocaml', // tested on Linux only
// 'swift', // untested
] : [], [
'c',
'c++',
'c#',
'clojure',
'd',
'dart',
'f#',
'go',
'groovy',
'haskell',
'java',
'javascript',
'kotlin',
'lua',
'pascal',
'perl',
'php',
'python',
'ruby',
'rust',
'scala',
'typescript',
'vb.net',
// Additional languages, unsupported on CodinGame:
// 'cobol', // untested
'fortran',
// 'r', // untested
]),
// == Tests will be run for the following puzzles in ALL languages
// Note: can be overriden via command-line or in the per-language 'excludePuzzles' sections
// 'puzzles' => [
// 'path/' => [
// 'puzzleName',
// ],
// ],
'puzzles' => [
'./' => [
'medium_com_rubik',
],
],
// == Tests will be run without test result evaluation for the following puzzles in ALL languages
// Note: can be overriden in the per-language 'excludePuzzles' sections
// Note: the puzzle solution code must exit after reading turn #0 data to avoid infinite loop!
// 'runOnlyPuzzles' => [
// 'path/' => [
// 'puzzleName',
// ],
// ],
'runOnlyPuzzles' => [
],
// == The following per-language config options are available:
// 'languageName' => [
// // IMPORTANT NOTE: if 'sourcePath' is given, it will OVERRIDE the 'path/' keys
// // in the 'puzzles', 'runOnlyPuzzles' and 'includePuzzles' lists.
// 'sourcePath' => 'language/',
// 'sourceExtension' => '.lang',
// 'codinGameVersion' => '',
// 'versionCommand' => 'lang --version',
// 'buildCommand' => '',
// 'runCommand' => 'lang %s',
// 'note' => '',
// 'altVersionCommand' => '',
// 'altBuildCommand' => '',
// 'altRunCommand' => '',
// 'altNote' => '',
// 'cleanPatterns' => [
// 'fileNameWithPathOrPattern',
// ],
// 'excludePuzzles' => [
// 'puzzleName',
// ],
// 'includePuzzles' => [
// 'path/' => [
// 'puzzleName',
// ],
// ],
// 'runOnlyPuzzles' => [
// 'path/' => [
// 'puzzleName',
// ],
// ],
// ],
// == Patterns available in 'buildCommand', 'runCommand', 'cleanPatterns':
// %l languageName
// %p puzzleName
// %o outputPath
// %b buildPath
// == Patterns available in 'buildCommand', 'runCommand':
// %s sourceFileName (with path and extension)
// == Example (not really needed here, as these are the default settings for c):
// 'c' => [
// 'sourcePath' => 'c/',
// 'sourceExtension' => '.c',
// 'codinGameVersion' => 'gcc 11.2.0-20',
// 'versionCommand' => 'gcc --version',
// 'buildCommand' => 'gcc -std=c17 -o %b%p_%l.exe %s -lm -lpthread',
// 'runCommand' => '%b%p_%l.exe',
// 'note' => '',
// 'altVersionCommand' => 'clang --version',
// 'altBuildCommand' => 'clang -std=c17 -o %b%p_%l.exe %s',
// 'altRunCommand' => '%b%p_%l.exe',
// 'altNote' => '',
// 'cleanPatterns' => [
// '%b%p_%l.exe',
// ],
// 'excludePuzzles' => [
// ],
// 'includePuzzles' => [
// ],
// 'runOnlyPuzzles' => [
// ],
// ],
];