diff options
author | Daniel Friesel <derf@finalrewind.org> | 2017-05-22 15:11:39 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2017-05-22 15:11:39 +0200 |
commit | c035e7855da16ec1cbccf9655d1ebf9d632b687c (patch) | |
tree | 77543db8e0c232aba30acb60ec495d13690e3b90 /lib/Kratos/DFADriver/Model.pm | |
parent | 01d09b5e812dca0578e9ae8523c7edc952a53316 (diff) |
support benchmark values via attributes (for int) and slice variables (complex data)
Can be made less of a hack as soon as AC++ supports attributes with arguments
Diffstat (limited to 'lib/Kratos/DFADriver/Model.pm')
-rw-r--r-- | lib/Kratos/DFADriver/Model.pm | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/Kratos/DFADriver/Model.pm b/lib/Kratos/DFADriver/Model.pm index ba3855f..63d4dde 100644 --- a/lib/Kratos/DFADriver/Model.pm +++ b/lib/Kratos/DFADriver/Model.pm @@ -72,6 +72,7 @@ sub new_from_repo { my $class_base = $repo->{class}{$class_name}; for my $function ( values %{ $class_base->{function} } ) { + my %param_values; for my $attrib ( @{ $function->{attributes} // [] } ) { if ( $attrib =~ s{ ^ src _ }{}x ) { push( @states, $attrib ); @@ -92,6 +93,11 @@ sub new_from_repo { elsif ( $attrib =~ m{ ^ epilogue $ }x ) { $transition{ $function->{name} }{level} = 'epilogue'; } + elsif ( $attrib + =~ m{ ^ testarg _ (?<index> [^_]+ ) _ (?<value> [^_]+) $ }x ) + { + push( @{ $param_values{ $+{index} } }, $+{value} ); + } else { say "wat $attrib"; } @@ -104,7 +110,7 @@ sub new_from_repo { @{ $transition{ $function->{name} }{parameters} }, { name => $param_name, - values => [], + values => $param_values{$i}, } ); $self->{parameter}{$param_name} = { @@ -116,6 +122,22 @@ sub new_from_repo { } } + if ( exists $repo->{class}{DriverEvalThread} ) { + for my $var ( keys %{ $repo->{class}{DriverEvalThread}{variable} } ) { + if ( $var + =~ m{ ^ testVal __ (?<fun> [^_]+ ) __ arg (?<index> \d+ ) __ (?<descr> [^_]+ ) $ }x + ) + { + push( + @{ + $transition{ $+{fun} }{parameters}[ $+{index} ]{values} + }, + $var + ); + } + } + } + @states = uniq @states; @states = sort @states; |