lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 89d71912 2/4: Make it easier to run individua


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 89d71912 2/4: Make it easier to run individual unit tests
Date: Thu, 10 Mar 2022 16:07:28 -0500 (EST)

branch: master
commit 89d71912a82fccf45068cd9c52662932bc7fca17
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Make it easier to run individual unit tests
    
    It was inconvenient to spell out the contents of $(EXEEXT) on the
    command line, differently for posix and msw platforms.
---
 gwc/develop1.txt      | 2 +-
 objects.make          | 9 +++++----
 tabs/3/startup_script | 2 +-
 workhorse.make        | 6 +++---
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/gwc/develop1.txt b/gwc/develop1.txt
index a5b769ac..71ac7803 100644
--- a/gwc/develop1.txt
+++ b/gwc/develop1.txt
@@ -255,7 +255,7 @@ make $coefficiency unit_tests build_type=safestdlib 2>&1 | 
tee >(grep '\*\*\*')
 
   # Run a single unit test
 
-make $coefficiency unit_tests unit_test_targets=regex_test.exe >../log 2>&1
+make $coefficiency unit_tests unit_test_targets=regex_test >../log 2>&1
 
   # Build with a compiler other than gcc
 
diff --git a/objects.make b/objects.make
index 941c5993..f19aa947 100644
--- a/objects.make
+++ b/objects.make
@@ -435,10 +435,11 @@ unit_test_targets := \
   zero_test \
 
 unit_test_targets := \
-  $(addsuffix $(EXEEXT), \
-    $(filter-out $(excluded_unit_test_targets), $(unit_test_targets) \
-    ) \
-  )
+  $(filter-out $(excluded_unit_test_targets), $(unit_test_targets) \
+  ) \
+
+# Append $(EXEEXT) p.r.n. to produce full names of binary targets.
+unit_test_binaries := $(addsuffix $(EXEEXT), $(unit_test_targets))
 
 # Link these objects for all tests:
 common_test_objects := \
diff --git a/tabs/3/startup_script b/tabs/3/startup_script
index b7af88db..5731ad25 100755
--- a/tabs/3/startup_script
+++ b/tabs/3/startup_script
@@ -12,7 +12,7 @@ h='make $coefficiency cgi_tests cli_tests 
build_type=safestdlib 2>&1 | tee ../lo
 i="make \$coefficiency --output-sync=recurse unit_tests build_type=safestdlib 
2>&1 | tee >(grep '\*\*\*') >(grep '????') >(grep '!!!!' --count | xargs printf 
'%d tests succeeded\n') >../log"
 j='./nychthemeral_test.sh'
 k='make $coefficiency install check_physical_closure 2>&1 | less -S'
-l='make $coefficiency unit_tests unit_test_targets=regex_test.exe 2>&1 | less 
-S'
+l='make $coefficiency unit_tests unit_test_targets=regex_test 2>&1 | less -S'
 m='make $coefficiency LMI_COMPILER=gcc LMI_TRIPLET=x86_64-pc-linux-gnu 
check_concinnity 2>&1 |less -S -N'
 
 print -rs $b ; echo $b ; eval $b
diff --git a/workhorse.make b/workhorse.make
index 787288b4..a757318f 100644
--- a/workhorse.make
+++ b/workhorse.make
@@ -1277,16 +1277,16 @@ unit_tests: $(test_data)
        @ $(MAKE) --file=$(this_makefile) --output-sync=recurse run_unit_tests
 
 .PHONY: build_unit_tests
-build_unit_tests: configurable_settings.xml $(unit_test_targets)
+build_unit_tests: configurable_settings.xml $(unit_test_binaries)
 
 .PHONY: unit_tests_not_built
 unit_tests_not_built:
        @$(ECHO) "List of unit-test targets that did not build successfully:"
-       @$(ECHO) $(filter-out $(shell $(LS) -1 *$(EXEEXT)),$(unit_test_targets))
+       @$(ECHO) $(filter-out $(shell $(LS) -1 
*$(EXEEXT)),$(unit_test_binaries))
        @$(ECHO) "List ends."
 
 .PHONY: run_unit_tests
-run_unit_tests: unit_tests_not_built $(addsuffix -run,$(unit_test_targets))
+run_unit_tests: unit_tests_not_built $(addsuffix -run,$(unit_test_binaries))
 
 .PHONY: %$(EXEEXT)-run
 %$(EXEEXT)-run:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]