Page 1 of 1

Test And Hightlight Commands

PostPosted: Mon Jun 27, 2011 9:08 am
by RIGHT_THEN
hey Charles

just tested test option of compiler .

i see its output in output window something like

Code: Select all
>> info..
    >>info..

 >>info..


these grt signs and indentation levels was it intended this way?
or there is something wrong with the output.

    a) secondly while giving -test command and for that matter any of the command that accept paths rest of the command line
    has to be same as that of -c or -r. or not?? that is what i assumed.

    b) for -test, compiler is fully compiling a temp assembly or doing something else?
    if so is it deleted soon after showing results. i see certain files generated but couldn`t locate assembly.

    c) could you inform about all the compiler directives there are in cobra.
    i have seen @args, @ref, @number and @help anymore....??
    is it right to assume that any thing that can be passed as commanline can be passed
    through compiler directives.

Thanking_You
RIGHT_THEN

Re: Test And Hightlight Commands

PostPosted: Mon Jun 27, 2011 7:21 pm
by Charles
RIGHT_THEN wrote:these grt signs and indentation levels was it intended this way?
or there is something wrong with the output.

There is nothing wrong unless you're really not seeing << to balance out the >>. The indentation shows the nested structure of what's being tested. The ">>" means "entering" and "<<" means exiting.

Also, at the end it should say something like:
Code: Select all
<< lib test-20116271910, Version=0.0.0.0
Finished at 6/27/2011 7:10:43 PM.
5 tests run in 00:00:00.1111930.
5 successes.
0 failures.

Also, I think you could roll your own test wrapper if you wanted different output or a GUI, but I have not written instructions on how to do so. You'd have to research it or talk me into cooking up an example.

RIGHT_THEN wrote:a) secondly while giving -test command and for that matter any of the command that accept paths rest of the command line has to be same as that of -c or -r. or not?? that is what i assumed.

Yes, you can see this with "cobra -help" which says:
Code: Select all
  cobra <options> <command> <path(s)>
    * commands that operate on path(s) are:
      -compile .... Compile only. Also, -c
      -run ........ Run the program (compile if necessary). Also -r (Default)
      -test ....... Run the unit tests of a library.
      -document ... Document the program (partial compilation). Also, -doc
      -highlight .. Syntax highlight the program in HTML.

RIGHT_THEN wrote:b) for -test, compiler is fully compiling a temp assembly or doing something else?
if so is it deleted soon after showing results. i see certain files generated but couldn`t locate assembly.

Yes, it creates a program like "test-20116271910.exe", runs it and then deletes it.

RIGHT_THEN wrote:c) could you inform about all the compiler directives there are in cobra.
i have seen @args, @ref, @number and @help anymore....??
is it right to assume that any thing that can be passed as commanline can be passed
through compiler directives.

From "def compilerDirective" in CobraParser, I see:
@help, @throw, @error, @warning, @number, @ref, @args

Forget about @throw. Consider it "internal" for Cobra development purposes.

@error and @warning are rarely used given that we don't have conditional compilation at this point (@if).

@help, @number, @ref and @args are the commonly used directives.

Yes, generally anything you can pass on the command line can be passed through @args, although it was tricky to implement and you may find corner cases. I certainly use it though. I suggest preferring @ref and @number first and then using @args if anything else is needed.

Sometimes instead of using @args, I will have a bash script or Windows .cmd file wrapper if there are additional things I want to do.

Thanks for stubbing out the wiki pages for compiler directives. I recommend further stubs like HelpDirective, NumberDirective, etc.

HTH