TesterDream is a TopCoder Arena plugin for testing your solution against example cases in external editor. It works in combination with FileEdit and CodeProcessor plugins.
It will extract the example cases and insert them in your source code. When you run your program, your solution will be automatically tested against them. When you submit your source code, the example cases will be automatically deleted. Your TopCoder SRM experience will become more convenient using this plugin.
This plugin currently only supports C++ language.
- Testcases are executed on different processes, so you don’t need to clear global variables between testcase runs. doubles and vectors in return values are compared according to TopCoder’s rule.
- The result of each testcase can be one of the following:
- Passed
- Failed
- Runtime Error
- All testcases are guaranteed to be performed, even when your program crashes in some testcases (unless you kill the program).
- You can add as many custom testcases as you like easily.
- You can view the runtime of your solution for each testcase.
- You can view the current score of your solution, i.e., the points you will receive if you immediately submit your solution.
Here is a sample screenshot of a running program.
Testing SomeProblem (250.0 points)
#0: Passed (0.00 secs)
#1: Failed (0.36 secs)
Expected: { "foo", "bar" }
Received: { "bar", "foo" }
#2: Runtime Error
Time : 9 minutes 3 secs
Score : 227.76 points
-
Download the latest version here.
-
Launch TopCoder Arena and login.
-
Click Options -> Editor.
-
Click Add.
-
Type
FileEdit
in the Name box andfileedit.EntryPoint
in the EntryPoint box. -
In the ClassPath box, browse the FileEdit.jar file in the directory you extracted the plugin.
-
Click OK.
-
Highlight FileEdit and then click Configure.
-
Enter your directory to save the problem solutions (the .cpp files).
-
Uncheck Backup existing file then overwrite.
-
Click Code Template tab.
-
Edit you C++ code template to match your needs. Insert this code at the bottom template. IMPORTANT: If you have another
BEGIN CUT HERE
at the top of your template, please delete it.// BEGIN CUT HERE $TESTCODE$ // END CUT HERE
-
Click Save and then Close.
-
Click Add again.
-
Type
CodeProcessor
in the Name box andcodeprocessor.EntryPoint
in the EntryPoint box. -
In the ClassPath box, browse FileEdit.jar, and then CodeProcessor.jar, and then TesterDream.jar.
-
Click OK.
-
Highlight CodeProcessor and click Configure.
-
Type
fileedit.EntryPoint
in the Editor EntryPoint box, andfushar.TesterDream
in the Processor Class box. -
Click Verify and make sure you don't get any error messages. Then click OK.
-
Select CodeProcessor as the default editor.
-
Click Save and then Close.
-
Make sure your default programming language is C++, if not, click Options -> Setup User Preferences, click Editors tab and select C++ in Default Language.
-
Enjoy! Now, if you open a problem in SRM, a file with the same name as the problem name will be automatically created in your chosen directory. Write your solution in this file. To check against example cases, run the file. To submit, press Compile and then Submit in the Arena – no need to delete anything in your code.
TesterDream is licensed under MIT License.