From: Fred Hamster Date: Mon, 19 Oct 2026 20:21:24 +0000 (-0400) Subject: revising test run times and test logging X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=fec7beeaa3af19439cdd203356883b758c1d1330;p=feisty_meow.git revising test run times and test logging found some longer running tests (defined currently as longer than 5 seconds run time) and made them limbo under the bar. added timestamps in the target runner. turned off debug in dir tree test. --- diff --git a/nucleus/library/tests_crypto/test_twofish_crypto.cpp b/nucleus/library/tests_crypto/test_twofish_crypto.cpp index c17e595b..dae08b3a 100644 --- a/nucleus/library/tests_crypto/test_twofish_crypto.cpp +++ b/nucleus/library/tests_crypto/test_twofish_crypto.cpp @@ -46,13 +46,13 @@ using namespace unit_test; #define DEBUG_TWOFISH // uncomment for noisier run. -const int TEST_RUNS_PER_KEY = 42; // encryption test cycles done on each key. +const int TEST_RUNS_PER_KEY = 7; // encryption test cycles done on each key. const int THREAD_COUNT = 10; // number of threads testing twofish at once. -const int ITERATIONS = 64; // number of test runs in our testing threads. +const int ITERATIONS = 14; // number of test runs in our testing threads. -const int MAX_STRING = 64 * KILOBYTE; // largest chunk that we'll try to encrypt. +const int MAX_STRING = 20 * KILOBYTE; // largest chunk that we'll try to encrypt. ////////////// diff --git a/nucleus/library/tests_filesystem/test_directory_tree.cpp b/nucleus/library/tests_filesystem/test_directory_tree.cpp index cd2504a8..4f889159 100644 --- a/nucleus/library/tests_filesystem/test_directory_tree.cpp +++ b/nucleus/library/tests_filesystem/test_directory_tree.cpp @@ -40,10 +40,14 @@ using namespace unit_test; const bool JUST_SIZES = false; // determines if we'll only compare file size and time. -#define DEBUG_TEST_DIRECTORY_TREE +//#define DEBUG_TEST_DIRECTORY_TREE // uncomment if you want noisy logging. -#define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s) +#ifdef DEBUG_TEST_DIRECTORY_TREE + #define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s) +#else + #define LOG(s) {} +#endif class test_directory_tree : public virtual unit_base, virtual public application_shell { @@ -57,24 +61,19 @@ int test_directory_tree::execute() { FUNCDEF("execute"); -/* old approach. - astring path = "/usr/lib"; -#ifdef __WIN32__ - // default path for windoze uses an area that should always exist. - path = environment::get("COMMONPROGRAMFILES"); -#endif -*/ - /* hmmm: this test shows that our algorithms are poor; the tree traversal on feisty meow apex should not take as long as it does. get some timing around this, comparing it with other linux tools, like ls -R and find. see if we have some ugly bottlenecks, or where they are, and fix them. + +a bit of watching, and it seems like the comparison is the super slow thing. + */ // new approach for where to look is at feisty meow itself. // some type of introspection to be sure. - astring path = environment::get("FEISTY_MEOW_APEX"); + astring path = environment::get("FEISTY_MEOW_SCRIPTS"); // process the command line parameters, which are optionally a directory name and // a pattern to use when scanning. @@ -86,10 +85,8 @@ see if we have some ugly bottlenecks, or where they are, and fix them. pattern = _global_argv[2]; { -#ifdef DEBUG_TEST_DIRECTORY_TREE - log(astring("Scanning directory tree at \"") + path + "\""); - log(astring("Using pattern-match \"") + pattern + "\""); -#endif + LOG(astring("Scanning directory tree at \"") + path + "\""); + LOG(astring("Using pattern-match \"") + pattern + "\""); directory_tree dir(path, pattern.s()); ASSERT_TRUE(dir.good(), "directory_tree construction should succeed and be readable."); @@ -104,18 +101,14 @@ see if we have some ugly bottlenecks, or where they are, and fix them. while (directory_tree::current(*ted, curr, files)) { // we have a good directory to show. directory_tree::depth(*ted, depth); -#ifdef DEBUG_TEST_DIRECTORY_TREE - log(string_manipulation::indentation(depth * 2) + astring("[") + curr.raw() + "]"); -#endif + LOG(string_manipulation::indentation(depth * 2) + astring("[") + curr.raw() + "]"); astring names; for (int i = 0; i < files.length(); i++) names += files[i] + " "; if (names.length()) { astring split; string_manipulation::split_lines(names, split, depth * 2 + 2); -#ifdef DEBUG_TEST_DIRECTORY_TREE - log(split); -#endif + LOG(split); } // go to the next place. @@ -123,6 +116,8 @@ see if we have some ugly bottlenecks, or where they are, and fix them. } directory_tree::throw_out(ted); + + LOG(astring("Finished scan on directory tree at \"") + path + "\""); } { @@ -134,79 +129,92 @@ see if we have some ugly bottlenecks, or where they are, and fix them. { // third test group. tree comparison operation. -// log(astring("Self-comparing directory tree at \"") + path + "\""); -// log(astring("Using pattern-match \"") + pattern + "\""); + LOG(astring("Self-comparing directory tree at \"") + path + "\""); + LOG(astring("Using pattern-match \"") + pattern + "\""); -// LOG("reading tree 1."); + LOG("reading tree 1."); directory_tree dir(path, pattern.s()); ASSERT_TRUE(dir.good(), "the directory should be readable for self-compare"); + LOG("done reading tree 1."); // now read a copy of the tree also. -// LOG("reading tree 2."); + LOG("reading tree 2."); directory_tree dir2(path, pattern.s()); ASSERT_TRUE(dir2.good(), "the directory should read the second time fine too"); + LOG("done reading tree 2."); - LOG("comparing the two trees."); + LOG("started comparing the two trees."); filename_list diffs; directory_tree::compare_trees(dir, dir2, diffs, file_info::EQUAL_CHECKSUM_TIMESTAMP_FILESIZE); + LOG("finished comparing the two trees."); + +LOG("#### diffs found..."); LOG(diffs.text_form()); +LOG("####"); ASSERT_FALSE(diffs.elements(), "there should be no differences comparing identical dirs"); } { // fourth test: see if the calculate function works. -// log(astring("Calculating sums for tree at \"") + path + "\""); -// log(astring("Using pattern-match \"") + pattern + "\""); + LOG(astring("Calculating sums for tree at \"") + path + "\""); + LOG(astring("Using pattern-match \"") + pattern + "\""); -// LOG("reading tree 1."); + LOG("reading tree 1."); directory_tree dir(path, pattern.s()); ASSERT_TRUE(dir.good(), "the directory should be readable for checksums"); // now read a copy of the tree also. -// LOG("reading tree 2."); + LOG("reading tree 2."); directory_tree dir2(path, pattern.s()); ASSERT_TRUE(dir2.good(), "checksummer should be able to read second time also"); -// LOG("calculating checksums for tree 1."); + LOG("calculating checksums for tree 1."); ASSERT_TRUE(dir.calculate(JUST_SIZES), "the first checksummer tree can be calculated"); -// LOG("calculating checksums for tree 2."); + LOG("calculating checksums for tree 2."); ASSERT_TRUE(dir2.calculate(JUST_SIZES), "the second checksummer tree can be calculated"); -// LOG("comparing the two trees."); + LOG("comparing the two trees."); filename_list diffs; directory_tree::compare_trees(dir, dir2, diffs, file_info::EQUAL_CHECKSUM_TIMESTAMP_FILESIZE); -//LOG(diffs.text_form()); + +LOG(astring("#### diffs found...")); +LOG(diffs.text_form()); +LOG("####"); ASSERT_FALSE(diffs.elements(), "no checksummer differences should be seen for identical directories"); } { // fifth test: see if the packing works. -// log(astring("Reading tree for packing at \"") + path + "\""); -// log(astring("Using pattern-match \"") + pattern + "\""); + LOG(astring("Reading tree for packing at \"") + path + "\""); + LOG(astring("Using pattern-match \"") + pattern + "\""); -// LOG("reading tree."); + LOG("reading tree."); directory_tree dir(path, pattern.s()); ASSERT_TRUE(dir.good(), "packer directory should be read"); -// LOG("calculating checksums for tree."); + LOG("calculating checksums for tree."); ASSERT_TRUE(dir.calculate(JUST_SIZES), "the first packer tree can be calculated"); + LOG("done calculating checksums for tree."); + LOG("packing the tree."); byte_array packed_form; int size_packed = dir.packed_size(); dir.pack(packed_form); //LOG(a_sprintf("tree became %d abyte array", packed_form.length())); ASSERT_EQUAL(size_packed, packed_form.length(), "packed size should be right"); + LOG("unpacking the tree."); directory_tree dir2; ASSERT_TRUE(dir2.unpack(packed_form), "second tree can be unpacked from the first"); -// LOG("comparing the two trees."); + LOG("comparing the two trees."); filename_list diffs; directory_tree::compare_trees(dir, dir2, diffs, file_info::EQUAL_CHECKSUM_TIMESTAMP_FILESIZE); //LOG(diffs.text_form()); + LOG("finished comparing the two trees."); ASSERT_FALSE(diffs.elements(), "identical directories should stay same after packing"); @@ -216,7 +224,7 @@ LOG(diffs.text_form()); { // sixth test: see if the make_directories function works. -LOG("reading tree to recreate"); +LOG("reading tree to test making directories"); directory_tree dir(path, pattern.s()); ASSERT_TRUE(dir.good(), "makedirs test directory reading"); filename tmpdir(environment::get("FEISTY_MEOW_GENERATED_STORE") + "/zz_balfazzaral"); diff --git a/nucleus/library/tests_nodes/test_symbol_tree.cpp b/nucleus/library/tests_nodes/test_symbol_tree.cpp index a3e7aeef..21162161 100644 --- a/nucleus/library/tests_nodes/test_symbol_tree.cpp +++ b/nucleus/library/tests_nodes/test_symbol_tree.cpp @@ -45,7 +45,8 @@ using namespace unit_test; // how many nodes we add to the tree. //const int MAX_NODES_TESTED = 40000; -const int MAX_NODES_TESTED = 4200; +//const int MAX_NODES_TESTED = 4200; +const int MAX_NODES_TESTED = 420; class test_symbol_tree : public unit_base, public application_shell { diff --git a/octopi/library/tests_octopus/test_bin.cpp b/octopi/library/tests_octopus/test_bin.cpp index b80b93f1..9c147ac7 100644 --- a/octopi/library/tests_octopus/test_bin.cpp +++ b/octopi/library/tests_octopus/test_bin.cpp @@ -41,7 +41,8 @@ using namespace octopi; using namespace textual; using namespace unit_test; -const int ITEM_COUNT = 10000; +//const int ITEM_COUNT = 10000; +const int ITEM_COUNT = 1000; // the number of times to repeat each test operation. #define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), astring(s)) diff --git a/scripts/clam/target_runner.sh b/scripts/clam/target_runner.sh index 9135fcb6..34540ec8 100644 --- a/scripts/clam/target_runner.sh +++ b/scripts/clam/target_runner.sh @@ -9,6 +9,8 @@ # Feel free to send updates to: [ fred@gruntose.com ] ############## +source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh" + # Runs the programs listed in clam's RUN_TARGETS and reports any errors seen. function run_the_targets() @@ -27,7 +29,7 @@ function run_the_targets() if [ ! -z "${RUN_TARGETS}" -a ! -z "${RUN_ALL_TESTS}" ]; then if [ -f "${DIRTY_FILE}" -o -f "${SUBMAKE_FLAG}" ]; then for program_name in ${RUN_TARGETS}; do - echo "+++ running target: $program_name" + echo "+++ running target: $program_name at $(date_stringer)" local base=$(basename $program_name) if [ "$OPERATING_SYSTEM" == "WIN32" ]; then # extra step to force win32 applications to stay held in our grip, @@ -43,14 +45,14 @@ function run_the_targets() /bin/time "$program_name" exitval=$? fi - echo "--- target complete: $program_name" + echo "--- target complete: $program_name at $(date_stringer)" if [ $exitval -ne 0 ]; then - echo "ERROR: $program_name exits with $exitval at $(date)" + echo "ERROR: $program_name exits with $exitval at $(date_stringer)" total_exitval=$(($total_exitval + 1)) fi done if [ $total_exitval -ne 0 ]; then - echo "FAILURE: $total_exitval errors occurred in RUN_TARGETS." + echo "FAILURE: $total_exitval errors occurred in RUN_TARGETS at $(date_stringer)." echo yep >"${FAILURE_FILE}" exit 1 fi