mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 18:47:21 +08:00
delete unused cmake/test
This commit is contained in:
@@ -1,52 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
"""
|
|
||||||
The module facilitates testing in cmake.
|
|
||||||
It takes a command and a regex for failure ok passing.
|
|
||||||
It passes if:
|
|
||||||
* No stderr output.
|
|
||||||
* Stdout doesn't match failure regex.
|
|
||||||
* Stdout matches ok regex if given.
|
|
||||||
"""
|
|
||||||
from __future__ import print_function
|
|
||||||
import argparse
|
|
||||||
import subprocess
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
#pylint: disable=invalid-name
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
|
|
||||||
parser.add_argument('cmd')
|
|
||||||
parser.add_argument('--re-fail')
|
|
||||||
parser.add_argument('--re-ok')
|
|
||||||
parser.add_argument('--verbose', '-v', dest='verbose', action='store_true')
|
|
||||||
|
|
||||||
parser.set_defaults(verbose=False)
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
proc = subprocess.Popen(args.cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
||||||
stdout, stderr = proc.communicate()
|
|
||||||
|
|
||||||
if stderr != "":
|
|
||||||
print(stderr)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if args.re_fail is not None:
|
|
||||||
fail_match = re.search(args.re_fail, stdout)
|
|
||||||
if fail_match is not None:
|
|
||||||
print(stdout)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if args.re_ok is not None:
|
|
||||||
ok_match = re.search(args.re_ok, stdout)
|
|
||||||
if re.match(args.re_ok, stdout) is None:
|
|
||||||
print(stdout)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if args.verbose:
|
|
||||||
print(stdout)
|
|
||||||
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
# vim: set et ft=python fenc=utf-8 ff=unix sts=4 sw=4 ts=4 :
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
INFO Shell id is 47996278451456
|
|
||||||
WARN 1 starting task wkr_high (file /home/jgoppert/git/px4/cmake-Firmware/src/platforms/posix/px4_layer/px4_posix_tasks.cpp line 146)
|
|
||||||
WARN 54 starting task wkr_low (file /home/jgoppert/git/px4/cmake-Firmware/src/platforms/posix/px4_layer/px4_posix_tasks.cpp line 146)
|
|
||||||
WARN 100 starting task wkr_hrt (file /home/jgoppert/git/px4/cmake-Firmware/src/platforms/posix/px4_layer/px4_posix_tasks.cpp line 146)
|
|
||||||
App name: px4
|
|
||||||
Enter a command and its args:
|
|
||||||
----------------------------------
|
|
||||||
Running: uorb
|
|
||||||
Returning: uorb
|
|
||||||
Enter a command and its args:
|
|
||||||
----------------------------------
|
|
||||||
Running: accelsim
|
|
||||||
Returning: accelsim
|
|
||||||
Enter a command and its args:
|
|
||||||
----------------------------------
|
|
||||||
Running: px4_simple_app
|
|
||||||
Hello Sky!
|
|
||||||
[px4_simple_app] Got no data within a second
|
|
||||||
[px4_simple_app] Got no data within a second
|
|
||||||
[px4_simple_app] Got no data within a second
|
|
||||||
[px4_simple_app] Got no data within a second
|
|
||||||
[px4_simple_app] Got no data within a second
|
|
||||||
Returning: px4_simple_app
|
|
||||||
Enter a command and its args:
|
|
||||||
----------------------------------
|
|
||||||
Running: shutdown
|
|
||||||
Shutting down
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
uorb start
|
|
||||||
accelsim start
|
|
||||||
px4_simple_app
|
|
||||||
shutdown
|
|
||||||
Reference in New Issue
Block a user