Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modernizing num tests #792

Merged
merged 4 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
workflow_dispatch:
release:
push:
branches: ["master"]
pull_request:
types: [opened, synchronize, reopened, closed]

Expand Down
2 changes: 2 additions & 0 deletions atm/test/src/test_atm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ program test_atm
use test_atm_support, only: do_test_atm, &
test_verbosely, cgrav, eos_handle, kap_handle

implicit none

logical :: test_verbosely_in
real(dp) :: cgrav_in
integer :: eos_handle_in, kap_handle_in
Expand Down
5 changes: 3 additions & 2 deletions atm/test/src/test_atm_quietly.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ program test_atm_quietly
use test_atm_support, only: do_test_atm, &
test_verbosely, cgrav, eos_handle, kap_handle

implicit none

call setup
test_verbosely = .false.

call do_test_atm( &
test_verbosely, cgrav, eos_handle, kap_handle)
call do_test_atm(test_verbosely, cgrav, eos_handle, kap_handle)

end program test_atm_quietly
2 changes: 1 addition & 1 deletion fortitude.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[check]
ignore = ["E001","OB001","OB011","P001","P011","P021","T001","T002","T011","T031","T041","T042","S001","S101","S102","M001","M011"]
ignore = ["E001","C001","C003","C061","C071","C072","C092","C121","C131","S061","OB011","PORT011"]
line-length = 200
1 change: 1 addition & 0 deletions ionization/test/src/test_ionization.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
program test_ionization
use test_ionization_support
implicit none
call do_test(.false.)
end program test_ionization
1 change: 1 addition & 0 deletions ionization/test/src/test_ionization_quietly.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
program test_ionization_quietly
use test_ionization_support
implicit none
call do_test(.true.)
end program test_ionization_quietly
1 change: 1 addition & 0 deletions num/private/mod_random.f90
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
module mod_random
use const_def, only: dp

implicit none

contains

Expand Down
35 changes: 14 additions & 21 deletions num/test/make/makefile_base
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ include $(MESA_DIR)/utils/makefile_header
#
# SOURCES

COMMON_SRCS = test_support.o test_int_support.o \
bari_beam.o test_beam.o \
bari_chemakzo.o test_chemakzo.o \
bari_medakzo.o test_medakzo.o \
bari_vdpol.o test_vdpol.o \
test_diffusion.o test_brent.o test_bobyqa.o test_newuoa.o \
test_simplex.o test_newton.o test_integrate.f
COMMON_SRCS = test_support.f90 test_int_support.f90 \
bari_beam.f90 test_beam.f90 \
bari_chemakzo.f90 test_chemakzo.f90 \
bari_medakzo.f90 test_medakzo.f90 \
bari_vdpol.f90 test_vdpol.f90 \
test_diffusion.f90 test_brent.f90 test_bobyqa.f90 test_newuoa.f90 \
test_simplex.f90 test_newton.f90 test_integrate.f90

TEST_SRCS = $(COMMON_SRCS) test_num.o

Expand Down Expand Up @@ -46,9 +46,9 @@ TEST = $(TEST_DIR)/tester
TEST_MPI = $(TEST_DIR)/test_mpi
SAMPLE = $(TEST_DIR)/sample

TEST_OBJS = $(patsubst %.f,%.o,$(patsubst %.f90,%.o,$(TEST_SRCS)))
TEST_MPI_OBJS = $(patsubst %.f,%.o,$(patsubst %.f90,%.o,$(TEST_MPI_SRCS)))
SAMPLE_OBJS = $(patsubst %.f,%.o,$(patsubst %.f90,%.o,$(SAMPLE_SRCS)))
TEST_OBJS = $(patsubst %.f90,%.o,$(TEST_SRCS))
TEST_MPI_OBJS = $(patsubst %.f90,%.o,$(TEST_MPI_SRCS))
SAMPLE_OBJS = $(patsubst %.f90,%.o,$(SAMPLE_SRCS))

all : $(TEST) $(SAMPLE)

Expand Down Expand Up @@ -77,20 +77,14 @@ nodeps : $(.DEFAULT_GOAL)
#
# COMPILATION RULES

%.o : %.f
ifneq ($(QUIET),)
@echo TEST_COMPILE fixed $<
@$(TEST_COMPILE) $(FCfixed) -fimplicit-none $<
else
$(TEST_COMPILE) $(FCfixed)-fimplicit-none $<
endif
COMPILE = $(FCbasic) $(FCopenmp) $(FCopt) $(FCfree)

%.o: %.f90
ifneq ($(QUIET),)
@echo TEST_COMPILE free $<
@$(TEST_COMPILE) $(FCfree) -fimplicit-none $<
@echo TEST_COMPILE $<
@$(TEST_COMPILE) $(COMPILE) $<
else
$(TEST_COMPILE) $(FCfree) -fimplicit-none $<
$(TEST_COMPILE) $(COMPILE) $<
endif

#################################################################
Expand All @@ -99,7 +93,6 @@ endif

SRC_PATH = $(TEST_SRC_DIR)

vpath %.f $(SRC_PATH)
vpath %.f90 $(SRC_PATH)

vpath %.mod $(LOCAL_LIB_DIR):$(MESA_DIR)/include
Expand Down
233 changes: 0 additions & 233 deletions num/test/src/bari_beam.f

This file was deleted.

Loading