You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2012/11/08 09:44:22 UTC
svn commit: r1406954 - /buildr/trunk/tests/integration_testing.rb
Author: donaldp
Date: Thu Nov 8 08:44:22 2012
New Revision: 1406954
URL: http://svn.apache.org/viewvc?rev=1406954&view=rev
Log:
Minor modifications to get the integration tests runnning
Modified:
buildr/trunk/tests/integration_testing.rb
Modified: buildr/trunk/tests/integration_testing.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/tests/integration_testing.rb?rev=1406954&r1=1406953&r2=1406954&view=diff
==============================================================================
--- buildr/trunk/tests/integration_testing.rb (original)
+++ buildr/trunk/tests/integration_testing.rb Thu Nov 8 08:44:22 2012
@@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations under
# the License.
-BUILDR = ENV['BUILDR'] || File.expand_path("../_buildr", File.dirname(__FILE__))
+TEST_DIR = File.dirname(File.expand_path(__FILE__))
+BUILDR = ENV['BUILDR'] || File.expand_path("#{TEST_DIR}/../_buildr")
require 'test/unit'
require 'zip/zip'
@@ -28,11 +29,11 @@ module Buildr
def test_#{folder.sub("-", "")}
begin
- result = %x[cd #{File.expand_path("#{folder}", File.dirname(__FILE__))} ; #{BUILDR} #{cmd}]
- assert($?.success?)
+ result = `cd #{TEST_DIR}/#{folder} ; #{BUILDR} #{cmd}`
+ assert($?.success?, 'Command success?')
#{ after_block || "" }
ensure
- %x[cd #{File.expand_path("#{folder}", File.dirname(__FILE__))} ; #{BUILDR} clean]
+ %x[cd #{TEST_DIR}/#{folder} ; #{BUILDR} clean]
end
end
@@ -54,8 +55,8 @@ module Buildr
test "junit3", "test"
test "include_path", "package", <<-CHECK
-path = File.expand_path("include_path/target/proj-1.0.zip", File.dirname(__FILE__))
-assert(File.exist? path)
+path = File.expand_path("#{TEST_DIR}/include_path/target/proj-1.0.zip")
+assert(File.exist?(path), "File exists?")
Zip::ZipFile.open(path) {|zip|
assert(!zip.get_entry("distrib/doc/index.html").nil?)
assert(!zip.get_entry("distrib/lib/slf4j-api-1.6.1.jar").nil?)
@@ -63,7 +64,7 @@ assert(!zip.get_entry("distrib/lib/slf4j
CHECK
test "include_as", "package", <<-CHECK
-path = File.expand_path("include_as/target/proj-1.0.zip", File.dirname(__FILE__))
+path = File.expand_path("#{TEST_DIR}/include_as/target/proj-1.0.zip")
assert(File.exist? path)
Zip::ZipFile.open(path) {|zip|
assert(!zip.get_entry("docu/index.html").nil?)
@@ -72,8 +73,8 @@ assert(!zip.get_entry("lib/logging.jar")
CHECK
test "package_war_as_jar", "package", <<-CHECK
- assert(File.exist? File.join(File.expand_path(File.dirname(__FILE__)), "package_war_as_jar", "target", "webapp-1.0.jar"))
- %x[cd #{File.expand_path("package_war_as_jar", File.dirname(__FILE__))} ; #{BUILDR} clean]
+ assert(File.exist? "#{TEST_DIR}/package_war_as_jar/target/webapp-1.0.jar")
+ %x[cd #{TEST_DIR}/package_war_as_jar ; #{BUILDR} clean]
assert($?.success?)
CHECK