diff --git a/install.sh b/install.sh new file mode 100755 index 0000000000000000000000000000000000000000..86c05c766c27e2aaae7367c9cc82bf1e7ec86d83 --- /dev/null +++ b/install.sh @@ -0,0 +1,28 @@ +#! /bin/bash +# +# Copyright (c) 2022 Huawei Device 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. +# + +sudo cp ohtest /usr/bin/ + +if cat ~/.bashrc | grep "DEVTESTDIR" > /dev/null +then + echo "DEVTESTDIR exist" +fi + +sed -i "/DEVTESTDIR/d" ~/.bashrc + +testdir=$(cd $(dirname $0);pwd) +testparam="export DEVTESTDIR="$testdir +echo $testparam >> ~/.bashrc \ No newline at end of file diff --git a/ohtest b/ohtest new file mode 100755 index 0000000000000000000000000000000000000000..ff869491d2e49148ad9332c1411842fd577496de --- /dev/null +++ b/ohtest @@ -0,0 +1,32 @@ +#!/usr/bin/python +# +# Copyright (c) 2022 Huawei Device 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. +# + +import os +import sys + +print(os.getcwd()) + +if "DEVTESTDIR" in os.environ: + homedir = os.environ["DEVTESTDIR"] + os.chdir(homedir) + print(os.getcwd()) + cmd = "./start.sh" + for index in range (1, len(sys.argv)): + cmd += " " + sys.argv[index] + print(cmd) + os.system(cmd) +else: + print("no DEVTESTDIR!!") \ No newline at end of file diff --git a/src/core/command/display.py b/src/core/command/display.py index 6fbc8326f250bb6d0f8208275672be762cdf8450..5760a8d55f91c2d50fbf6824ff161fea01cdb7e1 100755 --- a/src/core/command/display.py +++ b/src/core/command/display.py @@ -104,8 +104,8 @@ usage: run [-p PRODUCTFORM] [-tc TESTCASE] [-tl TESTLEVEL] [-repeat NUMBER] - [-thl] - [-thr HISCOMMAND-INDEX] + [-hl] + [-rh HISCOMMAND-INDEX] [-retry] optional arguments: @@ -122,10 +122,10 @@ optional arguments: -tc TESTCASE, --testcase TESTCASE Specify test case -tl TESTLEVEL, --testlevel TESTLEVEL - -repeat NUMBER, --repeat NUMBER + --repeat NUMBER -hl, --hisotrylist -rh INDEX, --runhistory INDEX - -retry + --retry Examples: run -t UT @@ -137,14 +137,14 @@ Examples: AAFwkBaseTest.* run -t UT -ss aafwk -tm base_test -ts base_test -tc \ AAFwkBaseTest.object_test_001 - run -t UT -ss aafwk -tm base_test -repeat 3 + run -t UT -ss aafwk -tm base_test --repeat 3 run -t MST ... run -t ALL ... run -hl run -rh 1 - run -retry + run --retry run -t ACTS -ss arkui,ability -ts ActsAceEtsTest;ActsAceEtsStTest;ActsApiTest """ diff --git a/src/core/command/run.py b/src/core/command/run.py index 392281e681cbbf3a76b3239403639841161a6594..bd793ab2a3917c606001b2e14c22e903e5e24c10 100755 --- a/src/core/command/run.py +++ b/src/core/command/run.py @@ -100,7 +100,8 @@ class Run(object): "command": command, "options": options } - if not ("-thl" in options.current_raw_cmd or "-thr" in options.current_raw_cmd): + if not ("-hl" in options.current_raw_cmd or "-rh" in options.current_raw_cmd \ + or "--retry" in options.current_raw_cmd): need_record_history = True #打印历史记录