[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 492b1f6 1/2: Save nychthemeral speed tests in
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 492b1f6 1/2: Save nychthemeral speed tests in git |
Date: |
Fri, 20 Nov 2020 09:47:11 -0500 (EST) |
branch: master
commit 492b1f63ad0c559b3e795e9939f6b00aca65a2b6
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Save nychthemeral speed tests in git
Iff user is 'greg', then generate 'Speed_*' files measuring performance
whenever a nychthemeral test is run. Tracking them in git establishes a
historical record and makes regressions obvious. Planned workflow:
- git commit, commit, ... commit
- ./nychthemeral_test.sh
- git commit Speed_*
- git push
* nychthemeral_test.sh: Do this iff user is 'greg'. Incidentally
regularize indentation.
* test_coding_rules.cpp: Accept 'Speed_*' files. Incidentally repeat
sort-by-enumerator advice from (far) above.
* workhorse.make: Add a target to write 'Speed_* files. Unlike the
'cli_selftest' target, ignore the antediluvian tests, and run the
program only once because it will already be in the disk cache.
---
nychthemeral_test.sh | 9 ++++++++-
test_coding_rules.cpp | 3 ++-
workhorse.make | 5 +++++
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/nychthemeral_test.sh b/nychthemeral_test.sh
index 031f589..43c672f 100755
--- a/nychthemeral_test.sh
+++ b/nychthemeral_test.sh
@@ -128,6 +128,7 @@ nychthemeral_clutter='
/^ *[1-9][0-9]* source files/d
/^ *[1-9][0-9]* source lines/d
/^ *[1-9][0-9]* marked defects/d
+/^# speed test/d
/^# xrc tests/d
/^# test all valid emission types/d
/^# schema tests/d
@@ -151,7 +152,7 @@ if [ "Cygwin" != "$platform" ] && [ "WSL" != "$platform" ]
then
# 'triplets' really is used, but in a zsh-specific way
# shellcheck disable=SC2034
- triplets="x86_64-pc-linux-gnu x86_64-w64-mingw32 i686-w64-mingw32"
+ triplets="x86_64-pc-linux-gnu x86_64-w64-mingw32 i686-w64-mingw32"
fi
export LMI_COMPILER=gcc
export LMI_TRIPLET
@@ -227,6 +228,12 @@ printf '\n# unit tests in libstdc++ debug mode\n\n'
make "$coefficiency" --output-sync=recurse unit_tests build_type=safestdlib
2>&1 \
| tee >(grep '\*\*\*') >(grep \?\?\?\?) >(grep '!!!!' --count | xargs printf
'%d tests succeeded\n') >"$log_dir"/unit_tests_safestdlib
+if [ "greg" = "$(whoami)" ]
+then
+ printf '\n# speed test\n\n'
+ make cli_timing
+fi
+
printf '\n# xrc tests\n\n'
java -jar /opt/lmi/third_party/rng/jing.jar -c xrc.rnc ./*.xrc 2>&1 \
| tee "$log_dir"/xrc
diff --git a/test_coding_rules.cpp b/test_coding_rules.cpp
index 571b356..4b3bc13 100644
--- a/test_coding_rules.cpp
+++ b/test_coding_rules.cpp
@@ -202,8 +202,9 @@ file::file(std::string const& file_path)
: ".xrc" == extension() ? e_xml_other
: ".xsd" == extension() ? e_xml_other
: ".xsl" == extension() ? e_xml_other
- // phyloanalyze() tests inspect only file name
+ // phyloanalyze() tests inspect only file name [sort by enumerator]
: phyloanalyze("^ChangeLog-") ? e_binary
+ : phyloanalyze("^Speed_") ? e_binary
: phyloanalyze("^tags$") ? e_expungible
: phyloanalyze("^COPYING$") ? e_gpl
: phyloanalyze("^quoted_gpl") ? e_gpl
diff --git a/workhorse.make b/workhorse.make
index 46986ff..3d91724 100644
--- a/workhorse.make
+++ b/workhorse.make
@@ -1349,6 +1349,11 @@ cli_selftest:
@$(PERFORM) ./lmi_cli_shared$(EXEEXT) $(self_test_options) > /dev/null
@$(PERFORM) ./lmi_cli_shared$(EXEEXT) $(self_test_options)
+.PHONY: cli_timing
+cli_timing: lmi_cli_shared$(EXEEXT)
+ @$(PERFORM) ./lmi_cli_shared$(EXEEXT) $(self_test_options) \
+ >$(srcdir)/Speed_$(LMI_COMPILER)_$(LMI_TRIPLET)
+
cli_test-sample.ill: special_emission :=
cli_test-sample.cns: special_emission := emit_composite_only