File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Modified version of port wrapper that supports sending a
4
+ # string to the wrapper program's stdin
5
+
6
+ # Run the program in the background, sending
7
+ # $ZOMBIE_KILLER_INPUT as stdin
8
+ echo -e " $ZOMBIE_KILLER_INPUT " | exec " $@ " &
9
+ program_pid=$!
10
+
11
+ # Silence warnings from here on
12
+ exec > /dev/null 2>&1
13
+
14
+ # Read from stdin in the background and kill process
15
+ # when stdin closes
16
+ (
17
+ while read ; do : ; done
18
+ kill -KILL $program_pid
19
+ ) < & 0 &
20
+ stdin_monitor_pid=$!
21
+
22
+ # Clean up
23
+ wait $program_pid
24
+ ret=$?
25
+ kill -KILL $stdin_monitor_pid
26
+ exit $ret
Original file line number Diff line number Diff line change @@ -61,8 +61,9 @@ defmodule Mneme.Integration do
61
61
File . write! ( file_path , test . test_code )
62
62
63
63
test_command = """
64
- echo "#{ test . test_input } " | \
65
- CI=false mix test #{ file_path } --seed 0 \
64
+ ZOMBIE_KILLER_INPUT=#{ inspect ( test . test_input ) } \
65
+ CI=false \
66
+ #{ zombie_killer ( ) } mix test #{ file_path } --seed 0 \
66
67
"""
67
68
68
69
test_command =
@@ -108,6 +109,10 @@ defmodule Mneme.Integration do
108
109
end
109
110
end
110
111
112
+ defp zombie_killer do
113
+ :mneme |> :code . priv_dir ( ) |> Path . join ( "zombie_killer" )
114
+ end
115
+
111
116
defp debug_setup ( nil , _ ) , do: :ok
112
117
113
118
defp debug_setup ( "" , test ) do
You can’t perform that action at this time.
0 commit comments