auto.pl fixes

This commit is contained in:
proller 2016-04-13 17:54:05 +03:00
parent dad1f520df
commit 00bdb3c2fe

View File

@ -175,6 +175,9 @@ our $options = {
enable_particles => 0,
enable_shaders => 0,
},
headless_optimize => {
headless_optimize => 1,
},
software => {
video_driver => 'software',
},
@ -322,8 +325,9 @@ our $commands = {
commands_run($config->{run_task});
},
run_server_simple => sub {
my $fork = $config->{server_bg} ? '&' : '';
sy
qq{$config->{env} $config->{runner} @_ ./freeminerserver $config->{tee} $config->{logdir}/autotest.$g->{task_name}.server.out.log};
qq{$config->{env} $config->{runner} @_ ./freeminerserver $config->{tee} $config->{logdir}/autotest.$g->{task_name}.server.out.log $fork};
},
run_server => sub {
my $fork = $config->{server_bg} ? '&' : '';
@ -375,11 +379,11 @@ our $tasks = {
build_normal => [sub { $g->{build_name} ||= '_normal'; 0 }, 'prepare', 'cmake', 'make',],
build_debug => [sub { $g->{build_name} .= '_debug'; 0 }, {-cmake_debug => 1,}, 'prepare', 'cmake', 'make',],
build_nothreads => [sub { $g->{build_name} .= '_nt'; 0 }, 'prepare', ['cmake', $config->{cmake_nothreads}], 'make',],
build_server => [{-no_build_client => 1,}, 'build_normal',],
build_server_debug => [{-no_build_client => 1,}, 'build_debug',],
build_client => [{-no_build_server => 1,}, 'build_normal',],
build_client_debug => [{-no_build_server => 1,}, 'build_debug',],
bot => [{-no_build_server => 1,}, 'build_normal', 'run_single'],
build_server => [{-no_build_client => 1, -no_build_server => 0,}, 'build_normal',],
build_server_debug => [{-no_build_client => 1, -no_build_server => 0,}, 'build_debug',],
build_client => [{-no_build_client => 0, -no_build_server => 1,}, 'build_normal',],
build_client_debug => [{-no_build_client => 0, -no_build_server => 1,}, 'build_debug',],
bot => [{-no_build_client => 0, -no_build_server => 1,}, 'build_normal', 'run_single'],
#run_single => ['run_single'],
clang => ['prepare', {-cmake_clang => 1,}, 'cmake', 'make',],
build_tsan => [sub { $g->{build_name} .= '_tsan'; 0 }, {-cmake_tsan => 1,}, 'prepare', 'cmake', 'make',],
@ -500,29 +504,28 @@ our $tasks = {
} qw(tsan tsannt asan usan gdb debug)
),
#stress => [{ZZbuild_name => 'normal'}, 'prepare', 'cmake', 'make', 'run_server', 'run_clients',],
stress => sub {
commands_run($_[0] || 'build_normal');
local $config->{server_bg} = 1;
for ('run_server', 'run_clients') { my $r = commands_run($_); return $r if $r; }
return 0;
},
#clients => [{ZZbuild_name => 'normal'}, 'prepare', {-no_build_client => 0, -no_build_server => 1}, 'cmake', 'make', 'run_clients'],
clients_build => [{build_name => '_normal'}, 'prepare', {-no_build_client => 0, -no_build_server => 1}, 'cmake', 'make'],
clients_run => [{build_name => '_normal'}, 'run_clients'],
clients => ['clients_build', 'clients_run'],
stress => ['build_normal', {-server_bg => 1,}, 'run_server', ['sleep', 10], 'clients_run',],
clients_run => [{build_name => '_normal'}, 'run_clients'],
clients => ['build_client', 'clients_run'],
stress_tsan => [
{-no_build_client => 1, -no_build_server => 0, server_bg => 1,}, 'build_tsan', 'cgroup',
{-no_build_client => 1, -no_build_server => 0, -server_bg => 1,}, 'build_tsan', 'cgroup',
'run_server', ['sleep', 10], {build_name => '_normal', -cmake_tsan => 0,}, 'clients',
# todo split build and run:
#{-no_build_client => 1, -no_build_server => 0, -server_bg => 1,}, 'build_tsan', 'cgroup',
#{build_name => '_normal', -cmake_tsan => 0,}, 'build_client',
#{build_name => '_tsan',}, 'run_server',
#{build_name => '_normal',}, ['sleep', 10], 'clients_run',
],
stress_asan => [
{-no_build_client => 1, -no_build_server => 0, server_bg => 1,}, 'build_asan', 'cgroup',
{-no_build_client => 1, -no_build_server => 0, -server_bg => 1,}, 'build_asan', 'cgroup',
'run_server', ['sleep', 10], {build_name => '_normal', -cmake_asan => 0,}, 'clients',
],
stress_massif => [
'clients_build',
'build_client',
sub {
local $config->{run_task} = 'run_server';
commands_run('valgrind_massif');
@ -531,8 +534,6 @@ our $tasks = {
'clients_run',
],
stress => ['build_normal', 'run_server', ['sleep', 5], 'clients_run'],
debug_mapgen => [
#{build_name => 'debug'},
sub {
@ -552,8 +553,8 @@ our $tasks = {
server_gdb => [{-options_add => 'no_exit'}, ['gdb', 'server_debug']],
server_gdb_nd => [{-options_add => 'no_exit'}, 'build_server', ['gdb', 'run_server']],
bot_gdb => ['build_client_debug', ['gdb', 'run_single']],
bot_gdb_nd => ['build_client', ['gdb', 'run_single']],
bot_gdb => ['build_client_debug', ['gdb', 'run_single']],
bot_gdb_nd => ['build_client', ['gdb', 'run_single']],
vtune => sub {
sy 'echo 0|sudo tee /proc/sys/kernel/yama/ptrace_scope';
@ -630,6 +631,11 @@ qq{$config->{vtune_amplifier}amplxe-cl -report $report -report-width=250 -report
chdir $cwd;
return 0;
},
kill => sub {
sy qq{killall freeminer freeminerserver};
return 0;
},
};
sub dmp (@) { say +(join ' ', (caller)[0 .. 5]), ' ', Data::Dumper::Dumper \@_ }
@ -668,13 +674,13 @@ sub options_make(;$$) {
$rmm = {map { $_ => $config->{$_} } grep { $config->{$_} } array(@$mm)};
$m ||= [ map { split /[,;]+/ } map { array($_) }
'default', $config->{options_display}, $config->{options_bot},
$config->{options_int}, $config->{options_add}, 'opt'
$m ||= [
map { split /[,;]+/ } map { array($_) } 'default', $config->{options_display}, $config->{options_bot},
$config->{options_int}, $config->{options_add}, 'opt'
];
for my $name (array(@$m)) {
$rm->{$_} = $options->{$name}{$_} for sort keys %{$options->{$name}};
for my $k (keys %$rm) {
for my $k (sort keys %$rm) {
if ($k =~ /^-/) {
$rmm->{$'} = $rm->{$k};
delete $rm->{$k};
@ -697,7 +703,7 @@ sub command_run(@) {
if ('CODE' eq ref $cmd) {
return $cmd->(@_);
} elsif ('HASH' eq ref $cmd) {
for my $k (keys %$cmd) {
for my $k (sort keys %$cmd) {
if ($k =~ /^-+(.+)/) {
$config->{$1} = $cmd->{$k};
} else {
@ -772,6 +778,9 @@ unless (@ARGV) {
print "$_ " for sort keys %$tasks;
say "\n\n but running default list: ", join ' ', @$task_run;
say '';
say "possible presets in --options_add=... :";
print "$_ " for sort keys %$options;
say '';
sleep 1;
}