Scriptor / pharen

Lisp to PHP Compiler
http://pharen.org
BSD 3-Clause "New" or "Revised" License
218 stars 31 forks source link

test.php, required by examples/test files, does not exist #29

Closed rgantt closed 13 years ago

rgantt commented 13 years ago

Scriptor,

I was making some modifications to the Pharen lexer and wanted to avoid introducing any regression defects, so I checked out the tests in examples/test. However, pharen_tests.phn requires a file named "test.php". However, no such file exists in any directory in the repository.

Perhaps you have the file and simply forgot to add it to the repo? It would be great to have, otherwise I'll try to reverse engineer it and issue a pull request later.

Thanks,

Ryan

Scriptor commented 13 years ago

Hey Ryan, I'd guess that this is due to the removal of most already compiled files. The lib/ directory in Pharen is added to the include path so it will try to find test.php in there.

To fix this, just compile lib/test.phn (so that it outputs to lib/test.php).

To actually test, you can either do: php examples/test/pharen_tests.php or add the phake library to the path.

To compile phake, you'll have to do: pharen --executable lib/phake/phake.php.

Then, you can symlink phake.php to just phake in usr/bin or something like that, this will allow you to do: phake test from the Pharen root directory (that's how I do it!). If you're curious, phake uses the tasks defined in phakefile.

You can also do phake build to recompile all Pharen files so that you won't run into any errors from it not finding Pharen files in the future.

EDIT: Just realized that Phake also relies on the path library which doesn't work with the code on github. For now I'd suggest directly invoking the pharen_tests.php file with the PHP interpreter.

rgantt commented 13 years ago

Ah, that makes sense. I ran into a similar issue with sequence.php (that one's kind of odd--it's a lib file, but it's not compiled).

I found this issue by directly invoking the tests as you recommend. I assume this will work after I compile test.phn (I don't know how I missed that.. I was too confident in my grepping abilities, apparently!)

I'll close this out, but maybe the discussion will help someone out if the compiled files end up finding their way out of the repo.

Thanks for the response! I'm excited about this project and hope I can contribute meaningfully in the near future :)