Skip to content

Commit

Permalink
check another method to fail the test Try #3
Browse files Browse the repository at this point in the history
  • Loading branch information
BazookaJoe1900 committed Feb 22, 2020
1 parent 250e467 commit 1b05dac
Showing 1 changed file with 46 additions and 45 deletions.
91 changes: 46 additions & 45 deletions Tools/HIL/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,50 +74,51 @@ def do_test(port, baudrate, test_name):

return success

def main():
parser = ArgumentParser(description=__doc__)
parser.add_argument('--device', "-d", nargs='?', default = None, help='')
parser.add_argument("--baudrate", "-b", dest="baudrate", type=int, help="Mavlink port baud rate (default=57600)", default=57600)
args = parser.parse_args()
success = True

success = success and do_test(args.device, args.baudrate, "autodeclination")
success = success and do_test(args.device, args.baudrate, "bezier")
success = success and do_test(args.device, args.baudrate, "bson")
success = success and do_test(args.device, args.baudrate, "commander")
success = success and do_test(args.device, args.baudrate, "controllib")
success = success and do_test(args.device, args.baudrate, "conv")
#success = success and do_test(args.device, args.baudrate, "dataman")
success = success and do_test(args.device, args.baudrate, "float")
success = success and do_test(args.device, args.baudrate, "hrt")
success = success and do_test(args.device, args.baudrate, "int")
success = success and do_test(args.device, args.baudrate, "IntrusiveQueue")
success = success and do_test(args.device, args.baudrate, "List")
success = success and do_test(args.device, args.baudrate, "mathlib")
success = success and do_test(args.device, args.baudrate, "matrix")
success = success and do_test(args.device, args.baudrate, "microbench_hrt")
success = success and do_test(args.device, args.baudrate, "microbench_math")
success = success and do_test(args.device, args.baudrate, "microbench_matrix")
success = success and do_test(args.device, args.baudrate, "microbench_uorb")
#success = success and do_test(args.device, args.baudrate, "mixer")
success = success and do_test(args.device, args.baudrate, "param")
success = success and do_test(args.device, args.baudrate, "parameters")
success = success and do_test(args.device, args.baudrate, "perf")
success = success and do_test(args.device, args.baudrate, "search_min")
success = success and do_test(args.device, args.baudrate, "sleep")
success = success and do_test(args.device, args.baudrate, "smoothz")
success = success and do_test(args.device, args.baudrate, "time")
success = success and do_test(args.device, args.baudrate, "uorb")
success = success and do_test(args.device, args.baudrate, "versioning")

if success:
print("all run_test.py passed");
else:
print("some run_test.py Tests failed"); #TODO: show which test pass or failed

assertFalse(success)

return success
class TestHadrwareMethods(unittest.TestCase):
def test_hardware(self):
parser = ArgumentParser(description=__doc__)
parser.add_argument('--device', "-d", nargs='?', default = None, help='')
parser.add_argument("--baudrate", "-b", dest="baudrate", type=int, help="Mavlink port baud rate (default=57600)", default=57600)
args = parser.parse_args()
success = True

success = success and do_test(args.device, args.baudrate, "autodeclination")
success = success and do_test(args.device, args.baudrate, "bezier")
success = success and do_test(args.device, args.baudrate, "bson")
success = success and do_test(args.device, args.baudrate, "commander")
success = success and do_test(args.device, args.baudrate, "controllib")
success = success and do_test(args.device, args.baudrate, "conv")
#success = success and do_test(args.device, args.baudrate, "dataman")
success = success and do_test(args.device, args.baudrate, "float")
success = success and do_test(args.device, args.baudrate, "hrt")
success = success and do_test(args.device, args.baudrate, "int")
success = success and do_test(args.device, args.baudrate, "IntrusiveQueue")
success = success and do_test(args.device, args.baudrate, "List")
success = success and do_test(args.device, args.baudrate, "mathlib")
success = success and do_test(args.device, args.baudrate, "matrix")
success = success and do_test(args.device, args.baudrate, "microbench_hrt")
success = success and do_test(args.device, args.baudrate, "microbench_math")
success = success and do_test(args.device, args.baudrate, "microbench_matrix")
success = success and do_test(args.device, args.baudrate, "microbench_uorb")
#success = success and do_test(args.device, args.baudrate, "mixer")
success = success and do_test(args.device, args.baudrate, "param")
success = success and do_test(args.device, args.baudrate, "parameters")
success = success and do_test(args.device, args.baudrate, "perf")
success = success and do_test(args.device, args.baudrate, "search_min")
success = success and do_test(args.device, args.baudrate, "sleep")
success = success and do_test(args.device, args.baudrate, "smoothz")
success = success and do_test(args.device, args.baudrate, "time")
success = success and do_test(args.device, args.baudrate, "uorb")
success = success and do_test(args.device, args.baudrate, "versioning")

if success:
print("all run_test.py passed");
else:
print("some run_test.py Tests failed"); #TODO: show which test pass or failed

assertTrue(success)

return success

if __name__ == "__main__":
main()
unittest.main()

0 comments on commit 1b05dac

Please sign in to comment.