Well, Greed 2.0 now accepts and encourages the filetest template as a default way to run the test cases -- this is great compared to the legacy test template.
But there is a slight problem wrt the filetest template, especially for IDE users -- I thought we could discuss on it to find a great solution, if any.
The problem
Using filetest template, we read the testcase input file from the current working directory (CWD). This is slightly problematic on IDE environment, for example, Eclipse or Visual Studio.
Usually IDE users (and I) use a single workspace, solution or project to solve topcoder problems, then CWD of the running program is usually the directory where the workspace/project is located. However, the input file is located at the same directory as the source code; under this environment, the testcase input file is not found, hence no tests are run.
Well, one can customize his template and workspace settings, but as long as the template is default, this might be confusing to most users.
A solution?
I think, if possible, we could provide a great way such that wherever the testcase is located and whatever the current working directory is, the test cases from the input file could be successfully loaded.
Possibly, I am devising a way using __FILE__
macro (for C++ and python) to get the absolute path of the source code, assuming the test input and the source code are located in the same directory. But no way for Java and C#.