-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLEO testing library #92
Conversation
|
Please port some of file access opcodes. It will show use case of before_each (and lack of after_each?) functionality. At this moment I have no idea how the file handle is meant to be passed into testcase. |
added after_each, see example in 0AC8 (allocate/free)
test suites are also often called what C++ libraries are used for unit testing? I can look into how they name things. |
I used google tests. Visual Studio also has some built in support. |
How does the test output looks on the screen? |
it looks fine to me, especially the fading away effect makes more sense in bottom-top direction, without shifting text back to top |
Goals:
Public API:
test(name: string, callback: int)
-- creates new test suite (collection of unit tests)it(expectation: string, callback: int)
-- creates new individual test focusing on testing one thingbefore_each(callback: int)
-- registers a callback that runs before each unit test (test setup)after_each(callback: int)
-- registers a callback that runs after each unit test (test teardown)assert_eq(val1: int, val2: int)
- checks if two int values are equal, otherwise stops the test executionassert_eqf(val1: int, val2: int)
- same as above, but for floatsassert_neq(val1: int, val2: int)
- checks if two int values are not equal, otherwise stops the test executionassert_neqf(val1: int, val2: int)
- same as above, but for floatsassert(val: int)
- checks if value is not 0, otherwise stops the test executionassert_ptr(val: int)
- checks if value is a valid pointer, otherwise stops the test executionSimple example: