zen0wu / topcoder-greed

greedy editor for topcoder arena
Apache License 2.0
229 stars 48 forks source link

Tests are not working in Xcode 6.1 (Passed : 0/0 cases) #166

Closed MahmoudMahfouz closed 9 years ago

MahmoudMahfouz commented 9 years ago

Well, the plugin is working as expected in the file creation (code, sample-data, description), but for some reason when I try to run the code file it outputs this:

ColorfulRabbits OR whatever name (250 Points) also tried different problems 146, 499, ... with no luck Passed : 0/0 cases Time : 0 minutes 30 secs Score : 171.06 points Program ended with exit code: 0

I debugged the main function's code and it seems that the argc = 1 and argv[1] = /.../Topcoder/build/TopCoder/Build/Products/Debug/TopCoder" 0x00007fff5fbffa80

so the code never enters

    for (int i = 1; i < argc; ++i) cases.insert(atoi(argv[i]));

EDIT: tried c++11 with same results

Please, any help would be really appreciated. Thanks :)

MahmoudMahfouz commented 9 years ago

I solved it, the problem was that Xcode is building the executable in another directory so it can't read the .sample file. If i used absolute path in the ifstream initialization line the test data will load normally.