Moving precommit testing scripts from Makefile[.mk] to tools/runners/run-precommit-check-for-target.sh and tools/precommit.sh; deleting Makefile.mk.
This commit is contained in:
+49
@@ -0,0 +1,49 @@
|
||||
# Copyright 2015 Samsung Electronics Co., Ltd.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
ENGINE_PATH="$1"
|
||||
OUTPUT_PATH="$2"
|
||||
TESTS_PATH="$3"
|
||||
TESTS_OPTS="$4"
|
||||
|
||||
[ -x $ENGINE_PATH ] || exit 1
|
||||
[[ -d $TESTS_PATH || -f $TESTS_PATH ]] || exit 1
|
||||
mkdir -p $OUTPUT_PATH || exit 1
|
||||
|
||||
./tools/runners/run-test-pass.sh $ENGINE_PATH $OUTPUT_PATH $TESTS_PATH $TESTS_OPTS --output-to-log; status_code=$?
|
||||
if [ $status_code -ne 0 ]
|
||||
then
|
||||
echo "$ENGINE_PATH testing failed"
|
||||
echo "See log in $OUTPUT_PATH directory for details."
|
||||
exit $status_code
|
||||
fi
|
||||
|
||||
if [ -d $TESTS_PATH/fail ]
|
||||
then
|
||||
for error_code in `cd $TESTS_PATH/fail && ls -d [0-9]*`
|
||||
do
|
||||
./tools/runners/run-test-xfail.sh $ENGINE_PATH $OUTPUT_PATH $error_code $TESTS_PATH $TESTS_OPTS --output-to-log; status_code=$?
|
||||
|
||||
if [ $status_code -ne 0 ]
|
||||
then
|
||||
echo "$ENGINE_PATH testing failed"
|
||||
echo "See log in $OUTPUT_PATH directory for details."
|
||||
exit $status_code
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -74,15 +74,13 @@ passed=0
|
||||
|
||||
JERRY_TEMP=jerry.tmp
|
||||
|
||||
exec 2>/dev/null
|
||||
|
||||
echo " Passed / Failed / Tested / Total / Percent"
|
||||
|
||||
for test in `cat $JS_FILES`
|
||||
do
|
||||
percent=$(echo $tested*100/$total | bc)
|
||||
|
||||
( ulimit -t $TIMEOUT; $VALGRIND ${ENGINE} ${JERRY_ARGS} ${test} >&$JERRY_TEMP; exit $? );
|
||||
( ulimit -t $TIMEOUT; ${ENGINE} ${JERRY_ARGS} ${test} &>$JERRY_TEMP; exit $? );
|
||||
status_code=$?
|
||||
|
||||
if [ $ECHO_PROGRESS -eq 1 ]
|
||||
@@ -108,7 +106,7 @@ do
|
||||
tested=$((tested+1))
|
||||
done
|
||||
|
||||
rm $JERRY_TEMP
|
||||
rm -f $JERRY_TEMP
|
||||
|
||||
printf "\r\e[2K[ %6d / %6d / %6d / %5d / %3d%% ]\n" ${passed} ${failed} ${tested} ${total} ${percent}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
# Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -82,15 +82,13 @@ passed=0
|
||||
|
||||
JERRY_TEMP=jerry.tmp
|
||||
|
||||
exec 2>/dev/null
|
||||
|
||||
echo " Passed / Failed / Tested / Total / Percent"
|
||||
|
||||
for test in `cat $JS_FILES`
|
||||
do
|
||||
percent=$(echo $tested*100/$total | bc)
|
||||
|
||||
( ulimit -t $TIMEOUT; $VALGRIND ${ENGINE} ${test} ${JERRY_ARGS} >&$JERRY_TEMP; exit $? );
|
||||
( ulimit -t $TIMEOUT; ${ENGINE} ${test} ${JERRY_ARGS} >&$JERRY_TEMP; exit $? );
|
||||
status_code=$?
|
||||
|
||||
if [ $ECHO_PROGRESS -eq 1 ]
|
||||
|
||||
@@ -36,7 +36,7 @@ for unit_test in $UNITTESTS;
|
||||
do
|
||||
[ $OPTION_SILENT = "enable" ] || echo -n "Running $unit_test... ";
|
||||
|
||||
$VALGRIND $unit_test >&$DIR/unit_tests_run.log.tmp;
|
||||
$unit_test >&$DIR/unit_tests_run.log.tmp;
|
||||
status_code=$?
|
||||
cat $DIR/unit_tests_run.log.tmp >> $DIR/unit_tests_run.log
|
||||
rm $DIR/unit_tests_run.log.tmp
|
||||
@@ -49,4 +49,3 @@ do
|
||||
exit 1;
|
||||
fi;
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user