| <?xml version="1.0" encoding="ISO-8859-1"?> | |
| <!DOCTYPE project [ | |
| <!-- | |
| Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. | |
| This program and the accompanying materials are made available under the | |
| terms of the Eclipse Public License v. 2.0, which is available at | |
| http://www.eclipse.org/legal/epl-2.0. | |
| This Source Code may also be made available under the following Secondary | |
| Licenses when the conditions for such availability set forth in the | |
| Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | |
| version 2 with the GNU Classpath Exception, which is available at | |
| https://www.gnu.org/software/classpath/license.html. | |
| SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | |
| --> | |
| <!ENTITY commonSetup SYSTEM "file:./../../../config/properties.xml"> | |
| <!ENTITY commonBuild SYSTEM "file:./../../../config/common.xml"> | |
| ]> | |
| <project name="appclientHelp" default="all" basedir="."> | |
| &commonSetup; | |
| &commonBuild; | |
| <condition property="isWin"> | |
| <os family="windows"/> | |
| </condition> | |
| <target name="all" depends="execAndCheck"/> | |
| <target name="execAndCheck" depends="testHelp,testUsage"/> | |
| <target name="testHelp"> | |
| <antcall target="exec"> | |
| <param name="keyword" value="-help"/> | |
| </antcall> | |
| <antcall target="checkResult"> | |
| <param name="keyword" value="-help"/> | |
| <param name="expectedFragment" value="SYNOPSIS"/> | |
| </antcall> | |
| </target> | |
| <target name="testUsage"> | |
| <antcall target="exec"> | |
| <param name="keyword" value="-usage"/> | |
| </antcall> | |
| <antcall target="checkResult"> | |
| <param name="keyword" value="-usage"/> | |
| <param name="expectedFragment" value="Usage"/> | |
| </antcall> | |
| </target> | |
| <target name="exec" depends="execWin,execNonwin"> | |
| </target> | |
| <target name="execWin" if="isWin"> | |
| <exec executable="cmd" outputproperty="cmdOutput"> | |
| <arg value="/c"/> | |
| <arg value="appclient.bat"/> | |
| <arg value="${keyword}"/> | |
| </exec> | |
| </target> | |
| <target name="execNonwin" unless="isWin"> | |
| <exec executable="appclient" outputproperty="cmdOutput"> | |
| <arg value="${keyword}"/> | |
| </exec> | |
| </target> | |
| <target name="checkResult" depends="exec"> | |
| <condition property="checkOK"> | |
| <contains string="${cmdOutput}" substring="${expectedFragment}"/> | |
| </condition> | |
| <echo level="verbose">Result is ${checkOK} of checking for ${expectedFragment} in ${cmdOutput}</echo> | |
| <fail unless="checkOK" message="appclient ${keyword} output did not contain expected fragment ${expectedFragment}."/> | |
| </target> | |
| </project> |