Skip to content

Commit 98066c2

Browse files
author
Zhen
committed
Added runtests.sh back to simplify running process on linux machines.
Fixed the bug with python v3+ about stdout.write writing bytes type data
1 parent 3548fed commit 98066c2

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

neokit

runtests.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
python ./runtests.py --tests --examples --tck
3131
python ./runtests.py --tests --examples --tck --neorun.start.args="-n 3.1 -p neo4j"
3232
"""
33-
from sys import argv, stdout, exit
33+
from sys import argv, stdout, exit, version_info
3434
from os import name, path
3535
from atexit import register
3636
import subprocess
@@ -61,8 +61,12 @@ def run0(commands):
6161
p = subprocess.Popen(commands, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
6262
out, err = p.communicate()
6363
retcode = p.wait()
64-
stdout.write(out)
65-
stdout.write(err)
64+
if version_info < (3, 0):
65+
stdout.write(out)
66+
stdout.write(err)
67+
else:
68+
stdout.write(out.decode(stdout.encoding))
69+
stdout.write(err.decode(stdout.encoding))
6670
return retcode
6771

6872

runtests.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2002-2016 "Neo Technology,"
4+
# Network Engine for Objects in Lund AB [http://neotechnology.com]
5+
#
6+
# This file is part of Neo4j.
7+
#
8+
# Licensed under the Apache License, Version 2.0 (the "License");
9+
# you may not use this file except in compliance with the License.
10+
# You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
19+
20+
if [ "$1" == "" ]; then
21+
python ./runtests.py --tests --examples --tck
22+
else
23+
#Example: python ./runtests.py --tests --examples --tck --neorun.start.args=”-n 3.1 -p neo4j”
24+
python ./runtests.py --tests --examples --tck --neorun.start.args=\""$1"\"
25+
fi

0 commit comments

Comments
 (0)