Index: tester/rt/config.py
===================================================================
--- tester/rt/config.py	(revision 7051ba5b1958b3926cb69b98d0d9f1db384f754f)
+++ tester/rt/config.py	(revision 52513610668b02c2c3991c75946aa3ed2995e206)
@@ -116,5 +116,5 @@
         return regex
 
-    def _target_command(self, command, bsp_arch = None, bsp = None, exe = None):
+    def _target_command(self, command, bsp_arch = None, bsp = None, exe = None, fexe = None):
         if self.defined('target_%s_command' % (command)):
             cmd = self.expand('%%{target_%s_command}' % (command)).strip()
@@ -125,8 +125,49 @@
             if exe is not None and '@EXE@' in cmd:
                 cmd = cmd.replace('@EXE@', exe)
+            if fexe is not None and '@FEXE@' in cmd:
+                cmd = cmd.replace('@FEXE@', exe)
             if len(cmd) > 0:
                 rs_proc = execute.capture_execution()
                 ec, proc, output = rs_proc.open(cmd, shell = True)
-                self._capture_console('target %s: %s: %s' % (command, cmd, output))
+                self._capture_console('target %s: %s' % (command, cmd))
+                if len(output) > 0:
+                    output = os.linesep.join([' ' + l for l in output.splitlines()])
+                    self._capture_console(output)
+
+    def _target_exe_filter(self, exe):
+        if self.defined('target_exe_filter_command'):
+            f = self.expand('%{target_exe_filter_command}').strip()
+            # Be like sed and use the first character as the delmiter.
+            if len(f) > 0:
+                delimiter = f[0]
+                pat = ''
+                repl = ''
+                repl_not_pat = False
+                esc = False
+                for c in f[1:]:
+                    add = True
+                    if not esc and c == '\\':
+                        esc = True
+                        add = False
+                    elif esc:
+                        if c == delimiter:
+                            c = delimiter
+                        else:
+                            c = '\\' + c
+                            esc = False
+                    elif c == delimiter:
+                        if repl_not_pat:
+                            exe = re.sub(r'%s' % (pat), repl, exe)
+                            self._capture_console('target exe filter: find:%s subst:%s -> %s' % \
+                                                  (pat, repl, exe))
+                            return exe
+                        repl_not_pat = True
+                        add = False
+                    if add:
+                        if repl_not_pat:
+                            repl += c
+                        else:
+                            pat += c
+                raise error.general('invalid exe filter: %s' % (f))
 
     def _output_length(self):
@@ -218,5 +259,5 @@
             if self.console:
                 self.console.open()
-            self.process.open(executable = data[0],
+            self.process.open(executable = exe,
                               port = port,
                               output_length = self._output_length,
@@ -249,22 +290,23 @@
                     bsp_arch = self.expand('%{bsp_arch}')
                     bsp = self.expand('%{bsp}')
-                    self.report.start(index, total, exe, exe, bsp_arch, bsp)
+                    fexe = self._target_exe_filter(exe)
+                    self.report.start(index, total, exe, fexe, bsp_arch, bsp)
                     if self.index == 1:
-                        self._target_command('on', bsp_arch, bsp, exe)
-                    self._target_command('pretest', bsp_arch, bsp, exe)
+                        self._target_command('on', bsp_arch, bsp, exe, fexe)
+                    self._target_command('pretest', bsp_arch, bsp, exe, fexe)
                 finally:
                     self._unlock()
                 if _directive == '%execute':
-                    self._dir_execute(ds, total, index, exe, bsp_arch, bsp)
+                    self._dir_execute(ds, total, index, fexe, bsp_arch, bsp)
                 elif _directive == '%gdb':
-                    self._dir_gdb(ds, total, index, exe, bsp_arch, bsp)
+                    self._dir_gdb(ds, total, index, fexe, bsp_arch, bsp)
                 elif _directive == '%tftp':
-                    self._dir_tftp(ds, total, index, exe, bsp_arch, bsp)
+                    self._dir_tftp(ds, total, index, fexe, bsp_arch, bsp)
                 else:
                     raise error.general(self._name_line_msg('invalid directive'))
                 self._lock()
                 if self.index == self.total:
-                    self._target_command('off', bsp_arch, bsp, exe)
-                self._target_command('posttest', bsp_arch, bsp, exe)
+                    self._target_command('off', bsp_arch, bsp, exe, fexe)
+                self._target_command('posttest', bsp_arch, bsp, exe, fexe)
                 try:
                     status = self.report.end(exe, self.output)
@@ -272,7 +314,7 @@
                     if status == 'timeout':
                         if self.index == self.total:
-                            self._target_command('off', bsp_arch, bsp, exe)
+                            self._target_command('off', bsp_arch, bsp, exe, fexe)
                         else:
-                            self._target_command('reset', bsp_arch, bsp, exe)
+                            self._target_command('reset', bsp_arch, bsp, exe, fexe)
                     self.process = None
                     self.output = None
Index: tester/rt/report.py
===================================================================
--- tester/rt/report.py	(revision 7051ba5b1958b3926cb69b98d0d9f1db384f754f)
+++ tester/rt/report.py	(revision 52513610668b02c2c3991c75946aa3ed2995e206)
@@ -91,5 +91,5 @@
                   bsp_arch,
                   bsp,
-                  path.basename(executable))
+                  path.basename(name))
         self.lock.acquire()
         if name in self.results:
Index: tester/rtems/testing/bsps/xilinx_zynq_zedboard.mc
===================================================================
--- tester/rtems/testing/bsps/xilinx_zynq_zedboard.mc	(revision 7051ba5b1958b3926cb69b98d0d9f1db384f754f)
+++ tester/rtems/testing/bsps/xilinx_zynq_zedboard.mc	(revision 52513610668b02c2c3991c75946aa3ed2995e206)
@@ -54,4 +54,6 @@
 xilinx_zynq_zedboard_arch: none,    none,   'arm'
 test_restarts:             none,    none,   '3'
+target_pretest_command:    none,    none,   'rtems-zynq-mkimg @EXE@'
+target_exe_filter_command: none,    none,   '/\.exe/.exe.img/'
 target_on_command:         none,    none,   'wemo-reset CSEng1 0 && sleep 4 && wemo-reset CSEng1 -1'
 target_off_command:        none,    none,   'wemo-reset CSEng1 0'
