This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Pedro Alves <> 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 ( (), &st) < 0)
      feature_dir.insert (0, SLASH_STRING);
      feature_dir.insert (0, "..");

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

Yao (齐尧)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]