1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

Update kyua-cli to 0.9:

Experimental version released on August 8th, 2014.

Major changes:

The internal architecture of Kyua to record the results of test suite
runs has completely changed in this release.  Kyua no longer stores all
the different test suite run results as different "actions" within the
single store.db database.  Instead, Kyua now generates a separate
results file inside ~/.kyua/store/ for every test suite run.

Due to the complexity involved in the migration process and the little
need for it, this is probably going to be the only release where the
'db-migrate' command is able to convert an old store.db file to the
new scheme.

Changes in more detail:

* Added the 'report-junit' command to generate JUnit XML result files.
  The output has been verified to work within Jenkins.

* Switched to results files specific to their corresponding test suite
  run.  The unified store.db file is now gone: 'kyua test' creates a
  new results file for every invocation under ~/.kyua/store/ and the
  'kyua report*' commands are able to locate the latest file for a
  corresponding test suite automatically.

* The 'db-migrate' command takes an old store.db file and generates one
  results file for every previously-recorded action, later deleting the
  store.db file.

* The '--action' flag has been removed from all commands that accepted
  it.  This has been superseded by the tests results files.

* The '--store' flag that many commands took has been renamed to
  '--results-file' in line with the semantical changes.

* The 'db-exec' command no longer creates an empty database when none
  is found.  This command is now intended to run only over existing
  files.

Reviewed by:	bdrewery (D567)
Approved by:	bdrewery (ports)
This commit is contained in:
Julio Merino 2014-08-14 15:00:54 +00:00
parent 1b8383012b
commit 2e6a4b588e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=364849
8 changed files with 27 additions and 266 deletions

View File

@ -2,18 +2,17 @@
# $FreeBSD$
PORTNAME= kyua-cli
PORTVERSION= 0.8
PORTREVISION= 3
PORTVERSION= 0.9
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE}
PROJECTHOST= kyua
MASTER_SITES= https://github.com/jmmv/kyua/releases/download/${PORTNAME}-${PORTVERSION}/ \
LOCAL/jmmv
MAINTAINER= jmmv@FreeBSD.org
COMMENT= Kyua (automated testing framework) - Command line interface
LICENSE= BSD
LICENSE= BSD3CLAUSE
LIB_DEPENDS= liblutok.so.3:${PORTSDIR}/devel/lutok
LIB_DEPENDS= liblutok.so:${PORTSDIR}/devel/lutok
LIB_DEPENDS+= libsqlite3.so:${PORTSDIR}/databases/sqlite3
BUILD_DEPENDS= kyua-testers>=0.2:${PORTSDIR}/devel/kyua-testers
RUN_DEPENDS:= ${BUILD_DEPENDS}

View File

@ -1,2 +1,2 @@
SHA256 (kyua-cli-0.8.tar.gz) = 28f90929e4b73959bdd08a1d3f5ce7e77e0e4fc9978d10b1b079160428d770b3
SIZE (kyua-cli-0.8.tar.gz) = 496577
SHA256 (kyua-cli-0.9.tar.gz) = 9c8c27904a8f851fe0c287c2789b4d4f504d44edf3f71b01b5f76158d6037f10
SIZE (kyua-cli-0.9.tar.gz) = 516505

View File

@ -1,88 +0,0 @@
--- utils/config/nodes.cpp.old
+++ utils/config/nodes.cpp
@@ -112,11 +112,11 @@ config::detail::inner_node::lookup_ro(const tree_key& key,
return (*child_iter).second;
} else {
PRE(key_pos < key.size() - 1);
- try {
- const inner_node& child = dynamic_cast< const inner_node& >(
- *(*child_iter).second);
- return child.lookup_ro(key, key_pos + 1);
- } catch (const std::bad_cast& e) {
+ const inner_node* child = dynamic_cast< const inner_node* >(
+ (*child_iter).second);
+ if (child != NULL) {
+ return child->lookup_ro(key, key_pos + 1);
+ } else {
throw unknown_key_error(
key, "Cannot address incomplete configuration property '%s'");
}
@@ -163,21 +163,19 @@ config::detail::inner_node::lookup_rw(const tree_key& key,
}
if (key_pos == key.size() - 1) {
- try {
- leaf_node& child = dynamic_cast< leaf_node& >(
- *(*child_iter).second);
- return &child;
- } catch (const std::bad_cast& unused_error) {
+ leaf_node* child = dynamic_cast< leaf_node* >((*child_iter).second);
+ if (child != NULL) {
+ return child;
+ } else {
throw value_error(F("Invalid value for key '%s'") %
flatten_key(key));
}
} else {
PRE(key_pos < key.size() - 1);
- try {
- inner_node& child = dynamic_cast< inner_node& >(
- *(*child_iter).second);
- return child.lookup_rw(key, key_pos + 1, new_node);
- } catch (const std::bad_cast& e) {
+ inner_node* child = dynamic_cast< inner_node* >((*child_iter).second);
+ if (child != NULL) {
+ return child->lookup_rw(key, key_pos + 1, new_node);
+ } else {
throw unknown_key_error(
key, "Cannot address incomplete configuration property '%s'");
}
@@ -198,13 +196,14 @@ config::detail::inner_node::all_properties(properties_map& properties,
iter != _children.end(); ++iter) {
tree_key child_key = key;
child_key.push_back((*iter).first);
- try {
- leaf_node& child = dynamic_cast< leaf_node& >(*(*iter).second);
- if (child.is_set())
- properties[flatten_key(child_key)] = child.to_string();
- } catch (const std::bad_cast& unused_error) {
- inner_node& child = dynamic_cast< inner_node& >(*(*iter).second);
- child.all_properties(properties, child_key);
+ leaf_node* child = dynamic_cast< leaf_node* >((*iter).second);
+ if (child != NULL) {
+ if (child->is_set())
+ properties[flatten_key(child_key)] = child->to_string();
+ } else {
+ inner_node* child2 = dynamic_cast< inner_node* >((*iter).second);
+ INV(child2 != NULL);
+ child2->all_properties(properties, child_key);
}
}
}
@@ -261,11 +260,11 @@ config::detail::static_inner_node::define(const tree_key& key,
_children.insert(children_map::value_type(key[key_pos], child_ptr));
child_ptr->define(key, key_pos + 1, new_node);
} else {
- try {
- static_inner_node& child = dynamic_cast< static_inner_node& >(
- *(*child_iter).second);
- child.define(key, key_pos + 1, new_node);
- } catch (const std::bad_cast& e) {
+ static_inner_node* child = dynamic_cast< static_inner_node* >(
+ (*child_iter).second);
+ if (child != NULL) {
+ child->define(key, key_pos + 1, new_node);
+ } else {
UNREACHABLE;
}
}

View File

@ -1,10 +0,0 @@
--- utils/config/nodes.ipp.orig 2013-03-28 12:56:35.697127706 -0600
+++ utils/config/nodes.ipp 2013-03-28 12:56:49.139128561 -0600
@@ -39,6 +39,7 @@
#include "utils/format/macros.hpp"
#include "utils/optional.ipp"
#include "utils/text/exceptions.hpp"
+#include "utils/units.hpp"
#include "utils/text/operations.ipp"
#include "utils/sanity.hpp"

View File

@ -1,95 +0,0 @@
--- utils/config/tree.cpp.old
+++ utils/config/tree.cpp
@@ -109,11 +109,10 @@ config::tree::is_set(const std::string& dotted_key) const
const detail::tree_key key = detail::parse_key(dotted_key);
try {
const detail::base_node* raw_node = _root->lookup_ro(key, 0);
- try {
- const leaf_node& child = dynamic_cast< const leaf_node& >(
- *raw_node);
- return child.is_set();
- } catch (const std::bad_cast& unused_error) {
+ const leaf_node* child = dynamic_cast< const leaf_node* >(raw_node);
+ if (child != NULL) {
+ return child->is_set();
+ } else {
return false;
}
} catch (const unknown_key_error& unused_error) {
@@ -134,10 +133,10 @@ config::tree::push_lua(const std::string& dotted_key, lutok::state& state) const
{
const detail::tree_key key = detail::parse_key(dotted_key);
const detail::base_node* raw_node = _root->lookup_ro(key, 0);
- try {
- const leaf_node& child = dynamic_cast< const leaf_node& >(*raw_node);
- child.push_lua(state);
- } catch (const std::bad_cast& unused_error) {
+ const leaf_node* child = dynamic_cast< const leaf_node* >(raw_node);
+ if (child != NULL) {
+ child->push_lua(state);
+ } else {
throw unknown_key_error(key);
}
}
@@ -159,10 +158,10 @@ config::tree::set_lua(const std::string& dotted_key, lutok::state& state,
const detail::tree_key key = detail::parse_key(dotted_key);
detail::base_node* raw_node = _root->lookup_rw(
key, 0, detail::new_node< string_node >);
- try {
- leaf_node& child = dynamic_cast< leaf_node& >(*raw_node);
- child.set_lua(state, value_index);
- } catch (const std::bad_cast& unused_error) {
+ leaf_node* child = dynamic_cast< leaf_node* >(raw_node);
+ if (child != NULL) {
+ child->set_lua(state, value_index);
+ } else {
throw value_error(F("Invalid value for key '%s'") %
detail::flatten_key(key));
}
@@ -182,10 +181,10 @@ config::tree::lookup_string(const std::string& dotted_key) const
{
const detail::tree_key key = detail::parse_key(dotted_key);
const detail::base_node* raw_node = _root->lookup_ro(key, 0);
- try {
- const leaf_node& child = dynamic_cast< const leaf_node& >(*raw_node);
- return child.to_string();
- } catch (const std::bad_cast& unused_error) {
+ const leaf_node* child = dynamic_cast< const leaf_node* >(raw_node);
+ if (child != NULL) {
+ return child->to_string();
+ } else {
throw unknown_key_error(key);
}
}
@@ -210,10 +209,10 @@ config::tree::set_string(const std::string& dotted_key,
const detail::tree_key key = detail::parse_key(dotted_key);
detail::base_node* raw_node = _root->lookup_rw(
key, 0, detail::new_node< string_node >);
- try {
- leaf_node& child = dynamic_cast< leaf_node& >(*raw_node);
- child.set_string(raw_value);
- } catch (const std::bad_cast& unused_error) {
+ leaf_node* child = dynamic_cast< leaf_node* >(raw_node);
+ if (child != NULL) {
+ child->set_string(raw_value);
+ } else {
throw value_error(F("Invalid value for key '%s'") %
detail::flatten_key(key));
}
@@ -247,11 +246,11 @@ config::tree::all_properties(const std::string& dotted_key,
key = detail::parse_key(dotted_key);
raw_node = _root->lookup_ro(key, 0);
}
- try {
- const detail::inner_node& child =
- dynamic_cast< const detail::inner_node& >(*raw_node);
- child.all_properties(properties, key);
- } catch (const std::bad_cast& unused_error) {
+ const detail::inner_node* child =
+ dynamic_cast< const detail::inner_node* >(raw_node);
+ if (child != NULL) {
+ child->all_properties(properties, key);
+ } else {
INV(!dotted_key.empty());
throw value_error(F("Cannot export properties from a leaf node; "
"'%s' given") % dotted_key);

View File

@ -1,55 +0,0 @@
--- utils/config/tree.ipp.old
+++ utils/config/tree.ipp
@@ -79,13 +79,13 @@ config::tree::lookup(const std::string& dotted_key) const
{
const detail::tree_key key = detail::parse_key(dotted_key);
const detail::base_node* raw_node = _root->lookup_ro(key, 0);
- try {
- const LeafType& child = dynamic_cast< const LeafType& >(*raw_node);
- if (child.is_set())
- return child.value();
+ const LeafType* child = dynamic_cast< const LeafType* >(raw_node);
+ if (child != NULL) {
+ if (child->is_set())
+ return child->value();
else
throw unknown_key_error(key);
- } catch (const std::bad_cast& unused_error) {
+ } else {
throw unknown_key_error(key);
}
}
@@ -107,13 +107,13 @@ config::tree::lookup_rw(const std::string& dotted_key)
const detail::tree_key key = detail::parse_key(dotted_key);
detail::base_node* raw_node = _root->lookup_rw(
key, 0, detail::new_node< LeafType >);
- try {
- LeafType& child = dynamic_cast< LeafType& >(*raw_node);
- if (child.is_set())
- return child.value();
+ LeafType* child = dynamic_cast< LeafType* >(raw_node);
+ if (child != NULL) {
+ if (child->is_set())
+ return child->value();
else
throw unknown_key_error(key);
- } catch (const std::bad_cast& unused_error) {
+ } else {
throw unknown_key_error(key);
}
}
@@ -136,10 +136,10 @@ config::tree::set(const std::string& dotted_key,
const detail::tree_key key = detail::parse_key(dotted_key);
leaf_node* raw_node = _root->lookup_rw(key, 0,
detail::new_node< LeafType >);
- try {
- LeafType& child = dynamic_cast< LeafType& >(*raw_node);
- child.set(value);
- } catch (const std::bad_cast& unused_error) {
+ LeafType* child = dynamic_cast< LeafType* >(raw_node);
+ if (child != NULL) {
+ child->set(value);
+ } else {
throw value_error(F("Invalid value for key '%s'") %
detail::flatten_key(key));
}

View File

@ -12,4 +12,4 @@ implementation of test cases in a variety of programming languages.
In effect, Kyua is intended to be a replacement for ATF.
WWW: https://code.google.com/p/kyua/
WWW: https://github.com/jmmv/kyua/

View File

@ -8,19 +8,22 @@ man/man1/kyua-debug.1.gz
man/man1/kyua-help.1.gz
man/man1/kyua-list.1.gz
man/man1/kyua-report-html.1.gz
man/man1/kyua-report-junit.1.gz
man/man1/kyua-report.1.gz
man/man1/kyua-test.1.gz
man/man1/kyua.1.gz
man/man5/kyua.conf.5.gz
man/man5/kyuafile.5.gz
man/man7/kyua-build-root.7.gz
man/man7/kyua-results-files.7.gz
man/man7/kyua-test-filters.7.gz
%%DATADIR%%/misc/context.html
%%DATADIR%%/misc/index.html
%%DATADIR%%/misc/report.css
%%DATADIR%%/misc/test_result.html
%%DATADIR%%/store/migrate_v1_v2.sql
%%DATADIR%%/store/schema_v2.sql
%%DATADIR%%/store/migrate_v2_v3.sql
%%DATADIR%%/store/schema_v3.sql
%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
%%PORTDOCS%%%%DOCSDIR%%/COPYING
%%PORTDOCS%%%%DOCSDIR%%/NEWS
@ -39,30 +42,25 @@ man/man7/kyua-test-filters.7.gz
%%TEST%%tests/kyua-cli/cli/cmd_about_test
%%TEST%%tests/kyua-cli/cli/cmd_config_test
%%TEST%%tests/kyua-cli/cli/cmd_db_exec_test
%%TEST%%tests/kyua-cli/cli/cmd_db_migrate_test
%%TEST%%tests/kyua-cli/cli/cmd_debug_test
%%TEST%%tests/kyua-cli/cli/cmd_help_test
%%TEST%%tests/kyua-cli/cli/cmd_list_test
%%TEST%%tests/kyua-cli/cli/cmd_report_html_test
%%TEST%%tests/kyua-cli/cli/cmd_report_test
%%TEST%%tests/kyua-cli/cli/cmd_test_test
%%TEST%%tests/kyua-cli/cli/common_test
%%TEST%%tests/kyua-cli/cli/config_test
%%TEST%%tests/kyua-cli/cli/main_test
%%TEST%%tests/kyua-cli/engine/Kyuafile
%%TEST%%tests/kyua-cli/engine/action_test
%%TEST%%tests/kyua-cli/engine/config_test
%%TEST%%tests/kyua-cli/engine/context_test
%%TEST%%tests/kyua-cli/engine/drivers/Kyuafile
%%TEST%%tests/kyua-cli/engine/drivers/debug_test_test
%%TEST%%tests/kyua-cli/engine/drivers/list_tests_helpers
%%TEST%%tests/kyua-cli/engine/drivers/list_tests_test
%%TEST%%tests/kyua-cli/engine/drivers/run_tests_test
%%TEST%%tests/kyua-cli/engine/drivers/scan_action_test
%%TEST%%tests/kyua-cli/engine/drivers/scan_results_test
%%TEST%%tests/kyua-cli/engine/exceptions_test
%%TEST%%tests/kyua-cli/engine/filters_test
%%TEST%%tests/kyua-cli/engine/kyuafile_test
%%TEST%%tests/kyua-cli/engine/metadata_test
%%TEST%%tests/kyua-cli/engine/report_junit_test
%%TEST%%tests/kyua-cli/engine/test_case_atf_helpers
%%TEST%%tests/kyua-cli/engine/test_case_plain_helpers
%%TEST%%tests/kyua-cli/engine/test_case_test
@ -80,6 +78,7 @@ man/man7/kyua-test-filters.7.gz
%%TEST%%tests/kyua-cli/integration/cmd_help_test
%%TEST%%tests/kyua-cli/integration/cmd_list_test
%%TEST%%tests/kyua-cli/integration/cmd_report_html_test
%%TEST%%tests/kyua-cli/integration/cmd_report_junit_test
%%TEST%%tests/kyua-cli/integration/cmd_report_test
%%TEST%%tests/kyua-cli/integration/cmd_test_test
%%TEST%%tests/kyua-cli/integration/global_test
@ -93,15 +92,25 @@ man/man7/kyua-test-filters.7.gz
%%TEST%%tests/kyua-cli/integration/helpers/simple_all_pass
%%TEST%%tests/kyua-cli/integration/helpers/simple_some_fail
%%TEST%%tests/kyua-cli/store/Kyuafile
%%TEST%%tests/kyua-cli/store/backend_test
%%TEST%%tests/kyua-cli/store/dbtypes_test
%%TEST%%tests/kyua-cli/store/exceptions_test
%%TEST%%tests/kyua-cli/store/layout_test
%%TEST%%tests/kyua-cli/store/metadata_test
%%TEST%%tests/kyua-cli/store/migrate_test
%%TEST%%tests/kyua-cli/store/read_backend_test
%%TEST%%tests/kyua-cli/store/read_transaction_test
%%TEST%%tests/kyua-cli/store/schema_inttest
%%TEST%%tests/kyua-cli/store/schema_v1.sql
%%TEST%%tests/kyua-cli/store/schema_v2.sql
%%TEST%%tests/kyua-cli/store/testdata_v1.sql
%%TEST%%tests/kyua-cli/store/testdata_v2.sql
%%TEST%%tests/kyua-cli/store/testdata_v3_1.sql
%%TEST%%tests/kyua-cli/store/testdata_v3_2.sql
%%TEST%%tests/kyua-cli/store/testdata_v3_3.sql
%%TEST%%tests/kyua-cli/store/testdata_v3_4.sql
%%TEST%%tests/kyua-cli/store/transaction_test
%%TEST%%tests/kyua-cli/store/write_backend_test
%%TEST%%tests/kyua-cli/store/write_transaction_test
%%TEST%%tests/kyua-cli/utils/Kyuafile
%%TEST%%tests/kyua-cli/utils/auto_array_test
%%TEST%%tests/kyua-cli/utils/cmdline/Kyuafile
@ -143,6 +152,7 @@ man/man7/kyua-test-filters.7.gz
%%TEST%%tests/kyua-cli/utils/process/helpers
%%TEST%%tests/kyua-cli/utils/process/status_test
%%TEST%%tests/kyua-cli/utils/process/systembuf_test
%%TEST%%tests/kyua-cli/utils/releaser_test
%%TEST%%tests/kyua-cli/utils/sanity_test
%%TEST%%tests/kyua-cli/utils/signals/Kyuafile
%%TEST%%tests/kyua-cli/utils/signals/exceptions_test