Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tails
tails
Commits
4ddbc9da
Commit
4ddbc9da
authored
Sep 15, 2015
by
intrigeri
Browse files
Merge remote-tracking branch 'origin/test/9491-debug-cucumber-formatter' into stable
Fix-committed:
#9491
parents
9d016567
43b65f0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
features/support/helpers/sikuli_helper.rb
View file @
4ddbc9da
...
...
@@ -43,9 +43,11 @@ end
# Bind Java's stdout to debug_log() via our magical pseudo fifo
# logger.
file_output_stream
=
Java
::
Io
::
FileOutputStream
.
new
(
DEBUG_LOG_PSEUDO_FIFO
)
print_stream
=
Java
::
Io
::
PrintStream
.
new
(
file_output_stream
)
Java
::
Lang
::
System
.
setOut
(
print_stream
)
def
bind_java_to_pseudo_fifo_logger
file_output_stream
=
Java
::
Io
::
FileOutputStream
.
new
(
DEBUG_LOG_PSEUDO_FIFO
)
print_stream
=
Java
::
Io
::
PrintStream
.
new
(
file_output_stream
)
Java
::
Lang
::
System
.
setOut
(
print_stream
)
end
def
findfailed_hook
(
pic
)
STDERR
.
puts
""
...
...
features/support/hooks.rb
View file @
4ddbc9da
...
...
@@ -5,6 +5,23 @@ require 'tmpdir'
# Run once, before any feature
AfterConfiguration
do
|
config
|
if
File
.
exist?
(
$config
[
"TMPDIR"
])
if
!
File
.
directory?
(
$config
[
"TMPDIR"
])
raise
"Temporary directory '
#{
$config
[
"TMPDIR"
]
}
' exists but is not a "
+
"directory"
end
if
!
File
.
owned?
(
$config
[
"TMPDIR"
])
raise
"Temporary directory '
#{
$config
[
"TMPDIR"
]
}
' must be owned by the "
+
"current user"
end
FileUtils
.
chmod
(
0755
,
$config
[
"TMPDIR"
])
else
begin
FileUtils
.
mkdir_p
(
$config
[
"TMPDIR"
])
rescue
Errno
::
EACCES
=>
e
raise
"Cannot create temporary directory:
#{
e
.
to_s
}
"
end
end
# Start a thread that monitors a pseudo fifo file and debug_log():s
# anything written to it "immediately" (well, as fast as inotify
# detects it). We're forced to a convoluted solution like this
...
...
@@ -25,6 +42,8 @@ AfterConfiguration do |config|
watcher
.
run
end
end
# Fix Sikuli's debug_log():ing.
bind_java_to_pseudo_fifo_logger
end
# For @product tests
...
...
@@ -50,23 +69,6 @@ def add_after_scenario_hook(&block)
end
BeforeFeature
(
'@product'
)
do
|
feature
|
if
File
.
exist?
(
$config
[
"TMPDIR"
])
if
!
File
.
directory?
(
$config
[
"TMPDIR"
])
raise
"Temporary directory '
#{
$config
[
"TMPDIR"
]
}
' exists but is not a "
+
"directory"
end
if
!
File
.
owned?
(
$config
[
"TMPDIR"
])
raise
"Temporary directory '
#{
$config
[
"TMPDIR"
]
}
' must be owned by the "
+
"current user"
end
FileUtils
.
chmod
(
0755
,
$config
[
"TMPDIR"
])
else
begin
Dir
.
mkdir
(
$config
[
"TMPDIR"
])
rescue
Errno
::
EACCES
=>
e
raise
"Cannot create temporary directory:
#{
e
.
to_s
}
"
end
end
delete_all_snapshots
if
!
KEEP_SNAPSHOTS
if
TAILS_ISO
.
nil?
raise
"No Tails ISO image specified, and none could be found in the "
+
...
...
intrigeri
@intrigeri
mentioned in issue
#9491 (closed)
·
May 14, 2020
mentioned in issue
#9491 (closed)
mentioned in issue #9491
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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