From 6100010d6873845413aed22744470616992df603 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 5 Oct 2020 14:04:41 +0200 Subject: Readded should be dead test --- src/args.py | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'src/args.py') diff --git a/src/args.py b/src/args.py index 899ef3f..2cb5749 100644 --- a/src/args.py +++ b/src/args.py @@ -6,27 +6,44 @@ # By: cacharle +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/10/01 10:23:09 by cacharle #+# #+# # -# Updated: 2020/10/01 10:33:00 by cacharle ### ########.fr # +# Updated: 2020/10/05 14:03:42 by cacharle ### ########.fr # # # # ############################################################################ # import argparse +import textwrap import config + def parse_args(): parser = argparse.ArgumentParser( description="Philosophers test", - formatter_class=argparse.RawTextHelpFormatter + formatter_class=argparse.RawTextHelpFormatter, + epilog=textwrap.dedent("""\ + Tested: + - Take 2 forks before eating + - State switch in the correct order + think -> fork -> fork -> eat n times -> sleep + - Almost 0 delay between second fork taken and eat + - Die if the death timeout is expired + - No output after death + - Timestamp in order + - Only take existing fork + - Error message and status != 0 on argument error + (not asked by subject but easy to do and cleanner) + """) ) parser.add_argument( "-p", "--philo", - help="Id of the philosopher program to test \n" - "- 1: philo_one\n" - "- 2: philo_two\n" - "- 3: philo_three\n" - "- 0: all programs\n", + help=textwrap.dedent("""\ + Number of the philosopher program to test + - 1: philo_one + - 2: philo_two + - 3: philo_three + - 0: all programs + """), required=True, type=int, choices=[0, 1, 2, 3] -- cgit