<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 03/19/2018 05:04 PM, Alexander
      Kanavin wrote:<br>
    </div>
    <blockquote
      cite="mid:6c04cfc3-2553-98ef-1b43-6a08a02d9e9a@linux.intel.com"
      type="cite">On 03/19/2018 06:53 AM, ChenQi wrote:
      <br>
      <br>
      <blockquote type="cite">For autotools,
        <br>
        1) if the test framework of some package is a standalone set of
        scripts or it could be easily decoupled from Makefile, adding
        ptest support for such package is easy.
        <br>
        2) if the test framework of some package is coupled with
        Makefile, we need to adjust or replace vars in Makefile, install
        make on target and rely on the Makefile to run tests. In such
        case, adding ptest is not easy.
        <br>
        <br>
        For meson, the test framework is coupled with meson/ninja. We
        need to at least install ninja and meson on target as a first
        step. Maybe we need to adjust other things in do_install_ptest.
        That's why I said "there's no easy way to add ptest support."
        <br>
        <br>
        Why didn't I look further into this problem? Because I view
        ptest support as optional, not necessary.
        <br>
        What I thought was: "let's upgrade the package first. If ptest
        support is required from community, deal with that in a separate
        patch."
        <br>
        <br>
        Now that I've got feedback from you, I think I'll look further
        into this issue and try to add ptest support via a separate
        patch.
        <br>
      </blockquote>
      <br>
      But is it tightly coupled with meson/ninja? From what I see here:
      <br>
      <br>
      <a class="moz-txt-link-freetext" href="https://github.com/systemd/systemd/blob/master/test/meson.build">https://github.com/systemd/systemd/blob/master/test/meson.build</a>
      <br>
      <br>
      there is no testing logic as such in the meson.build file, it
      simply runs a few test scripts, and checks the outcome. Which we
      can easily replicate in a script.
      <br>
      <br>
      Alex
      <br>
      <br>
    </blockquote>
    <br>
    Hi Alex,<br>
    <br>
    The test framework meson uses is like:<br>
    <pre class="  language-meson"><code class="  language-meson">e <span class="token operator">=</span> <span class="token function">executable</span><span class="token punctuation">(</span><span class="token string">'prog'</span><span class="token punctuation">,</span> <span class="token string">'testprog.c'</span><span class="token punctuation">)</span>
<span class="token function">test</span><span class="token punctuation">(</span><span class="token string">'name of test'</span><span class="token punctuation">,</span> e<span class="token punctuation">)</span></code></pre>
    <br>
    <a class="moz-txt-link-freetext" href="http://mesonbuild.com/Unit-tests.html">http://mesonbuild.com/Unit-tests.html</a><br>
    <br>
    So they could be defined in any valid meson.build file. In systemd's
    case, most of them are in top-level meson.build.<br>
    <br>
    I agree with you that it's possible to extract all these test cases
    and hold them in a custom script we write. I think this could serve
    as a fall-back approach to adding ptest support for systemd.<br>
    But I'd like to spend some time to try to find a more general
    approach, avoiding headaches when upgrading.<br>
    <br>
    Best Regards,<br>
    Chen Qi<br>
    <br>
  </body>
</html>