ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r949316 - /ant/sandbox/antlibs/vss/src/etc/testcases/msvss.xml
Date Fri, 28 May 2010 23:09:10 GMT
Author: bruce
Date: Fri May 28 23:09:10 2010
New Revision: 949316

URL: http://svn.apache.org/viewvc?rev=949316&view=rev
Log:
test everything, search for ss.exe and server and add to tasks, add presets

Modified:
    ant/sandbox/antlibs/vss/src/etc/testcases/msvss.xml

Modified: ant/sandbox/antlibs/vss/src/etc/testcases/msvss.xml
URL: http://svn.apache.org/viewvc/ant/sandbox/antlibs/vss/src/etc/testcases/msvss.xml?rev=949316&r1=949315&r2=949316&view=diff
==============================================================================
--- ant/sandbox/antlibs/vss/src/etc/testcases/msvss.xml (original)
+++ ant/sandbox/antlibs/vss/src/etc/testcases/msvss.xml Fri May 28 23:09:10 2010
@@ -7,9 +7,9 @@
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
- 
+
       http://www.apache.org/licenses/LICENSE-2.0
- 
+
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,103 +17,180 @@
   limitations under the License.
 -->
 
-<project name="msvss-test" basedir="../../../" 
+<project name="msvss-test" basedir="../../../"
          default="test-all" xmlns:vss="antlib:org.apache.ant.vss">
-         
+
   <property name="file" value="build.xml"/>
   <property name="vss-project" value="antlib"/>
   <property name="testcase-dir" value="${basedir}/src/etc/testcases"/>
-  
-  <target name="setup">
+  <property name="testing-dir" value="${basedir}/testing"/>
+  <property environment="env" />
+
+  <presetdef name="sscreate">
     <vss:create
-  	  vsspath="$/${vss-project}"
+      ssdir="${vss-ss-dir}"
+      serverPath="${vss-server-dir}"
       login="Guest,"
-  	/>
-  </target>
-
-  <target name="test-all" depends="setup">
+    />
+  </presetdef>
 
+  <presetdef name="sscp">
     <vss:cp
-      vsspath="$/${vss-project}"
+      ssdir="${vss-ss-dir}"
+      serverPath="${vss-server-dir}"
       login="Guest,"
     />
+  </presetdef>
 
+  <presetdef name="ssadd">
     <vss:add
+      ssdir="${vss-ss-dir}"
+      serverPath="${vss-server-dir}"
+      login="Guest,"
+    />
+  </presetdef>
+
+  <target name="setup" depends="find-ss-server-dir, find-ss-dir">
+    <fail unless="vss-ss-dir">Could not find ss.exe.
+        Add to Path environment variable
+        or add vss-ss-dir=[path to ss.exe] to build.properties
+        or add -Dvss-ss-dir=[path to ss.exe] to command line.</fail>
+    <fail unless="vss-server-dir">Could not find SourceSafe Database.
+        Add SSDIR to environment
+        or add vss-server-dir=[path to database] to build.properties
+        or add -Dvss-server-dir=[path to database] to command line.</fail>
+    <sscreate
+      vsspath="$/${vss-project}"
+    />
+  </target>
+
+  <target name="find-ss-server-dir" unless="vss-server-dir">
+    <available property="vss-server-dir" file="srcsafe.ini"
+        filepath="${env.SSDIR}" value="${env.SSDIR}" />
+    <available property="vss-server-dir" file="srcsafe.ini"
+        filepath="${env.Ssdir}" value="${env.Ssdir}" />
+    <available property="vss-server-dir" file="srcsafe.ini"
+        filepath="${env.ssdir}" value="${env.ssdir}" />
+  </target>
+
+  <target name="find-ss-dir" depends="find-ss-exe" if="vss-ss-exe"
+      unless="vss-ss-dir">
+    <dirname property="vss-ss-dir" file="${vss-ss-exe}" />
+  </target>
+
+  <target name="find-ss-exe" unless="vss-ss-exe">
+    <available property="vss-ss-exe" file="ss.exe" filepath="${env.Path}"
+        value="ss.exe" />
+    <available property="vss-ss-exe"
+        file="C:\Program Files\Microsoft Visual Sourcesafe\ss.exe"
+        value="C:\Program Files\Microsoft Visual Sourcesafe\ss.exe" />
+    <available property="vss-ss-exe"
+        file="C:\Program Files (x86)\Microsoft Visual Sourcesafe\ss.exe"
+        value="C:\Program Files (x86)\Microsoft Visual Sourcesafe\ss.exe"/>
+  </target>
+
+  <target name="test-all" depends="setup, test-add, test-move,
+      test-cloak, test-delete-recover, test-locate, test-status"
+      description="Test all VSS tasks other than destroy (use cleanup for that)"
+  />
+
+  <target name="test-add" depends="setup">
+
+    <sscp
+      vsspath="$/${vss-project}"
+    />
+
+    <ssadd
       vsspath="$/${vss-project}"
       localpath="${testcase-dir}/msvss.xml"
-      login="Guest,"
       comment="adding antlib file to vss"
     />
 
   </target>
 
   <target name="test-move" depends="setup">
-  	<!-- create sub projects -->
-  	<vss:create
-  	  vsspath="$/${vss-project}/sub1"
-  	  login="Guest,"
-  	/>
-
-  	<vss:create
-  	  vsspath="$/${vss-project}/sub2"
-  	  login="Guest,"
-  	/>
-  	
-  	<!-- perform move operation -->
-	<vss:move
-  	  vsspath="$/${vss-project}/sub2"
-	  destination="$/${vss-project}/sub1"
-  	  login="Guest,"
-  	/>
+    <!-- create sub projects -->
+    <sscreate
+      vsspath="$/${vss-project}/sub1"
+    />
+
+    <sscreate
+      vsspath="$/${vss-project}/sub2"
+    />
+
+    <!-- perform move operation -->
+    <vss:move
+      vsspath="$/${vss-project}/sub2"
+      destination="$/${vss-project}/sub1"
+      login="Guest,"
+      ssdir="${vss-ss-dir}"
+      serverPath="${vss-server-dir}"
+    />
   </target>
-	
+
   <target name="test-cloak" depends="setup">
-	<vss:cloak
-  	  vsspath="$/${vss-project}"
-  	  login="Guest,"
-  	/>
-  	<vss:decloak
-	  vsspath="$/${vss-project}"
-  	  login="Guest,"
-  	/>
-  </target>
-	
-  <target name="test-delete" depends="setup">
-	<vss:delete
-  	  vsspath="$/${vss-project}"
-  	  login="Guest,"
-    />
-  	<vss:recover
-  	  vsspath="$/${vss-project}"
-  	  login="Guest,"
-    />
-  	<!-- should be able to change to project as it has been 'recovered' -->
-  	<vss:cp
-  	  vsspath="$/${vss-project}"
-  	  login="Guest,"
-  	/>
+    <vss:cloak
+      vsspath="$/${vss-project}"
+      login="Guest,"
+      ssdir="${vss-ss-dir}"
+      serverPath="${vss-server-dir}"
+    />
+    <vss:decloak
+      vsspath="$/${vss-project}"
+      login="Guest,"
+      ssdir="${vss-ss-dir}"
+      serverPath="${vss-server-dir}"
+    />
+  </target>
+
+  <target name="test-delete-recover" depends="setup">
+    <vss:delete
+      vsspath="$/${vss-project}"
+      login="Guest,"
+      ssdir="${vss-ss-dir}"
+      serverPath="${vss-server-dir}"
+    />
+    <vss:recover
+      vsspath="$/${vss-project}"
+      login="Guest,"
+      ssdir="${vss-ss-dir}"
+      serverPath="${vss-server-dir}"
+    />
+    <!-- should be able to change to project as it has been 'recovered' -->
+    <sscp
+      vsspath="$/${vss-project}"
+      login="Guest,"
+      ssdir="${vss-ss-dir}"
+      serverPath="${vss-server-dir}"
+    />
   </target>
 
   <target name="test-locate" depends="setup">
     <vss:locate
-  	  vsspath="$/${vss-project}"
-  	  login="Guest,"
-  	/>
+      vsspath="$/${vss-project}"
+      login="Guest,"
+      ssdir="${vss-ss-dir}"
+      serverPath="${vss-server-dir}"
+    />
   </target>
-	
+
   <target name="test-status" depends="setup">
     <vss:status
-	  vsspath="$/${vss-project}"
-	  login="Guest,"
+      vsspath="$/${vss-project}"
+      login="Guest,"
       user="Guest"
-	/>
-  </target>	
-	
-  <target name="cleanup">
-	<vss:destroy
-	  vsspath="$/${vss-project}"
-  	  login="Guest,"
-	  autoresponse="Y"
-  	/>
+      ssdir="${vss-ss-dir}"
+      serverPath="${vss-server-dir}"
+    />
+  </target>
+
+  <target name="cleanup" depends="find-ss-server-dir, find-ss-dir">
+    <vss:destroy
+      vsspath="$/${vss-project}"
+      login="Guest,"
+      autoresponse="Y"
+      ssdir="${vss-ss-dir}"
+      serverPath="${vss-server-dir}"
+    />
   </target>
 </project>
\ No newline at end of file



Mime
View raw message