@@ -198,6 +198,7 @@ class TEST_TYPES(Enum):
198198 BENCH_COMPONENTS = 4
199199 ACVP = 5
200200 STACK = 6
201+ SIZE = 7
201202
202203 def is_benchmark (self ):
203204 return self in [TEST_TYPES .BENCH , TEST_TYPES .BENCH_COMPONENTS ]
@@ -234,6 +235,8 @@ class TEST_TYPES(Enum):
234235 return "ACVP Test"
235236 if self == TEST_TYPES .STACK :
236237 return "Stack Usage Test"
238+ if self == TEST_TYPES .SIZE :
239+ return "Measurement Code Size"
237240
238241 def make_dir (self ):
239242 return ""
@@ -251,6 +254,8 @@ class TEST_TYPES(Enum):
251254 return "acvp"
252255 if self == TEST_TYPES .STACK :
253256 return "stack"
257+ if self == TEST_TYPES .SIZE :
258+ return "size"
254259
255260 def make_run_target (self , scheme ):
256261 t = self .make_target ()
@@ -604,6 +609,29 @@ class Tests:
604609
605610 self .check_fail ()
606611
612+ def size (self ):
613+
614+ test_type = TEST_TYPES .SIZE
615+
616+ resultss = None
617+
618+ if self .do_opt_all ():
619+ self ._compile_schemes (test_type , False )
620+ if self .args .run :
621+ self ._run_schemes (test_type , False , suppress_output = False )
622+ self ._compile_schemes (test_type , True )
623+ if self .args .run :
624+ resultss = self ._run_schemes (test_type , True , suppress_output = False )
625+ else :
626+ self ._compile_schemes (test_type , self .do_opt ())
627+ if self .args .run :
628+ resultss = self ._run_schemes (
629+ test_type , self .do_opt (), suppress_output = False
630+ )
631+
632+ if resultss is None :
633+ self .check_fail ()
634+
607635 def all (self ):
608636 func = self .args .func
609637 kat = self .args .kat
@@ -926,6 +954,11 @@ def cli():
926954 action = "store_true" ,
927955 default = False ,
928956 )
957+ size_parser = cmd_subparsers .add_parser (
958+ "size" ,
959+ help = "Run the code size measurement for all object file" ,
960+ parents = [common_parser ],
961+ )
929962
930963 # cbmc arguments
931964 cbmc_parser = cmd_subparsers .add_parser (
@@ -1040,6 +1073,8 @@ def cli():
10401073 Tests (args ).kat ()
10411074 elif args .cmd == "stack" :
10421075 Tests (args ).stack ()
1076+ elif args .cmd == "size" :
1077+ Tests (args ).size ()
10431078
10441079
10451080if __name__ == "__main__" :
0 commit comments