From 9c8382b323c9695e66ea04e3bd5f62db73b688b5 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Mon, 11 Aug 2008 21:39:45 +0000 Subject: [PATCH] Added license headers to php files. Made minor changes to css and autohide js for better look Added build history page --- .../tests/autotester/path_settup.sh.template | 13 ++ utils/tests/autotester/run_unit_tests.php | 13 ++ utils/tests/autotester/run_unit_tests.sh | 13 ++ utils/tests/htdocs/build_history.php | 31 +++++ utils/tests/htdocs/index.php | 13 ++ utils/tests/htdocs/js/autohide.js | 13 +- utils/tests/htdocs/styles/unit_test.css | 12 +- utils/tests/include/Build.php | 120 +++++++++++++++--- utils/tests/include/Config.php | 13 ++ utils/tests/include/DBCreator.php | 13 ++ utils/tests/include/FilenameConverter.php | 22 ++++ utils/tests/include/Footer.php | 13 ++ utils/tests/include/Header.php | 14 ++ utils/tests/include/ParameterValidator.php | 37 ++++++ utils/tests/include/SVNUpdater.php | 13 ++ utils/tests/include/TestError.php | 15 ++- utils/tests/include/TestResult.php | 13 ++ utils/tests/include/TestRunner.php | 13 ++ utils/tests/include/WesnothSmarty.php | 13 ++ .../plugins/modifier.autohide.php | 13 ++ .../templates/build_history.tpl | 2 + .../smarty_workdir/templates/build_list.tpl | 17 +++ .../tests/smarty_workdir/templates/footer.tpl | 11 +- .../tests/smarty_workdir/templates/header.tpl | 26 ++-- .../tests/smarty_workdir/templates/index.tpl | 22 +--- 25 files changed, 446 insertions(+), 52 deletions(-) create mode 100644 utils/tests/htdocs/build_history.php create mode 100644 utils/tests/include/FilenameConverter.php create mode 100644 utils/tests/include/ParameterValidator.php create mode 100644 utils/tests/smarty_workdir/templates/build_history.tpl create mode 100644 utils/tests/smarty_workdir/templates/build_list.tpl diff --git a/utils/tests/autotester/path_settup.sh.template b/utils/tests/autotester/path_settup.sh.template index c25dd6da1f2..bccd5c11aa1 100644 --- a/utils/tests/autotester/path_settup.sh.template +++ b/utils/tests/autotester/path_settup.sh.template @@ -1,4 +1,17 @@ # This file is loaded by all unit test scripts to settup correct worknig paths +#/* +# Copyright (C) 2008 by Pauli Nieminen +# Part of the Battle for Wesnoth Project http://www.wesnoth.org/ +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# or at your option any later version. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY. +# +# See the COPYING file for more details. +#*/ + SVNDIR="/path/to/wesnoth/trunk" WEBDIR="/path/to/tests/htdocs" diff --git a/utils/tests/autotester/run_unit_tests.php b/utils/tests/autotester/run_unit_tests.php index c35261670a1..b705782a5e7 100644 --- a/utils/tests/autotester/run_unit_tests.php +++ b/utils/tests/autotester/run_unit_tests.php @@ -1,4 +1,17 @@ + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + if ($argc != 2) { echo "Wrong number of parameters given"; diff --git a/utils/tests/autotester/run_unit_tests.sh b/utils/tests/autotester/run_unit_tests.sh index b1d190681af..ea255fe61c1 100755 --- a/utils/tests/autotester/run_unit_tests.sh +++ b/utils/tests/autotester/run_unit_tests.sh @@ -1,4 +1,17 @@ #!/bin/bash +#/* +# Copyright (C) 2008 by Pauli Nieminen +# Part of the Battle for Wesnoth Project http://www.wesnoth.org/ +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# or at your option any later version. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY. +# +# See the COPYING file for more details. +#*/ + FULL_PATH=`dirname $(readlink -f $0)` source $FULL_PATH/path_settup.sh diff --git a/utils/tests/htdocs/build_history.php b/utils/tests/htdocs/build_history.php new file mode 100644 index 00000000000..27620d93095 --- /dev/null +++ b/utils/tests/htdocs/build_history.php @@ -0,0 +1,31 @@ + + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ +$root_dir = './'; + +require_once($root_dir . '../include/settup.php'); + +$header = new Header('build_history'); + +$footer = new Footer('build_history'); + +$header->show(); + +$user_params = new ParameterValidator($_GET); + +$smarty->assign(Build::GetVisibleBuilds($user_params)); + +$smarty->display('build_history.tpl'); + +$footer->show(); +?> diff --git a/utils/tests/htdocs/index.php b/utils/tests/htdocs/index.php index 518ceb515d6..4fb7746f9e7 100644 --- a/utils/tests/htdocs/index.php +++ b/utils/tests/htdocs/index.php @@ -1,4 +1,17 @@ + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + $root_dir = './'; require_once($root_dir . '../include/settup.php'); diff --git a/utils/tests/htdocs/js/autohide.js b/utils/tests/htdocs/js/autohide.js index 3f398db2cb3..3e5e46effc9 100644 --- a/utils/tests/htdocs/js/autohide.js +++ b/utils/tests/htdocs/js/autohide.js @@ -79,20 +79,25 @@ Autohide.prototype.make_hide_text = function() split_text = new Array(); for(var index in this.text) { - split_text.push(document.createTextNode(this.text[index])); - split_text.push(document.createElement('BR')); + if (this.text[index].length) + { + split_text.push(document.createTextNode(this.text[index])); + split_text.push(document.createElement('BR')); + } } + if (split_text.length) + split_text.pop(); // Create short text element var new_elem = document.createElement('DIV'); new_elem.id='autohide_' + this.id; new_elem.className="autohide"; // create full text element - var elem_over = new_elem.cloneNode(true); + var elem_over = new_elem.cloneNode(false); elem_over.id='autohide_over_' + this.id; elem_over.onmouseout=autohide_mouseout; elem_over.style.visibility = 'hidden'; - for(var i = 0; i < split_text.length; ++i) + for(var i in split_text) { elem_over.appendChild(split_text[i]); } diff --git a/utils/tests/htdocs/styles/unit_test.css b/utils/tests/htdocs/styles/unit_test.css index 9bf4285f131..e5c0fba66d0 100644 --- a/utils/tests/htdocs/styles/unit_test.css +++ b/utils/tests/htdocs/styles/unit_test.css @@ -30,13 +30,21 @@ td.time { color: #FF0000; } +div.autohide { + border: 1px solid #225599; + padding-left: 0.3em; + padding-right: 0.3em; +} div.autohide_over { position: absolute; background:#FFFBF0 none repeat scroll 0 0; - border: 1px solid #AAAAAA; + border: 1px solid #225599; padding: 0.5em; - max-width: 60em; + padding-left: 1.5em; + padding-right: 1.5em; +/* max-width: 60em;*/ + text-align: left; } table.test_error { diff --git a/utils/tests/include/Build.php b/utils/tests/include/Build.php index 018d1ed8f87..db0c016fd61 100644 --- a/utils/tests/include/Build.php +++ b/utils/tests/include/Build.php @@ -1,4 +1,30 @@ + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + +/* + Copyright (C) 2008 by Pauli Nieminen + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + class Build { private $db; @@ -23,7 +49,7 @@ class Build { $this->binary_name = false; $this->previous_id = -1; $this->result = null; - $this->errors = array(); + $this->errors = null; if ($revision >= 0) $this->fetch("WHERE svn_version=?", array($revision)); } @@ -39,11 +65,43 @@ class Build { } } + private static function multiFetch($where, $params = array()) + { + global $db; + $res = array(); + $id_list = array(); + $result = $db->Execute('SELECT * FROM builds ' . $where ,$params); + if ($result === false) + return $res; + while (!$result->EOF()) + { + $build = new Build(); + $build->init($result->fields); + $id_list[] = $build->getId(); + $res[] = $build; + $result->moveNext(); + } + return $res; + } + public function fetchLast() { $this->fetch('ORDER BY id DESC'); } + private static function fetchVisibleBuilds($page, $builds_per_page) + { + return self::multiFetch('ORDER BY id DESC LIMIT ?,?', + array(($page-1)*$builds_per_page, $builds_per_page)); + } + + private static function getNumberOfVisiblePages($builds_per_page) + { + global $db; + $result = $db->Execute('SELECT COUNT(*) as number FROM builds'); + return ceil($result->fields['number']/$builds_per_page); + } + public function init($values) { foreach($values as $key => $value) @@ -52,7 +110,7 @@ class Build { } $this->time = $this->db->UnixTimeStamp($this->time); $this->result = null; - $this->errors = array(); + $this->errors = null; } public function reset() @@ -113,7 +171,8 @@ class Build { { return false; } - $compiler_log = preg_replace('/^(.*\/)?([^\/]+:[0-9]+:.*)$/m','$2',$compiler_log); + // build/debug/editor2/ + $convert_log = FilenameConverter::stripBuildDirs($convert_log); if (preg_match_all('/^.*(error:|warning:|note:|undefined reference|ld returned \d exit status).*$/mi',$compiler_log, $m,PREG_SET_ORDER)) { @@ -177,12 +236,11 @@ class Build { } } - private function checkChilds() + private function checkResult() { if (is_null($this->result)) { $this->result = new TestResult($this->getLastWorkingId()); - $this->errors = TestError::getErrorsForBuild($this->getLastWorkingId()); } } @@ -196,9 +254,29 @@ class Build { return $ret; } - public function getStatistics() + public static function getVisibleBuilds(ParameterValidator $user_params) { - $this->checkChilds(); + $page = $user_params->getInt('page', 1); + $builds_per_page = 10; // TODO: get from config + if ($page < 0) + $page = 1; + $ret = array(); + $ret['builds'] = array(); + $builds = self::fetchVisibleBuilds($page, $builds_per_page); + foreach($builds as $build) + { + $ret['builds'][] = $build->getBuildStats(); + } + + $ret['page'] = $page; + $ret['number_of_pages'] = self::getNumberOfVisiblePages($builds_per_page); + + return $ret; + } + + private function getBuildStats() + { + $this->checkResult(); $build_result = ''; if ($this->status == self::S_GOOD) @@ -210,15 +288,25 @@ class Build { } $build_result = str_replace("\n"," \\n",$build_result); - return array('build' => array('result' => $build_result, - 'time' => $this->time, - 'style' => ($this->status == self::S_GOOD?"passed":"failed"), - 'result_style' => $this->result->getResult(), - 'error_msg' => $this->error_msg, - 'svn_rev' => $this->svn_version, - 'result_passed' => $this->result->getAssertionsPassed(), - 'result_failed' => $this->result->getAssertionsFailed(), - 'errors' => $this->getErrorStatistics())); + + return array('result' => $build_result, + 'time' => $this->time, + 'style' => ($this->status == self::S_GOOD?"passed":"failed"), + 'id' => $this->id, + 'result_style' => $this->result->getResult(), + 'error_msg' => $this->error_msg, + 'svn_rev' => $this->svn_version, + 'result_passed' => $this->result->getAssertionsPassed(), + 'result_failed' => $this->result->getAssertionsFailed()); + } + + public function getStatistics() + { + if (is_null($this->errors)) + $this->errors = TestError::getErrorsForBuild($this->getLastWorkingId()); + + return array('builds' => array($this->getBuildStats()), + 'errors' => $this->getErrorStatistics()); } } ?> diff --git a/utils/tests/include/Config.php b/utils/tests/include/Config.php index 0ec35df9470..7419cb68a42 100644 --- a/utils/tests/include/Config.php +++ b/utils/tests/include/Config.php @@ -1,4 +1,17 @@ + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + class Config { private $name; diff --git a/utils/tests/include/DBCreator.php b/utils/tests/include/DBCreator.php index 2044cda59e8..24f23fbc111 100644 --- a/utils/tests/include/DBCreator.php +++ b/utils/tests/include/DBCreator.php @@ -1,4 +1,17 @@ + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + class DBForeignKey { private $name; diff --git a/utils/tests/include/FilenameConverter.php b/utils/tests/include/FilenameConverter.php new file mode 100644 index 00000000000..ea92fd625e7 --- /dev/null +++ b/utils/tests/include/FilenameConverter.php @@ -0,0 +1,22 @@ + + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + + +class FilenameConverter { + public static function stripBuildDirs(string $text) + { + return preg_replace('/^(build\/[^\/]*\/)?(.*[^\/]+:[0-9]+:.*)$/m','$2',$text); + } +} +?> diff --git a/utils/tests/include/Footer.php b/utils/tests/include/Footer.php index df6b0c6acaf..23185536e6c 100644 --- a/utils/tests/include/Footer.php +++ b/utils/tests/include/Footer.php @@ -1,4 +1,17 @@ + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + class Footer { diff --git a/utils/tests/include/Header.php b/utils/tests/include/Header.php index 796a99a7227..a90344fe6d1 100644 --- a/utils/tests/include/Header.php +++ b/utils/tests/include/Header.php @@ -1,4 +1,17 @@ + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + class Header { @@ -13,6 +26,7 @@ class Header public function show() { + $this->smarty->assign('extra_title', "| The report site for automated unit tests"); $this->smarty->display('header.tpl'); } } diff --git a/utils/tests/include/ParameterValidator.php b/utils/tests/include/ParameterValidator.php new file mode 100644 index 00000000000..fc2033e5e08 --- /dev/null +++ b/utils/tests/include/ParameterValidator.php @@ -0,0 +1,37 @@ + + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + +// posible class to set default values +//class ParameterLimit { +//} + +class ParameterValidator { + private $user_params; + function __construct(array $user_params) + { + $this->user_params = $user_params; + } + + function getInt($name, $default) + { + if (isset($user_params[$name]) + && is_numeric($user_params[$name])) + { + return (int)$user_params[$name]; + } else { + return $default; + } + } +} +?> diff --git a/utils/tests/include/SVNUpdater.php b/utils/tests/include/SVNUpdater.php index 3eaf2302dd7..154635bf3ee 100644 --- a/utils/tests/include/SVNUpdater.php +++ b/utils/tests/include/SVNUpdater.php @@ -1,4 +1,17 @@ + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + class SVNUpdater { private $revision; diff --git a/utils/tests/include/TestError.php b/utils/tests/include/TestError.php index 0b1c8303130..b518e68b1c2 100644 --- a/utils/tests/include/TestError.php +++ b/utils/tests/include/TestError.php @@ -1,4 +1,17 @@ + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + class TestError { @@ -23,7 +36,7 @@ class TestError { if (!is_null($name)) { $this->error_type = $name; - $this->file = (string)$data->attributes()->file; + $this->file = FilenameConverter::stripBuildDirs((string)$data->attributes()->file); $this->line = (string)$data->attributes()->line; $this->error_msg = (string)$data[0]; $result = $this->db->Execute('SELECT t.id as id, before_id, last_id FROM test_errors t, builds b diff --git a/utils/tests/include/TestResult.php b/utils/tests/include/TestResult.php index 99830f84647..61507400037 100644 --- a/utils/tests/include/TestResult.php +++ b/utils/tests/include/TestResult.php @@ -1,4 +1,17 @@ + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + class TestResult { private $db; private $id; diff --git a/utils/tests/include/TestRunner.php b/utils/tests/include/TestRunner.php index 19bc7aaad57..6fad3c07f1c 100644 --- a/utils/tests/include/TestRunner.php +++ b/utils/tests/include/TestRunner.php @@ -1,4 +1,17 @@ + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + class TestRunner { function __construct() diff --git a/utils/tests/include/WesnothSmarty.php b/utils/tests/include/WesnothSmarty.php index 3b612541a0a..c108c7c9ad3 100644 --- a/utils/tests/include/WesnothSmarty.php +++ b/utils/tests/include/WesnothSmarty.php @@ -1,4 +1,17 @@ + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + global $smarty_dir; require($smarty_dir . 'libs/Smarty.class.php'); diff --git a/utils/tests/smarty_workdir/plugins/modifier.autohide.php b/utils/tests/smarty_workdir/plugins/modifier.autohide.php index ae2c13ab743..0d79292663a 100644 --- a/utils/tests/smarty_workdir/plugins/modifier.autohide.php +++ b/utils/tests/smarty_workdir/plugins/modifier.autohide.php @@ -1,4 +1,17 @@ + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + function smarty_modifier_autohide($text, $min_length_to_hide, $split_from_space, $take_end = false) { diff --git a/utils/tests/smarty_workdir/templates/build_history.tpl b/utils/tests/smarty_workdir/templates/build_history.tpl new file mode 100644 index 00000000000..85c414e2c9f --- /dev/null +++ b/utils/tests/smarty_workdir/templates/build_history.tpl @@ -0,0 +1,2 @@ +

Build history

+{include file='build_list.tpl'} diff --git a/utils/tests/smarty_workdir/templates/build_list.tpl b/utils/tests/smarty_workdir/templates/build_list.tpl new file mode 100644 index 00000000000..3bd8f0b840f --- /dev/null +++ b/utils/tests/smarty_workdir/templates/build_list.tpl @@ -0,0 +1,17 @@ + + + + + + + +{foreach from=$builds item=build} + + + + + + +{/foreach} +
TimeRevisionError messagePassed/Total
{$build.time|date_format:"%H:%M %b %e, %Y"}r{$build.svn_rev}{$build.result|autohide:20:true}{$build.result_passed}/{$build.result_passed+$build.result_failed}
+ diff --git a/utils/tests/smarty_workdir/templates/footer.tpl b/utils/tests/smarty_workdir/templates/footer.tpl index 7d31552a9ea..652d6fe7db7 100644 --- a/utils/tests/smarty_workdir/templates/footer.tpl +++ b/utils/tests/smarty_workdir/templates/footer.tpl @@ -5,8 +5,8 @@ + + + diff --git a/utils/tests/smarty_workdir/templates/header.tpl b/utils/tests/smarty_workdir/templates/header.tpl index 38112167d6b..dede754a4d8 100644 --- a/utils/tests/smarty_workdir/templates/header.tpl +++ b/utils/tests/smarty_workdir/templates/header.tpl @@ -9,13 +9,15 @@ - - - + + + + Battle for Wesnoth {$extra_title} @@ -27,28 +29,28 @@ diff --git a/utils/tests/smarty_workdir/templates/index.tpl b/utils/tests/smarty_workdir/templates/index.tpl index 32c6ad6bfb0..f432088267a 100644 --- a/utils/tests/smarty_workdir/templates/index.tpl +++ b/utils/tests/smarty_workdir/templates/index.tpl @@ -1,28 +1,19 @@

The status from the latest build

- - - - - - - - - - - - -
TimeRevisionError messagePassed/Total
{$build.time|date_format:"%H:%M %b %e, %Y"}r{$build.svn_rev}{$build.result|autohide:20:true}{$build.result_passed}/{$build.result_passed+$build.result_failed}
+{include file='build_list.tpl'}
+{if count($errors) eq 0} +

All unit test passed! Congratulations!

+{else}

Current list of errors in unit tests

- + -{foreach from=$build.errors item=err} +{foreach from=$errors item=err} @@ -31,4 +22,5 @@ {/foreach} +{/if}
TypeBroken in versionFirst broken File Line Message
{$err.error_type} r{$err.start_version} - r{$err.end_version}{$err.error_msg|autohide:40:true}