From 79388bfdd8b258237a1bbf6e9868bf4a6527828d Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 7 Nov 2021 02:04:30 -0500 Subject: [PATCH] Running `make testall` should run all of the tests (#42904) (cherry picked from commit 36304bacc739bae2aa6c8cba915edd3b3c4b2b4f) --- test/Makefile | 4 ++-- test/choosetests.jl | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/test/Makefile b/test/Makefile index 9ca65ffa9d7c77..2541cd3048634f 100644 --- a/test/Makefile +++ b/test/Makefile @@ -7,7 +7,7 @@ STDLIBDIR := $(build_datarootdir)/julia/stdlib/$(VERSDIR) # TODO: this Makefile ignores BUILDDIR, except for computing JULIA_EXECUTABLE TESTGROUPS = unicode strings compiler -TESTS = all stdlib $(TESTGROUPS) \ +TESTS = all default stdlib $(TESTGROUPS) \ $(patsubst $(STDLIBDIR)/%/,%,$(dir $(wildcard $(STDLIBDIR)/*/.))) \ $(filter-out runtests testdefs, \ $(patsubst $(SRCDIR)/%.jl,%,$(wildcard $(SRCDIR)/*.jl))) \ @@ -19,7 +19,7 @@ EMBEDDING_ARGS := "JULIA=$(JULIA_EXECUTABLE)" "BIN=$(SRCDIR)/embedding" "CC=$(CC GCEXT_ARGS := "JULIA=$(JULIA_EXECUTABLE)" "BIN=$(SRCDIR)/gcext" "CC=$(CC)" -default: all +default: $(TESTS): @cd $(SRCDIR) && \ diff --git a/test/choosetests.jl b/test/choosetests.jl index 40c4cfcd54eb1a..f67b45cfff3f44 100644 --- a/test/choosetests.jl +++ b/test/choosetests.jl @@ -93,7 +93,7 @@ function choosetests(choices = []) --seed= : set the initial seed for all testgroups (parsed as a UInt128) --skip ... : skip test or collection tagged with TESTS: - Can be special tokens, such as "all", "unicode", "stdlib", the names of stdlib modules, or the names of any file in the TESTNAMES array (defaults to "all"). + Can be special tokens, such as "all", "unicode", "stdlib", the names of stdlib modules, or the names of any file in the testnames array (defaults to "all"). Or prefix a name with `-` (such as `-core`) to skip a particular test. """) @@ -109,9 +109,13 @@ function choosetests(choices = []) unhandled = copy(skip_tests) - if tests == ["all"] || isempty(tests) - tests = testnames + requested_all = "all" in tests + requested_default = "default" in tests + if isempty(tests) || requested_all || requested_default + append!(tests, testnames) end + filter!(x -> x != "all", tests) + filter!(x -> x != "default", tests) function filtertests!(tests, name, files=[name]) flt = x -> (x != name && !(x in files)) @@ -124,7 +128,7 @@ function choosetests(choices = []) end end - explicit_pkg3 = "Pkg" in tests + explicit_pkg = "Pkg" in tests explicit_libgit2 = "LibGit2/online" in tests filtertests!(tests, "unicode", ["unicode/utf8"]) @@ -187,8 +191,9 @@ function choosetests(choices = []) end filter!(x -> (x != "stdlib" && !(x in STDLIBS)) , tests) append!(tests, new_tests) - explicit_pkg3 || filter!(x -> x != "Pkg", tests) - explicit_libgit2 || filter!(x -> x != "LibGit2/online", tests) + + requested_all || explicit_pkg || filter!(x -> x != "Pkg", tests) + requested_all || explicit_libgit2 || filter!(x -> x != "LibGit2/online", tests) # Filter out tests from the test groups in the stdlibs filter!(!in(tests), unhandled)