Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nginx-push-stream-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
nginx-push-stream-module
Commits
c7e67fda
Commit
c7e67fda
authored
May 28, 2011
by
Wandenberg Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding parameter to change the path of temporary test files
parent
ac9013fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
Rakefile
test/Rakefile
+2
-1
base_test_case.rb
test/base_test_case.rb
+14
-10
No files found.
test/Rakefile
View file @
c7e67fda
...
@@ -20,11 +20,12 @@ namespace :docs do
...
@@ -20,11 +20,12 @@ namespace :docs do
end
end
desc
"Run all tests."
desc
"Run all tests."
task
:tests
,
:executable
,
:host
,
:port
,
:workers
do
|
t
,
args
|
task
:tests
,
:executable
,
:host
,
:port
,
:workers
,
:tests_tmp_dir
do
|
t
,
args
|
ENV
[
'NGINX_EXEC'
]
=
args
[
:executable
]
||
nil
ENV
[
'NGINX_EXEC'
]
=
args
[
:executable
]
||
nil
ENV
[
'NGINX_HOST'
]
=
args
[
:host
]
||
nil
ENV
[
'NGINX_HOST'
]
=
args
[
:host
]
||
nil
ENV
[
'NGINX_PORT'
]
=
args
[
:port
]
||
nil
ENV
[
'NGINX_PORT'
]
=
args
[
:port
]
||
nil
ENV
[
'NGINX_WORKERS'
]
=
args
[
:workers
]
||
nil
ENV
[
'NGINX_WORKERS'
]
=
args
[
:workers
]
||
nil
ENV
[
'NGINX_TESTS_TMP_DIR'
]
=
args
[
:tests_tmp_dir
]
||
nil
require
'test/unit'
require
'test/unit'
...
...
test/base_test_case.rb
View file @
c7e67fda
...
@@ -50,6 +50,10 @@ module BaseTestCase
...
@@ -50,6 +50,10 @@ module BaseTestCase
return
ENV
[
'NGINX_WORKERS'
].
nil?
?
"1"
:
ENV
[
'NGINX_WORKERS'
]
return
ENV
[
'NGINX_WORKERS'
].
nil?
?
"1"
:
ENV
[
'NGINX_WORKERS'
]
end
end
def
nginx_tests_tmp_dir
return
ENV
[
'NGINX_TESTS_TMP_DIR'
].
nil?
?
"tmp"
:
ENV
[
'NGINX_TESTS_TMP_DIR'
]
end
def
start_server
def
start_server
error_message
=
""
error_message
=
""
status
=
POpen4
::
popen4
(
"
#{
nginx_executable
}
-c
#{
config_filename
}
"
)
do
|
stdout
,
stderr
,
stdin
,
pid
|
status
=
POpen4
::
popen4
(
"
#{
nginx_executable
}
-c
#{
config_filename
}
"
)
do
|
stdout
,
stderr
,
stdin
,
pid
|
...
@@ -86,9 +90,9 @@ module BaseTestCase
...
@@ -86,9 +90,9 @@ module BaseTestCase
end
end
def
create_dirs
def
create_dirs
FileUtils
.
mkdir
(
'tmp'
)
unless
File
.
exist?
(
'tmp'
)
and
File
.
directory?
(
'tmp'
)
FileUtils
.
mkdir
(
nginx_tests_tmp_dir
)
unless
File
.
exist?
(
nginx_tests_tmp_dir
)
and
File
.
directory?
(
nginx_tests_tmp_dir
)
FileUtils
.
mkdir
(
'tmp/client_body_temp'
)
unless
File
.
exist?
(
'tmp/client_body_temp'
)
and
File
.
directory?
(
'tmp/client_body_temp'
)
FileUtils
.
mkdir
(
"
#{
nginx_tests_tmp_dir
}
/client_body_temp"
)
unless
File
.
exist?
(
"
#{
nginx_tests_tmp_dir
}
/client_body_temp"
)
and
File
.
directory?
(
"
#{
nginx_tests_tmp_dir
}
/client_body_temp"
)
FileUtils
.
mkdir
(
'tmp/logs'
)
unless
File
.
exist?
(
'tmp/logs'
)
and
File
.
directory?
(
'tmp/logs'
)
FileUtils
.
mkdir
(
"
#{
nginx_tests_tmp_dir
}
/logs"
)
unless
File
.
exist?
(
"
#{
nginx_tests_tmp_dir
}
/logs"
)
and
File
.
directory?
(
"
#{
nginx_tests_tmp_dir
}
/logs"
)
end
end
def
has_passed?
def
has_passed?
...
@@ -96,19 +100,19 @@ module BaseTestCase
...
@@ -96,19 +100,19 @@ module BaseTestCase
end
end
def
config_log_and_pid_file
def
config_log_and_pid_file
@client_body_temp
=
File
.
expand_path
(
"
tmp
/client_body_temp"
)
@client_body_temp
=
File
.
expand_path
(
"
#{
nginx_tests_tmp_dir
}
/client_body_temp"
)
@pid_file
=
File
.
expand_path
(
"
tmp
/logs/nginx.pid"
)
@pid_file
=
File
.
expand_path
(
"
#{
nginx_tests_tmp_dir
}
/logs/nginx.pid"
)
@main_error_log
=
File
.
expand_path
(
"
tmp
/logs/nginx-main_error-
#{
test_method_name
}
.log"
)
@main_error_log
=
File
.
expand_path
(
"
#{
nginx_tests_tmp_dir
}
/logs/nginx-main_error-
#{
test_method_name
}
.log"
)
@access_log
=
File
.
expand_path
(
"
tmp
/logs/nginx-http_access-
#{
test_method_name
}
.log"
)
@access_log
=
File
.
expand_path
(
"
#{
nginx_tests_tmp_dir
}
/logs/nginx-http_access-
#{
test_method_name
}
.log"
)
@error_log
=
File
.
expand_path
(
"
tmp
/logs/nginx-http_error-
#{
test_method_name
}
.log"
)
@error_log
=
File
.
expand_path
(
"
#{
nginx_tests_tmp_dir
}
/logs/nginx-http_error-
#{
test_method_name
}
.log"
)
end
end
def
config_filename
def
config_filename
File
.
expand_path
(
"
tmp
/
#{
@test_config_file
}
"
)
File
.
expand_path
(
"
#{
nginx_tests_tmp_dir
}
/
#{
@test_config_file
}
"
)
end
end
def
mime_types_filename
def
mime_types_filename
File
.
expand_path
(
"
tmp
/mime.types"
)
File
.
expand_path
(
"
#{
nginx_tests_tmp_dir
}
/mime.types"
)
end
end
def
test_method_name
def
test_method_name
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment