[Debugger] Create a simplified transmission layer (#2781)
It supports the raw packet sending over a TCP/IP protocol JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
+15
-13
@@ -326,21 +326,23 @@ def run_jerry_debugger_tests(options):
|
||||
if ret_build:
|
||||
break
|
||||
|
||||
for test_file in os.listdir(settings.DEBUGGER_TESTS_DIR):
|
||||
if test_file.endswith(".cmd"):
|
||||
test_case, _ = os.path.splitext(test_file)
|
||||
test_case_path = os.path.join(settings.DEBUGGER_TESTS_DIR, test_case)
|
||||
test_cmd = [
|
||||
settings.DEBUGGER_TEST_RUNNER_SCRIPT,
|
||||
get_binary_path(build_dir_path),
|
||||
settings.DEBUGGER_CLIENT_SCRIPT,
|
||||
os.path.relpath(test_case_path, settings.PROJECT_DIR)
|
||||
]
|
||||
for channel in ["websocket", "rawpacket"]:
|
||||
for test_file in os.listdir(settings.DEBUGGER_TESTS_DIR):
|
||||
if test_file.endswith(".cmd"):
|
||||
test_case, _ = os.path.splitext(test_file)
|
||||
test_case_path = os.path.join(settings.DEBUGGER_TESTS_DIR, test_case)
|
||||
test_cmd = [
|
||||
settings.DEBUGGER_TEST_RUNNER_SCRIPT,
|
||||
get_binary_path(build_dir_path),
|
||||
channel,
|
||||
settings.DEBUGGER_CLIENT_SCRIPT,
|
||||
os.path.relpath(test_case_path, settings.PROJECT_DIR)
|
||||
]
|
||||
|
||||
if job.test_args:
|
||||
test_cmd.extend(job.test_args)
|
||||
if job.test_args:
|
||||
test_cmd.extend(job.test_args)
|
||||
|
||||
ret_test |= run_check(test_cmd)
|
||||
ret_test |= run_check(test_cmd)
|
||||
|
||||
return ret_build | ret_test
|
||||
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
# limitations under the License.
|
||||
|
||||
JERRY=$1
|
||||
DEBUGGER_CLIENT=$2
|
||||
TEST_CASE=$3
|
||||
CHANNEL=$2
|
||||
DEBUGGER_CLIENT=$3
|
||||
TEST_CASE=$4
|
||||
CLIENT_ARGS=""
|
||||
|
||||
TERM_NORMAL='\033[0m'
|
||||
@@ -24,14 +25,14 @@ TERM_RED='\033[1;31m'
|
||||
TERM_GREEN='\033[1;32m'
|
||||
|
||||
if [[ $TEST_CASE == *"client_source"* ]]; then
|
||||
START_DEBUG_SERVER="${JERRY} --start-debug-server --debugger-wait-source &"
|
||||
START_DEBUG_SERVER="${JERRY} --start-debug-server --debug-channel ${CHANNEL} --debugger-wait-source &"
|
||||
if [[ $TEST_CASE == *"client_source_multiple"* ]]; then
|
||||
CLIENT_ARGS="--client-source ${TEST_CASE}_2.js ${TEST_CASE}_1.js"
|
||||
else
|
||||
CLIENT_ARGS="--client-source ${TEST_CASE}.js"
|
||||
fi
|
||||
else
|
||||
START_DEBUG_SERVER="${JERRY} ${TEST_CASE}.js --start-debug-server &"
|
||||
START_DEBUG_SERVER="${JERRY} ${TEST_CASE}.js --start-debug-server --debug-channel ${CHANNEL} &"
|
||||
fi
|
||||
|
||||
echo "$START_DEBUG_SERVER"
|
||||
@@ -40,11 +41,11 @@ sleep 1s
|
||||
|
||||
RESULT_TEMP=`mktemp ${TEST_CASE}.out.XXXXXXXXXX`
|
||||
|
||||
(cat "${TEST_CASE}.cmd" | ${DEBUGGER_CLIENT} --non-interactive ${CLIENT_ARGS}) >${RESULT_TEMP} 2>&1
|
||||
(cat "${TEST_CASE}.cmd" | ${DEBUGGER_CLIENT} --channel ${CHANNEL} --non-interactive ${CLIENT_ARGS}) >${RESULT_TEMP} 2>&1
|
||||
|
||||
if [[ $TEST_CASE == *"restart"* ]]; then
|
||||
CONTINUE_CASE=$(sed "s/restart/continue/g" <<< "$TEST_CASE")
|
||||
(cat "${CONTINUE_CASE}.cmd" | ${DEBUGGER_CLIENT} --non-interactive ${CLIENT_ARGS}) >>${RESULT_TEMP} 2>&1
|
||||
(cat "${CONTINUE_CASE}.cmd" | ${DEBUGGER_CLIENT} --channel ${CHANNEL} --non-interactive ${CLIENT_ARGS}) >>${RESULT_TEMP} 2>&1
|
||||
fi
|
||||
|
||||
diff -U0 ${TEST_CASE}.expected ${RESULT_TEMP}
|
||||
|
||||
Reference in New Issue
Block a user