Is there any sort of unit testing done on new releases (or even for each commit)?
I was just thinking that something that might be helpful is to even just execute all examples in the docs and just check for any exceptions to be thrown.
AHK Unit Testing
Re: AHK Unit Testing
I've shared some test code, here. (At some point I plan to create a variant that doesn't need the user to monitor it.)
commands as functions (AHK v2 functions for AHK v1) - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=37&t=29689&p=210822#p210822
commands as functions (AHK v2 functions for AHK v1) - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=37&t=29689&p=210822#p210822
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: AHK Unit Testing
You are welcome to create some unit tests. If they can be completely automated, I will use them.
I have unit tests for Object.ahk, which don't work anymore because they're written for a previous alpha. Yunit was a bit troublesome since Yunit uses objects, and Object.ahk changes the way they work. I adapted most of the tests while I was integrating those changes, but they required repeated modification to keep up with changes to the design.
I have unit tests for Object.ahk, which don't work anymore because they're written for a previous alpha. Yunit was a bit troublesome since Yunit uses objects, and Object.ahk changes the way they work. I adapted most of the tests while I was integrating those changes, but they required repeated modification to keep up with changes to the design.
Re: AHK Unit Testing
I simply wasn't sure if any existed and were used. Although, I didn't look that hard for the answer before posting.
Not confident I'd be up to the task of writing them. With executing the examples in the docs, it might be difficult for any script that is persistent. I suppose you could just use a settimer to check if the process still exists after 5 or 10 seconds and if so, just kill it. Would you have to utilize dbgp to catch the exceptions/errors thrown?
Not confident I'd be up to the task of writing them. With executing the examples in the docs, it might be difficult for any script that is persistent. I suppose you could just use a settimer to check if the process still exists after 5 or 10 seconds and if so, just kill it. Would you have to utilize dbgp to catch the exceptions/errors thrown?
- hoppfrosch
- Posts: 443
- Joined: 07 Oct 2013, 04:05
- Location: Rhine-Maine-Area, Hesse, Germany
- Contact:
Re: AHK Unit Testing
@lexikos: Do you have an up-to-date version of YUnit available, which works with AHK2 a104? I would like to use it within my own projectslexikos wrote: ↑19 Aug 2019, 04:02You are welcome to create some unit tests. If they can be completely automated, I will use them.
I have unit tests for Object.ahk, which don't work anymore because they're written for a previous alpha. Yunit was a bit troublesome since Yunit uses objects, and Object.ahk changes the way they work. I adapted most of the tests while I was integrating those changes, but they required repeated modification to keep up with changes to the design.
Re: AHK Unit Testing
8e083e7 is the version I was using last.
- hoppfrosch
- Posts: 443
- Joined: 07 Oct 2013, 04:05
- Location: Rhine-Maine-Area, Hesse, Germany
- Contact:
Re: AHK Unit Testing
The changes I made were specifically to make my own pre-a104 test script work, and were made incrementally while the language was in an (even more than usual for v2) unstable state. I will not guarantee that it will work the same way as before, or be compatible with any other Yunit-based scripts. If you have confirmed there are no problems, it should be trivial for you to merge the changes directly.
Return to “AutoHotkey Development”
Who is online
Users browsing this forum: Leli196 and 53 guests