[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5102] Run system tests in parallel
From: |
Greg Chicares |
Subject: |
[lmi-commits] [5102] Run system tests in parallel |
Date: |
Mon, 20 Sep 2010 12:32:27 +0000 |
Revision: 5102
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5102
Author: chicares
Date: 2010-09-20 12:32:27 +0000 (Mon, 20 Sep 2010)
Log Message:
-----------
Run system tests in parallel
Modified Paths:
--------------
lmi/trunk/ChangeLog
lmi/trunk/diagnostics.sed
lmi/trunk/global_settings.cpp
lmi/trunk/global_settings.hpp
lmi/trunk/global_settings_test.cpp
lmi/trunk/main_cli.cpp
lmi/trunk/main_wx.cpp
lmi/trunk/workhorse.make
Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2010-09-17 20:55:19 UTC (rev 5101)
+++ lmi/trunk/ChangeLog 2010-09-20 12:32:27 UTC (rev 5102)
@@ -26772,3 +26772,14 @@
workhorse.make
Run tests seriatim iff they write to stdout.
+20100920T1232Z <address@hidden> [656]
+
+ diagnostics.sed
+ global_settings.cpp
+ global_settings.hpp
+ global_settings_test.cpp
+ main_cli.cpp
+ main_wx.cpp
+ workhorse.make
+Run system tests in parallel.
+
Modified: lmi/trunk/diagnostics.sed
===================================================================
--- lmi/trunk/diagnostics.sed 2010-09-17 20:55:19 UTC (rev 5101)
+++ lmi/trunk/diagnostics.sed 2010-09-20 12:32:27 UTC (rev 5102)
@@ -79,18 +79,6 @@
/^[^ ]*bcc_ld --accept/d
/^Turbo Incremental Link/d
/^\\[/A-Za-z0-9_]*.cpp:$/d
- # Delete expected output from regression test.
-/^Regression testing:.*\.\(cns\|ill\|ini\|mec\)$/d
-/^Initializing all cells\.*$/d
-/^curr charges and genacct int, full sepacct int\.*$/d
-/^guar charges and genacct int, full sepacct int\.*$/d
-/^mdpt charges and genacct int, no sepacct\.*$/d
-/^curr charges and genacct int, zero sepacct int\.*$/d
-/^guar charges and genacct int, zero sepacct int\.*$/d
-/^curr charges and genacct int, half sepacct int\.*$/d
-/^guar charges and genacct int, half sepacct int\.*$/d
-/^Calculating all cells\.*$/d
-/^no errors detected/d
# Delete multiple blank lines.
/./,/^$/!d
Modified: lmi/trunk/global_settings.cpp
===================================================================
--- lmi/trunk/global_settings.cpp 2010-09-17 20:55:19 UTC (rev 5101)
+++ lmi/trunk/global_settings.cpp 2010-09-20 12:32:27 UTC (rev 5102)
@@ -55,7 +55,6 @@
,custom_io_0_ (false)
,regression_testing_ (false)
,data_directory_ (fs::system_complete("."))
- ,regression_test_directory_ (fs::system_complete("."))
{}
global_settings::~global_settings()
@@ -112,12 +111,6 @@
data_directory_ = fs::system_complete(s);
}
-void global_settings::set_regression_test_directory(std::string const& s)
-{
- validate_directory(s, "Regression-test directory");
- regression_test_directory_ = fs::system_complete(s);
-}
-
bool global_settings::mellon() const
{
return mellon_;
@@ -148,8 +141,3 @@
return data_directory_;
}
-fs::path const& global_settings::regression_test_directory() const
-{
- return regression_test_directory_;
-}
-
Modified: lmi/trunk/global_settings.hpp
===================================================================
--- lmi/trunk/global_settings.hpp 2010-09-17 20:55:19 UTC (rev 5101)
+++ lmi/trunk/global_settings.hpp 2010-09-20 12:32:27 UTC (rev 5102)
@@ -60,9 +60,6 @@
///
/// data_directory_: Path to data files.
///
-/// regression_test_directory_: Path for regression-testing input and
-/// output.
-///
/// Directory members, whose names end in 'directory_', are stored as
/// filesystem path objects because that is their nature. They are
/// accessed as such in order to make misuse more difficult. But they
@@ -83,7 +80,6 @@
void set_custom_io_0 (bool);
void set_regression_testing (bool);
void set_data_directory (std::string const&);
- void set_regression_test_directory(std::string const&);
bool mellon () const;
bool ash_nazg () const;
@@ -91,7 +87,6 @@
bool custom_io_0 () const;
bool regression_testing () const;
fs::path const& data_directory () const;
- fs::path const& regression_test_directory() const;
private:
global_settings();
@@ -102,7 +97,6 @@
bool custom_io_0_;
bool regression_testing_;
fs::path data_directory_;
- fs::path regression_test_directory_;
#ifdef __BORLANDC__
// COMPILER !! Borland compilers defectively [11/5] require a public dtor; see:
Modified: lmi/trunk/global_settings_test.cpp
===================================================================
--- lmi/trunk/global_settings_test.cpp 2010-09-17 20:55:19 UTC (rev 5101)
+++ lmi/trunk/global_settings_test.cpp 2010-09-20 12:32:27 UTC (rev 5102)
@@ -54,13 +54,6 @@
,""
);
- // "Regression-test directory must not be empty."
- BOOST_TEST_THROW
- (global_settings::instance().set_regression_test_directory("")
- ,std::runtime_error
- ,""
- );
-
// Such string values must be validly-formed paths.
BOOST_TEST_THROW
Modified: lmi/trunk/main_cli.cpp
===================================================================
--- lmi/trunk/main_cli.cpp 2010-09-17 20:55:19 UTC (rev 5101)
+++ lmi/trunk/main_cli.cpp 2010-09-20 12:32:27 UTC (rev 5102)
@@ -32,7 +32,6 @@
#include "dbdict.hpp" // print_databases()
#include "getopt.hpp"
#include "global_settings.hpp"
-#include "handle_exceptions.hpp"
#include "illustrator.hpp"
#include "input.hpp"
#include "ledger.hpp"
@@ -51,9 +50,6 @@
#include "value_cast.hpp"
#include <boost/bind.hpp>
-#include <boost/filesystem/convenience.hpp>
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
#include <algorithm>
#include <cmath>
@@ -67,58 +63,6 @@
#include <string>
#include <vector>
-/// Run a suite of test cases.
-///
-/// Run every file with extension
-/// '.cns', '.ini', or '.mec'
-/// in a given system-testing directory, emitting data appropriate for
-/// automated comparison with previously-saved results.
-
-void system_test()
-{
- Timer timer;
- global_settings::instance().set_regression_testing(true);
- fs::path test_dir(global_settings::instance().regression_test_directory());
- fs::directory_iterator i(test_dir);
- fs::directory_iterator end_i;
- for(; i != end_i; ++i)
- {
- try
- {
- if(is_directory(*i))
- {
- continue;
- }
- else if(".cns" == fs::extension(*i) || ".ill" == fs::extension(*i))
- {
- std::cout << "Regression testing: " << i->string() <<
std::endl;
- (illustrator(mce_emit_test_data))(*i);
- }
- else if(".ini" == fs::extension(*i))
- {
- std::cout << "Regression testing: " << i->string() <<
std::endl;
- (illustrator(mce_emit_custom_0 ))(*i);
- }
- else if(".mec" == fs::extension(*i))
- {
- std::cout << "Regression testing: " << i->string() <<
std::endl;
- (mec_server (mce_emit_test_data))(*i);
- }
- else
- {
- // Do nothing. The test directory typically contains
- // many files of other types that are deliberately
- // ignored.
- }
- }
- catch(...)
- {
- report_exception();
- }
- }
- std::cout << "system_test(): " << timer.stop().elapsed_msec_str() <<
std::endl;
-}
-
/// Spot check and time some insurance calculations.
///
/// The antediluvian fork's calculated results don't match the
@@ -230,31 +174,23 @@
{"profile" ,NO_ARG ,0 ,'o' ,0 ,"set up for profiling and exit"},
{"emit" ,REQD_ARG ,0 ,'e' ,0 ,"choose what output to emit"},
{"illfile" ,REQD_ARG ,0 ,'i' ,0 ,"run illustration"},
+ {"inifile" ,REQD_ARG ,0 ,'n' ,0 ,"run custom .ini file"},
{"cnsfile" ,REQD_ARG ,0 ,'c' ,0 ,"run census"},
// {"gptfile" ,REQD_ARG ,0 ,'g' ,0 ,"test GPT"}, // Reserved for future
use.
{"mecfile" ,REQD_ARG ,0 ,'m' ,0 ,"test MEC testing"},
{"data_path" ,REQD_ARG ,0 ,'d' ,0 ,"path to data files"},
- {"print_db" ,NO_ARG ,0 ,'p', 0, "print product databases"},
- {"regress" ,NO_ARG ,0 ,'r' ,0 ,"run regression test"},
- {"test_path" ,REQD_ARG ,0 ,'t' ,0 ,"path to test files"},
-// {"list" ,LIST_ARG, 0, 0, 0 , "list"},
-// {"opt" ,OPT_ARG, 0, 0, 0 , "optional"},
-// {"alt" ,ALT_ARG, 0, 0, 0 , "alternative"},
-// {"vfile" ,REQD_ARG, 0, 0, vfile, "file type"},
-// {"vlist" ,LIST_ARG, 0, 0, vlist, "list type"},
-// {"vopt" ,OPT_ARG, 0, 0, vopt , "optional"},
-// {"valt" ,ALT_ARG, 0, 0, vopt , "alternative"},
- {0 ,NO_ARG, 0, 0, 0 , ""}
+ {"print_db" ,NO_ARG ,0 ,'p' ,0 ,"print product databases"},
+ {0 ,NO_ARG ,0 ,0 ,0 ,""}
};
bool license_accepted = false;
bool show_license = false;
bool show_help = false;
- bool run_regression_test = false;
bool run_selftest = false;
bool run_profile = false;
bool print_all_databases = false;
bool run_illustration = false;
+ bool run_ini = false;
bool run_census = false;
bool run_mec_test = false;
@@ -262,9 +198,9 @@
// Suppress enumerators for options not fully implemented.
emission.allow(emission.ordinal("emit_pdf_to_printer"), false);
emission.allow(emission.ordinal("emit_pdf_to_viewer" ), false);
- emission.allow(emission.ordinal("emit_custom_0" ), false);
std::vector<std::string> ill_names;
+ std::vector<std::string> ini_names;
std::vector<std::string> cns_names;
std::vector<std::string> mec_names;
@@ -421,6 +357,13 @@
}
break;
+ case 'n':
+ {
+ run_ini = true;
+ ini_names.push_back(getopt_long.optarg);
+ }
+ break;
+
case 'o':
{
run_profile = true;
@@ -433,26 +376,12 @@
}
break;
- case 'r':
- {
- run_regression_test = true;
- }
- break;
-
case 's':
{
run_selftest = true;
}
break;
- case 't':
- {
- global_settings::instance().set_regression_test_directory
- (getopt_long.optarg
- );
- }
- break;
-
case 'x':
{
global_settings::instance().set_pyx(getopt_long.optarg);
@@ -518,12 +447,6 @@
return;
}
- if(run_regression_test)
- {
- system_test();
- return;
- }
-
if(run_profile)
{
profile();
@@ -545,6 +468,15 @@
);
}
+ if(run_ini)
+ {
+ std::for_each
+ (ini_names.begin()
+ ,ini_names.end()
+ ,illustrator(emission.value())
+ );
+ }
+
if(run_census)
{
std::for_each
Modified: lmi/trunk/main_wx.cpp
===================================================================
--- lmi/trunk/main_wx.cpp 2010-09-17 20:55:19 UTC (rev 5101)
+++ lmi/trunk/main_wx.cpp 2010-09-20 12:32:27 UTC (rev 5102)
@@ -1181,7 +1181,6 @@
{"mello" ,NO_ARG ,0 ,003 ,0 ,"fraud"},
{"pyx" ,REQD_ARG ,0 ,'x' ,0 ,"for docimasy"},
{"data_path" ,REQD_ARG ,0 ,'d' ,0 ,"path to data files"},
- {"test_path" ,REQD_ARG ,0 ,'t' ,0 ,"path to test files"},
{"print_db" ,NO_ARG ,0 ,'p' ,0 ,"print product databases"},
{0 ,NO_ARG ,0 ,0 ,0 ,""}
};
@@ -1235,14 +1234,6 @@
}
break;
- case 't':
- {
- global_settings::instance().set_regression_test_directory
- (getopt_long.optarg
- );
- }
- break;
-
case 'x':
{
global_settings::instance().set_pyx(getopt_long.optarg);
Modified: lmi/trunk/workhorse.make
===================================================================
--- lmi/trunk/workhorse.make 2010-09-17 20:55:19 UTC (rev 5101)
+++ lmi/trunk/workhorse.make 2010-09-20 12:32:27 UTC (rev 5102)
@@ -1128,9 +1128,6 @@
@./lmi_cli_shared$(EXEEXT) $(self_test_options) > /dev/null
@./lmi_cli_shared$(EXEEXT) $(self_test_options)
-cli_test-sample.ill: file_option := --illfile
-cli_test-sample.cns: file_option := --cnsfile
-
cli_test-sample.ill: special_emission :=
cli_test-sample.cns: special_emission := emit_composite_only
@@ -1196,30 +1193,65 @@
# shown that the discrepancies thus ignored are never material, but
# larger discrepancies may be.
-test_result_suffixes := test test0 monthly_trace.* mec.xml
+testdeck_suffixes := cns ill ini mec
+test_result_suffixes := test test0 monthly_trace.* mec.xml
system_test_analysis := $(test_dir)/analysis-$(yyyymmddhhmm)
system_test_diffs := $(test_dir)/diffs-$(yyyymmddhhmm)
system_test_md5sums := $(test_dir)/md5sums-$(yyyymmddhhmm)
+%.cns: file_option := --cnsfile
+%.ill: file_option := --illfile
+%.ini: file_option := --inifile
+%.mec: file_option := --mecfile
+
+%.cns: test_emission := emit_quietly,emit_test_data
+%.ill: test_emission := emit_quietly,emit_test_data
+%.ini: test_emission := emit_quietly,emit_custom_0
+%.mec: test_emission := emit_quietly,emit_test_data
+
+dot_test_files =
+%.cns: dot_test_files = $(basename $(notdir $@)).*test
+%.ill: dot_test_files = $(basename $(notdir $@)).*test
+
+# Sort input files iff $(LS) supports '--sort=size'; otherwise, use
+# them unsorted. Parallel runs are slightly faster when the biggest
+# jobs are started first.
+
+testdecks := \
+ $(shell \
+ $(LS) --sort=size $(addprefix $(test_dir)/*., $(testdeck_suffixes)) \
+ || $(LS) $(addprefix $(test_dir)/*., $(testdeck_suffixes)) \
+ )
+
+# Naming the output files would be more natural, but that's infeasible
+# because $(test_emission) can be overridden implicitly in ways that a
+# makefile cannot readily discern.
+
+.PHONY: $(testdecks)
+$(testdecks):
+ @-$(bin_dir)/lmi_cli_shared$(EXEEXT) \
+ --accept \
+ --ash_nazg \
+ --data_path=$(data_dir) \
+ --emit=$(test_emission) \
+ --pyx=system_testing \
+ $(file_option)=$@
+ @$(MD5SUM) $(basename $(notdir $@)).* >> $(system_test_md5sums)
+ @for z in $(dot_test_files); \
+ do \
+ $(bin_dir)/ihs_crc_comp$(EXEEXT) $$z $(touchstone_dir)/$$z \
+ | $(SED) -e ';/Summary.*max rel err/!d' -e "s/^ /$$z/" \
+ >> $(system_test_analysis); \
+ done
+
.PHONY: system_test
system_test: $(data_dir)/configurable_settings.xml install
@$(ECHO) System test:
- @-cd $(test_dir); \
- $(foreach z, $(addprefix *., $(test_result_suffixes)), $(RM) --force
$z;)
- @cd $(test_dir); \
- $(bin_dir)/lmi_cli_shared$(EXEEXT) \
- --ash_nazg --accept --regress \
- --data_path=$(data_dir) \
- --test_path=$(test_dir); \
- $(MD5SUM) \
- $(addprefix *.,$(test_result_suffixes)) \
- >$(system_test_md5sums); \
- for z in *.test; \
- do \
- $(bin_dir)/ihs_crc_comp$(EXEEXT) $$z $(touchstone_dir)/$$z \
- | $(SED) -e ';/Summary.*max rel err/!d' -e "s/^ /$$z/"; \
- done > $(system_test_analysis);
+ @$(RM) --force $(addprefix $(test_dir)/*., $(test_result_suffixes))
+ @$(MAKE) --file=$(this_makefile) --directory=$(test_dir) $(testdecks)
+ @$(SORT) --key=2 $(system_test_md5sums) --output=$(system_test_md5sums)
+ @$(SORT) $(system_test_analysis) --output=$(system_test_analysis)
@-< $(system_test_analysis) $(SED) \
-e ';/rel err.*e-0*1[5-9]/d' \
-e ';/abs.*0\.00.*rel/d' \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5102] Run system tests in parallel,
Greg Chicares <=