]>
git.proxmox.com Git - ceph.git/blob - ceph/src/seastar/test.py
3 # This file is open source software, licensed to you under the terms
4 # of the Apache License, Version 2.0 (the "License"). See the NOTICE file
5 # distributed with this work for additional information regarding copyright
6 # ownership. You may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing,
13 # software distributed under the License is distributed on an
14 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 # KIND, either express or implied. See the License for the
16 # specific language governing permissions and limitations
24 if __name__
== "__main__":
26 parser
= argparse
.ArgumentParser(description
="Seastar test runner")
27 parser
.add_argument('--fast', action
="store_true", help="Run only fast tests")
28 parser
.add_argument('--name', action
="store", help="Run only test whose name contains given string")
29 parser
.add_argument('--mode', choices
=seastar_cmake
.SUPPORTED_MODES
, help="Run only tests for given build mode")
30 parser
.add_argument('--timeout', action
="store",default
="300",type=int, help="timeout value for test execution")
31 parser
.add_argument('--jenkins', action
="store",help="jenkins output file prefix")
32 parser
.add_argument('--verbose', '-v', action
= 'store_true', default
= False,
33 help = 'Verbose reporting')
34 args
= parser
.parse_args()
36 MODES
= [args
.mode
] if args
.mode
else seastar_cmake
.SUPPORTED_MODES
39 BUILD_PATH
= seastar_cmake
.BUILD_PATHS
[mode
]
42 tr
= seastar_cmake
.translate_arg
44 TRANSLATED_CMAKE_ARGS
= [
45 tr(args
.timeout
, 'TEST_TIMEOUT'),
46 tr(args
.fast
, 'EXECUTE_ONLY_FAST_TESTS'),
47 tr(args
.jenkins
, 'JENKINS', value_when_none
=''),
50 # Modify the existing build by pointing to the build directory.
51 CMAKE_ARGS
= ['cmake', BUILD_PATH
] + TRANSLATED_CMAKE_ARGS
53 subprocess
.check_call(CMAKE_ARGS
, shell
=False, cwd
=seastar_cmake
.ROOT_PATH
)
55 TRANSLATED_CTEST_ARGS
= ['-E', 'Seastar.dist']
57 TRANSLATED_CTEST_ARGS
+= ['--verbose']
59 TRANSLATED_CTEST_ARGS
+= ['-R', args
.name
]
61 CTEST_ARGS
= ['ctest', BUILD_PATH
] + TRANSLATED_CTEST_ARGS
63 subprocess
.check_call(CTEST_ARGS
, shell
=False, cwd
=BUILD_PATH
)