Uberi/Yunit

How to see output

dbigham opened this issue · 5 comments

I gave Yunit a try today but wasn't able to figure out how to see any output.

#Include <Yunit\Yunit>

class HowTestSuite
{
	class TestSkipWhitespace
	{
		Test1()
		{
			MsgBox, YO
			Yunit.Assert(1 = 2)
		}
	}
}

Tester := Yunit.Use(YunitStdout, YunitWindow)
Tester.Test(HowTestSuite)

When this runs, I see the MsgBox, but no window opens to show me any output. (Which I was expecting, since I specified YunitWindow)

I'm also unfamiliar with how to see stdout output.

Looks like you also need to #include Window.ahk or #include StdOut.ahk for whatever output you need. That's whats done in the example file

You're exactly right, thanks!

That does show the window, which will get me by. Do you happen to know how one also sees the stdout?

Uberi commented

Hi @dbigham,

To see stdout, the script should be run in a command prompt - the output will show up below that.

Alternatively, a lot of editors will display stdout when you run the script from the editor!

@dbigham running the script in the cmd prompt alone doesn't seem to work for me

but this does:

https://autohotkey.com/docs/commands/FileAppend.htm

However, text sent to stdout will not appear at the command prompt it was launched from. This can be worked around by piping a script's output to another command or program. For example:
"%ProgramFiles%\AutoHotkey\AutoHotkey.exe" "My Script.ahk" | more

@mmikeww, I've confirmed what you're seeing as well. Thanks!