[Nfd-dev] Code style robot and unit tests

Junxiao Shi shijunxiao at email.arizona.edu
Tue Aug 22 11:59:08 PDT 2017


Hi Nick

I see no mistake in Cortez's flagging. He can understand
<https://github.com/yoursunny/ndn-cxx-code-style/blob/4d905504731ac1b8c65ad6c6ae4a845b6ea02266/rules0.js#L97>
both NFD's x.t.cpp and NLSR's test-x.cpp test file names.

As an example, the mistake in
https://gerrit.named-data.net/#/c/4132/9/tests/test-name-prefix-table.cpp@24
is that the include line for the unit under test should appear first. The
line "#include "route/name-prefix-table.hpp"" should appear before other
#include lines.

The reason of requiring this include to appear first is to ensure the
header can compile on its own. If the header omits any necessary includes,
the build of name-prefix-table.cpp or test-name-prefix-table.cpp will
break. Thus, this rule ensures that build breaks show up first for the
people working on these files, not for innocent people in other packages.

Yours, Junxiao
Guardian of Mr Anthony M Cortez

On Tue, Aug 22, 2017 at 11:47 AM, Nick Gordon <nmgordon at memphis.edu> wrote:

> For NLSR, we have a particular naming convention with unit tests that
> differs slightly from NFD and ndn-cxx, which is test-*.cpp, as opposed to
> *.t.cpp. Our friendly neighborhood code robot, Mr. Cortez, repeatedly
> insists that we include the corresponding header, which test files usually
> do not have. Since the naming of test files is not mandated by the code
> styles, could the code style robot be extended to not flag those? It's
> tiring to remove his score, explain myself, and give a +1 CS score myself.
> Or, we should formalize a test file naming convention to have a reason to
> decline these kinds of requests.
>
> -Nick
>
> _______________________________________________
> Nfd-dev mailing list
> Nfd-dev at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20170822/1abbe240/attachment.html>


More information about the Nfd-dev mailing list