-
Notifications
You must be signed in to change notification settings - Fork 5
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
Improve unit testing situation #12
Comments
I've started using unit_threaded after looking at them all. It requires a slight dub.json hack to make it work but I preferred its syntax over the others. Let me know which you like more :) |
I was actually looking at dtest, which is apparently a wrapper around |
Yes, I tried using that. I didn't like that I had to invoke "configurations": [
{
"name": "library",
},
{
"name": "unittest",
"targetType": "executable",
"mainSourceFile": "unit_threaded_tests.d",
"importPaths": [
".",
],
"sourcePaths": [
".",
],
"preGenerateCommands": [
"cd $PACKAGE_DIR && dub run dtest --quiet -- -f unit_threaded_tests.d > /dev/null",
"cd $PACKAGE_DIR && sed -i.bak 's/import unit_threaded.runner;/import unit_threaded.io : WriterThread; import unit_threaded.runner : runTests;/' unit_threaded_tests.d",
"cd $PACKAGE_DIR && sed -i.bak 's/import std.stdio;/import std.stdio : writeln;/' unit_threaded_tests.d",
"cd $PACKAGE_DIR && sed -i.bak 's/\\(int main(string\\[\\] args) {\\)/\\1 scope(exit) WriterThread.get.join();/' unit_threaded_tests.d",
],
"versions": [
"VibeCustomMain"
],
},
], The
The scoped imports are for |
Cool, thanks for posting this! I'd definitely prefer to keep using |
Note: I didn't put
|
Look in to using a proper unit-testing framework.
At the very least, add descriptive messages to unit-test asserts.
The text was updated successfully, but these errors were encountered: