From: Eric Wong <e@80x24.org>
To: unicorn-public@bogomips.org
Cc: Eric Wong <e@80x24.org>
Subject: [PATCH] fix uninstalled testing and reduce require paths
Date: Fri, 6 Feb 2015 22:17:26 +0000 [thread overview]
Message-ID: <1423261046-28980-1-git-send-email-e@80x24.org> (raw)
This fixes a bug introduced in
commit fe83ead4eae6f011fa15f506cd80cb4256813a92
(GNUmakefile: fix clean gem build + reduce build cruft)
which broke clean Ruby installations without an existing
unicorn gem installed :x
---
GNUmakefile | 10 +++++++---
test/exec/test_exec.rb | 2 +-
test/unit/test_http_parser.rb | 2 +-
test/unit/test_http_parser_ng.rb | 2 +-
test/unit/test_request.rb | 2 +-
test/unit/test_response.rb | 2 +-
test/unit/test_server.rb | 2 +-
test/unit/test_signals.rb | 2 +-
test/unit/test_socket_helper.rb | 2 +-
test/unit/test_upload.rb | 2 +-
test/unit/test_util.rb | 2 +-
11 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/GNUmakefile b/GNUmakefile
index 8bd63ee..2995a6b 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -59,13 +59,17 @@ $(ext)/unicorn_http.$(DLEXT): $(ext)/Makefile
$(MAKE) -C $(@D)
http: $(ext)/unicorn_http.$(DLEXT)
+# only used for tests
+http-install: $(ext)/unicorn_http.$(DLEXT)
+ install -m644 $< lib/
+
test-install: $(test_prefix)/.stamp
$(test_prefix)/.stamp: $(inst_deps)
mkdir -p $(test_prefix)/.ccache
tar cf - $(inst_deps) GIT-VERSION-GEN | \
(cd $(test_prefix) && tar xf -)
$(MAKE) -C $(test_prefix) clean
- $(MAKE) -C $(test_prefix) http shebang RUBY="$(RUBY)"
+ $(MAKE) -C $(test_prefix) http-install shebang RUBY="$(RUBY)"
> $@
# this is only intended to be run within $(test_prefix)
@@ -119,14 +123,14 @@ run_test = $(quiet_pre) \
%.n: arg = $(subst .n,,$(subst --, -n ,$@))
%.n: t = $(subst .n,$(log_suffix),$@)
%.n: export PATH := $(test_prefix)/bin:$(PATH)
-%.n: export RUBYLIB := $(test_prefix):$(test_prefix)/lib:$(MYLIBS)
+%.n: export RUBYLIB := $(test_prefix)/lib:$(MYLIBS)
%.n: $(test_prefix)/.stamp
$(run_test)
$(T): arg = $@
$(T): t = $(subst .rb,$(log_suffix),$@)
$(T): export PATH := $(test_prefix)/bin:$(PATH)
-$(T): export RUBYLIB := $(test_prefix):$(test_prefix)/lib:$(MYLIBS)
+$(T): export RUBYLIB := $(test_prefix)/lib:$(MYLIBS)
$(T): $(test_prefix)/.stamp
$(run_test)
diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb
index 10a1bae..6deb96b 100644
--- a/test/exec/test_exec.rb
+++ b/test/exec/test_exec.rb
@@ -2,7 +2,7 @@
# Copyright (c) 2009 Eric Wong
FLOCK_PATH = File.expand_path(__FILE__)
-require 'test/test_helper'
+require './test/test_helper'
do_test = true
$unicorn_bin = ENV['UNICORN_TEST_BIN'] || "unicorn"
diff --git a/test/unit/test_http_parser.rb b/test/unit/test_http_parser.rb
index 2251dcf..431ede5 100644
--- a/test/unit/test_http_parser.rb
+++ b/test/unit/test_http_parser.rb
@@ -7,7 +7,7 @@
# Additional work donated by contributors. See git history
# for more information.
-require 'test/test_helper'
+require './test/test_helper'
include Unicorn
diff --git a/test/unit/test_http_parser_ng.rb b/test/unit/test_http_parser_ng.rb
index d5c8d2e..0c81072 100644
--- a/test/unit/test_http_parser_ng.rb
+++ b/test/unit/test_http_parser_ng.rb
@@ -1,6 +1,6 @@
# -*- encoding: binary -*-
-require 'test/test_helper'
+require './test/test_helper'
require 'digest/md5'
include Unicorn
diff --git a/test/unit/test_request.rb b/test/unit/test_request.rb
index fbda1a2..f0ccaf7 100644
--- a/test/unit/test_request.rb
+++ b/test/unit/test_request.rb
@@ -4,7 +4,7 @@
# You can redistribute it and/or modify it under the same terms as Ruby 1.8 or
# the GPLv2+ (GPLv3+ preferred)
-require 'test/test_helper'
+require './test/test_helper'
include Unicorn
diff --git a/test/unit/test_response.rb b/test/unit/test_response.rb
index bdca9f5..d0f0c79 100644
--- a/test/unit/test_response.rb
+++ b/test/unit/test_response.rb
@@ -7,7 +7,7 @@
# Additional work donated by contributors. See git history
# for more information.
-require 'test/test_helper'
+require './test/test_helper'
require 'time'
include Unicorn
diff --git a/test/unit/test_server.rb b/test/unit/test_server.rb
index 9c92bab..8b3afad 100644
--- a/test/unit/test_server.rb
+++ b/test/unit/test_server.rb
@@ -7,7 +7,7 @@
# Additional work donated by contributors. See git history
# for more information.
-require 'test/test_helper'
+require './test/test_helper'
include Unicorn
diff --git a/test/unit/test_signals.rb b/test/unit/test_signals.rb
index 443c736..4592819 100644
--- a/test/unit/test_signals.rb
+++ b/test/unit/test_signals.rb
@@ -6,7 +6,7 @@
#
# Ensure we stay sane in the face of signals being sent to us
-require 'test/test_helper'
+require './test/test_helper'
include Unicorn
diff --git a/test/unit/test_socket_helper.rb b/test/unit/test_socket_helper.rb
index 994b990..8b09198 100644
--- a/test/unit/test_socket_helper.rb
+++ b/test/unit/test_socket_helper.rb
@@ -1,6 +1,6 @@
# -*- encoding: binary -*-
-require 'test/test_helper'
+require './test/test_helper'
require 'tempfile'
class TestSocketHelper < Test::Unit::TestCase
diff --git a/test/unit/test_upload.rb b/test/unit/test_upload.rb
index bcce4bc..5de02e4 100644
--- a/test/unit/test_upload.rb
+++ b/test/unit/test_upload.rb
@@ -1,7 +1,7 @@
# -*- encoding: binary -*-
# Copyright (c) 2009 Eric Wong
-require 'test/test_helper'
+require './test/test_helper'
require 'digest/md5'
include Unicorn
diff --git a/test/unit/test_util.rb b/test/unit/test_util.rb
index 904d51c..4d17a16 100644
--- a/test/unit/test_util.rb
+++ b/test/unit/test_util.rb
@@ -1,6 +1,6 @@
# -*- encoding: binary -*-
-require 'test/test_helper'
+require './test/test_helper'
require 'tempfile'
class TestUtil < Test::Unit::TestCase
--
EW
reply other threads:[~2015-02-06 22:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/unicorn/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423261046-28980-1-git-send-email-e@80x24.org \
--to=e@80x24.org \
--cc=unicorn-public@bogomips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/unicorn.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).