Skip to content

Commit 6b79a3a

Browse files
authored
Merge pull request #1205 from mnordsletten/dev
Install script + testrunner log files
2 parents 19fcbf1 + 8c266ee commit 6b79a3a

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export INCLUDEOS_ENABLE_TEST=${INCLUDEOS_ENABLE_TEST-OFF}
1717

1818
# Initialize variables:
1919
install_yes=0
20-
verbose=0
20+
quiet=0
2121
source=0
2222

2323
while getopts "h?yqs" opt; do
@@ -150,7 +150,7 @@ printf " %-25s %-25s %s\n"\
150150

151151
# Give user option to evaluate install options
152152
if tty -s && [ $install_yes -eq 0 ]; then
153-
read -p "Is this correct [Y|n]?" answer
153+
read -p "Is this correct [Y/n]?" answer
154154
answer=${answer:-"Y"} # Default value
155155
case $answer in
156156
[yY] | [yY][Ee][Ss] )

test/testrunner.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(self, path, clean=False, command=['python', 'test.py'], name=None):
6767
self.command_ = command
6868
self.proc_ = None
6969
self.path_ = path
70-
self.output_ = None
70+
self.output_ = []
7171
self.clean = clean
7272
# Extract category and type from the path variable
7373
# Category is linked to the top level folder e.g. net, fs, hw
@@ -133,9 +133,11 @@ def start(self):
133133
if self.clean:
134134
self.clean_test()
135135

136+
logfile_stdout = open('log_stdout.log', 'w')
137+
logfile_stderr = open('log_stderr.log', 'w')
136138
self.proc_ = subprocess.Popen(self.command_, shell=False,
137-
stdout=subprocess.PIPE,
138-
stderr=subprocess.PIPE)
139+
stdout=logfile_stdout,
140+
stderr=logfile_stderr)
139141
os.chdir(startdir)
140142
return self
141143

@@ -158,7 +160,14 @@ def wait_status(self):
158160
self.print_start()
159161

160162
# Start and wait for the process
161-
self.output_ = self.proc_.communicate()
163+
self.proc_.communicate()
164+
165+
with open('{}/log_stdout.log'.format(self.path_), 'r') as log_stdout:
166+
self.output_.append(log_stdout.read())
167+
168+
with open('{}/log_stderr.log'.format(self.path_), 'r') as log_stderr:
169+
self.output_.append(log_stderr.read())
170+
162171

163172
if self.proc_.returncode == 0:
164173
print pretty.PASS_INLINE()

0 commit comments

Comments
 (0)