Skip to content

Commit

Permalink
Merge pull request #1825 from albinahlback/test_makefile
Browse files Browse the repository at this point in the history
Enable running specific tests through `make check MOD=... ARGS=...`
  • Loading branch information
albinahlback authored Mar 11, 2024
2 parents e51b56b + 1871ff7 commit 9581414
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
21 changes: 17 additions & 4 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,9 @@ tests: library $(TESTS)
%_TEST_RUN: %
@$<

%_TEST_RUN_ARGS: %
@$< $(ARGS)

# Parallel running of same test file
ifneq ($(NJOBS),)
number_generator=$(words $2) $(if $(word $1,$2),,$(call number_generator,$1,w $2))
Expand All @@ -786,6 +789,15 @@ check: library
@echo 'All Python tests passed.'
endif
else ifdef MOD
ifdef ARGS
ifneq ($(words $(sort $(MOD))),1)
$(error Can only check one modules with arguments.)
else
check: library $(patsubst %,%_TEST_RUN_ARGS, $($(sort $(MOD))_TESTS))
@echo ''
@echo 'All tests passed for $(sort $(MOD)).'
endif
else
ifeq ($(NJOBS),)
check: library $(patsubst %,%_TEST_RUN,$(foreach dir, $(MOD), $($(dir)_TESTS)))
@echo ''
Expand All @@ -811,6 +823,7 @@ else
@echo 'All tests passed for $(foreach dir,$(filter-out $(lastword $(filter-out $(lastword $(sort $(MOD))),$(sort $(MOD)))) $(lastword $(sort $(MOD))),$(sort $(MOD))),$(dir),) $(lastword $(filter-out $(lastword $(sort $(MOD))),$(sort $(MOD)))) and $(lastword $(sort $(MOD))).'
endif
endif
endif
else
check: library $(TESTS:%=%_TEST_RUN)
@echo ''
Expand Down Expand Up @@ -952,11 +965,11 @@ src/flint.h: src/flint.h.in config.status
libtool: config.status
./config.status $@

src/gmpcompat.h: src/@GMPCOMPAT_H_IN@ config.status
./config.status $@

# The following two are only linked during configuration
# The following are only linked during configuration

# src/gmpcompat.h: src/@GMPCOMPAT_H_IN@ config.status
# ./config.status $@
#
# src/fmpz/fmpz.c: @FMPZ_C_IN@ config.status
# ./config.status $@
#
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ FLINT_CHECK_GMP_H(6,2,1)
FLINT_GMP_LONG_LONG_LIMB([gmpcompat_h_in="gmpcompat-longlong.h.in"],
[gmpcompat_h_in="gmpcompat.h.in"])

AC_CONFIG_FILES([src/gmpcompat.h:src/$gmpcompat_h_in],[],[gmpcompat_h_in="$gmpcompat_h_in"])
AC_CONFIG_LINKS([src/gmpcompat.h:src/$gmpcompat_h_in],[],[gmpcompat_h_in="$gmpcompat_h_in"])
AC_SUBST(GMPCOMPAT_H_IN, $gmpcompat_h_in)

################################################################################
Expand Down

0 comments on commit 9581414

Please sign in to comment.