You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Supported features now:
- Creating the batching structure as described in the bug.
- Running the batch with the given parameters
Still missing:
- User should be able to write the brute solution with it's preferred
langauge, not necessarly C++
- "rand.h" is still a dummy library for now and will be added as part of
another bug.
Copy file name to clipboardExpand all lines: README.md
+41
Original file line number
Diff line number
Diff line change
@@ -124,6 +124,47 @@ type TemplateContext struct {
124
124
```
125
125
You can access any of the model fields in the template, and make changes accordingly dependending on your preferences.
126
126
- Running the command `egor config set config.templates.{lang} /path/to/template/file` will register the given template and will use it for the given language for future tasks.
127
+
128
+
## Batch testing
129
+
130
+
- This one is usefull if you are stuck on a problem, your solution gets `WA` and
131
+
you can't figure out a testcase that will make it break.
132
+
- If you know how to write a brute force solution to the problem, egor can help
133
+
with running the that solution that you know gives the correct answer against
134
+
your (optimal) solution, and figure out when will they differ.
135
+
136
+
### Steps to make a batch test
137
+
- Create a batch configuration
138
+
139
+
```
140
+
egor batch create --has-brute
141
+
```
142
+
143
+
Running this will create 3 additional files:
144
+
145
+
-`gen.cpp`: which is the random input generator, this include a small random
146
+
generation library `"rand.h"`, feel free to use it to generate testcases for
147
+
the given problem.
148
+
-`main_brute.cpp`: which will act as the brute force solution.
149
+
-`rand.h`: the random generation library, contains a bunch of helper methods
150
+
to generate random input, read the source and docs on public methods for
151
+
additional info.
152
+
153
+
Once all the files are filled according to their purpose, you can start running
154
+
your batch test using
155
+
156
+
```
157
+
egor batch run --tests=10
158
+
```
159
+
160
+
the parameter `--tests` tells egor how many times it should run your code,
161
+
a `100` is a good start.
162
+
163
+
If you can't find a failing testcase after this, you can increase the
164
+
`--tests` parameter, or change the generation strategy, (ex: try bigger
165
+
/ smaller numbers), egor will give your program a random seed every time it runs
166
+
the generator, so that it generates a new testcase with every run.
167
+
127
168
## Contribution
128
169
129
170
- Contribution to the project can be done in multiple ways, you can report bugs and issues or you can discuss new features that you like being added in future versions by creating a new issue
color.Red("No task runner found for the task's default language, make sure to not change the egor metafile unless manually unless you know what you are doing!")
0 commit comments