ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Lyon" <m...@stargus.com>
Subject Using Ant to <exec> a shell script
Date Mon, 19 Nov 2001 18:03:52 GMT
Hi,

I have an <exec> task that calls a shell script on Unix to kick off a
smoke test. The shell script is actually calling the Expect executable
as follows:

#!/usr/local/bin/expect --

The relevant snippet from my build.xml is as follows:

  <target name="smoke.test.starnode"
          depends="init"
          description="- This target executes the Starnode smoke test
shell script.">
     <exec dir="/export/home/stargus/tests"
           vmlauncher="false"
           executable="/usr/bin/sh">
       <arg line="./reactor_smoketest ${test.case} ${build.number}"/>
    </exec>
  </target>

For some reason, it would appear that when Ant invokes the shell script,
the shell script itself is not invoking Expect. However, when I execute
the shell script directly, (e.g. ./reactor_smoketest, it runs just fine.
The -debug output from Ant is as follows:

smoke.test.starnode:
     [exec] Current OS is SunOS
     [exec] /usr/bin/sh ./reactor_smoketest pre test
Execute:CommandLauncher: /usr/local/ant/bin/antRun
/export/home/stargus/tests /usr/bin/sh ./reactor_smoketest pre test
     [exec] ./reactor_smoketest: proc: not found
     [exec] ./reactor_smoketest: send_log: not found
     [exec] ./reactor_smoketest: puts: not found
     [exec] ./reactor_smoketest: syntax error at line 7: `}' unexpected
     [exec] Result: 2

We are looking at having the buildfile <exec> Expect directly and then
passing the script to the Expect as an argument. However, it seems like
our first approach should work. Has anyone run into anything similar and
come up with a valid workaround? Do I need to pass additional args?

Cheers,

Matt

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message