Repository navigation
src: add c++ test coverage #1193
Description
Activity
It is very interesting thing. What I am mostly curious about is - how much of the stuff will we be able to test within the C++? It seems to me that many if not most of the code is tightly bound to the JS.
The second question is even more interesting :) Do we want it to be cross-platform? Or can we do some raw
socket()machinery in it? Like working with fds, and stuff like that.+1 for this in general, though
It is very interesting thing. What I am mostly curious about is - how much of the stuff will we be able to test within the C++? It seems to me that many if not most of the code is tightly bound to the JS.
That's why I predict there will be a fair bit of churn, to break out the meat from the glue code. I think it's alright when tests set up a VM where it makes sense.
The second question is even more interesting :) Do we want it to be cross-platform? Or can we do some raw socket() machinery in it? Like working with fds, and stuff like that.
It should be cross-platform, with the platform-dependent bits guarded by #ifdef statements. Just like libuv, really. :-)
Sounds awesome! Go ahead with it :)
Good idea indeed. Is there perhaps a
.gypfor gtest somewhere? I'd really despise having to pull cmake or auto* into the dependency chain. Another plan could be making running these tests optional and assume you can handle installing gtest yourself?I don't think there is one currently but it should be pretty easy to get it gypified. gtest core is only a handful of files.
- addedc++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.testIssues and PRs related to Node.js core tests and test infrastructure.Issues and PRs related to Node.js core tests and test infrastructure.
on Mar 19, 2015 - added a commit that references this issue
on Mar 19, 2015 I'm fine with this. Will it mean
make test-addonwill be removed/unneeded?Not right away but it could, longer term. Not the part of
make test-addonthat scrapes the API documentation, though.Can this be closed now? :)
Edit: Assuming it's open until we add more coverage?
Yes, it's fixed (if you can call it that) in 0080788. Adding tests for code in src/ is an ongoing process.
Meta-issue for something that was discussed in today's TC meeting: test coverage for C++ code that is only tested indirectly now.
Strawman proposal: bundle gtest, make it part of
make testand start churning outsrc/*_unittest.cctests like chromium has.Problem: most of the code in src/ is not very modular right now. Turning it into something that is easily testable will no doubt create a lot of churn. Probably unavoidable but it's acceptable to me.
/cc @indutny @piscisaureus @trevnorris - if we can get some consensus on this, I volunteer to do the initial work.