1. eutest.bat
- Posted by ChrisB (moderator) Mar 17, 2009
- 833 views
Hi
In \bin\ there is a file, eutest.exw, called from eutest.bat.
Starting either of these gives
C:\EUPHORIA\include\std/sort.e:59 in function sort()
type_check failure, x is -1
... called from C:\EUPHORIA\BIN\eutest.ex:98 in procedure do_test()
... called from C:\EUPHORIA\BIN\eutest.ex:341 in procedure main()
... called from C:\EUPHORIA\BIN\eutest.ex:345
> See ex.err
This is called from
if length(files) = 0 then files = sort(dir("t_*.e")) end if
in eutest.exw, which calls
public function sort(sequence x, integer order = ASCENDING)
in sort.e
Running eutest without a command line will lead to the dir() result being -1, which leads to the error. Should sort be
public function sort(object x, integer order = ASCENDING) if not sequence(x) then return -1 end if
Or is eutest.exw now obsolete and just a hang over from previous installs?
Chris
2. Re: eutest.bat
- Posted by jeremy (admin) Mar 17, 2009
- 795 views
Or is eutest.exw now obsolete and just a hang over from previous installs?
No, eutest is the new unit testing application. We use eutest to run over 2,000 tests every single commit of SVN. Right now, all tests are passing for me on Linux and Windows.
I think what the problem is that eutest is not checking parameters correctly. To run eutest you either need to supply a test case file, or be in a directory containing files named t_??????.e.
You can see example test cases, the test cases for Euphoria, in your EUDIR/tests directory. If you run eutest from that directory, or run eutest t_sequence.e for example, you will run the unit tests for Euphoria.
eutest is a new and exciting thing coming with 4.0. Any library/application/project can use eutest to unit test their product to ensure it's proper function time after time, change after change.
I'll commit a fix this evening to eutest to make it pay attention to the command line and the existance (or not in this case) of files named t_???.e in the current working directory. Thanks for reporting this problem. This is one of those cases where the devs know how to use the program and we've never tried to misuse it, so we've never found this bug. That's the hardest type of bug for devs to find.
Jeremy
3. Re: eutest.bat
- Posted by jeremy (admin) Mar 17, 2009
- 796 views
Hm, I just tried this and eutest already checks command arguments as well as files in the local directory. If no command line or no files in the local dir named t_???.e then it reports: No unit tests supplied or found.
I then looked at line 345 of eutest.ex and no where near that line is anything to do with sort. The sort call is on line 293. I think you somehow have an old copy of eutest.ex. I did notice you mentioned eutest.exw (notice exw). The current eutest program is ex not exw. Your error report seems to indicate a correct ex though.
Can you check to make sure you have the latest eutest?
The current version that does the dir and sort calls looks like this:
if length(files) = 0 then files = dir("t_*.e") if atom(files) then puts(2,"No unit tests supplied or found.\n") abort(1) end if files = sort(files) end if
Jeremy