def rostest_name_from_path(pkg_dir, test_file):
 test_file_abs = os.path.abspath(test_file)
 if test_file_abs.startswith(pkg_dir):
  test_file = test_file_abs[len(pkg_dir):]
  if (test_file[0] == os.sep):
   test_file = test_file[1:]
 outname = test_file.replace(os.sep, '_')
 if ('.' in outname):
  outname = outname[:outname.rfind('.')]
 return outname

def rostest_name_from_path ( pkg_dir , test_file ) : test_file_abs = os . path . abspath ( test_file ) if test_file_abs . startswith ( pkg_dir ) : test_file = test_file_abs [ len ( pkg_dir ) : ] if ( test_file [ 0 ] == os . sep ) : test_file = test_file [ 1 : ] outname = test_file . replace ( os . sep , '_' ) if ( '.' in outname ) : outname = outname [ : outname . rfind ( '.' ) ] return outname
derive name of rostest based on file name/path .