[RFC 2/7] Add unit test to builtin tdesc generated by xml

Yao Qi qiyaoltc@gmail.com
Fri May 19 15:47:00 GMT 2017


Pedro Alves <palves@redhat.com> writes:

> Not sure -- does it work in remote host testing scenarios?

It doesn't work in remote host.

> Recall that unit testing is invoked by the normal testsuite, from
> gdb.gdb/unittest.exp.
>
> An alternative would be to add a specific command to run these tests,
> which would take the path as argument, like
> "maint check xml-descriptions /path/to/features/", and then run that
> from gdb.gdb/unittest.exp.

It is difficult to get it working for remote host either, because we
need to copy all features/*.xml to the remote host.

Can we just skip this unit test if it can't find "features" directory?

  std::string feature_dir (ldirname (__FILE__));
  struct stat st;

  /* Look for the features directory.  If the directory of __FILE__ can't
     be found, __FILE__ is a file name with relative path.  Guess that
     GDB is executed in testsuite directory like ../gdb, because I don't
     expect that GDB is invoked somewhere else and run self tests.  */
  if (stat (feature_dir.data (), &st) < 0)
    {
      feature_dir.insert (0, SLASH_STRING);
      feature_dir.insert (0, "..");

      /* If still can't find the path, skip it.  */
      return;
    }

-- 
Yao (齐尧)



More information about the Gdb-patches mailing list