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

ENH: Rewrite of testharness (minimal version) #362

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
51 changes: 26 additions & 25 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- testharness_minimal
pull_request:
branches:
- main
Expand All @@ -19,27 +20,27 @@ jobs:
matrix:
name: [ "Build Bionic", "Build Focal", "Build Impish" ]
include:

- name: "Build Bionic"
release: bionic

- name: "Build Focal"
release: focal

- name: "Build Impish"
release: impish

steps:

- name: Check Out Repo
- name: Check Out Repo
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
Expand All @@ -61,51 +62,51 @@ jobs:
matrix:
name: [ "Unit Bionic", "Short Bionic", "Medium Bionic", "Unit Focal", "Short Focal", "Medium Focal", "Unit Impish", "Short Impish", "Medium Impish" ]
include:

- name: "Unit Bionic"
release: bionic
command: "make unittest"
output: "test_results_unittests.xml"
output: "unittests.xml"

- name: "Short Bionic"
release: bionic
command: "make THREADS=2 test"
output: "test_results.xml"
command: "make CORES=2 test"
output: "shorttests.xml"

- name: "Medium Bionic"
release: bionic
command: "make THREADS=2 mediumtest"
output: "test_results_medium.xml"
command: "make CORES=2 mediumtest"
output: "mediumtests.xml"

- name: "Unit Focal"
release: focal
command: "make unittest"
output: "test_results_unittests.xml"
output: "unittests.xml"

- name: "Short Focal"
release: focal
command: "make THREADS=2 test"
output: "test_results.xml"
command: "make CORES=2 test"
output: "shorttests.xml"

- name: "Medium Focal"
release: focal
command: "make THREADS=2 mediumtest"
output: "test_results_medium.xml"
command: "make CORES=2 mediumtest"
output: "mediumtests.xml"

- name: "Unit Impish"
release: impish
command: "make unittest"
output: "test_results_unittests.xml"
output: "unittests.xml"

- name: "Short Impish"
release: impish
command: "make THREADS=2 test"
output: "test_results.xml"
command: "make CORES=2 test"
output: "shorttests.xml"

- name: "Medium Impish"
release: impish
command: "make THREADS=2 mediumtest"
output: "test_results_medium.xml"
command: "make CORES=2 mediumtest"
output: "mediumtests.xml"

steps:

Expand Down Expand Up @@ -143,7 +144,7 @@ jobs:
"gyre_parallel",
"Stokes_square_convection_1e4_vv_p1p1",
"Stokes_square_convection_1e4_p1p1_Ra_Test",
"Stokes_square_convection_1e4_vv_gauss_p2p1",
"Stokes_square_convection_1e4_vv_gauss_p2p1",
"viscous_fs_drunkensailor",
"cylinder-3d-drag",
"viscosity_2d_p0_adaptive_parallel",
Expand Down
58 changes: 26 additions & 32 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (C) 2006 Imperial College London and others.
#
#
# Please see the AUTHORS file in the main source directory for a full list
# of copyright holders.
#
Expand All @@ -9,7 +9,7 @@
# Imperial College London
#
# [email protected]
#
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation,
Expand Down Expand Up @@ -88,23 +88,23 @@ ifeq (@MBA3D@,yes)
LIBMBA3D = lib/libmba3d.a
endif

# Thread count for make test.
THREADS=1
# Logical cores available for make test.
CORES=8

EXCLUDE_TAGS =
ifneq (@HAVE_ZOLTAN@,yes)
EXCLUDE_TAGS := $(EXCLUDE_TAGS) -e zoltan
EXCLUDE_TAGS := $(EXCLUDE_TAGS) -o zoltan
else
EXCLUDE_TAGS := $(EXCLUDE_TAGS) -e nozoltan
EXCLUDE_TAGS := $(EXCLUDE_TAGS) -o nozoltan
endif
ifneq (@MBA2D@,yes)
EXCLUDE_TAGS := $(EXCLUDE_TAGS) -e 2dadapt
EXCLUDE_TAGS := $(EXCLUDE_TAGS) -o 2dadapt
endif
ifneq (@HAVE_EXODUSII@,yes)
EXCLUDE_TAGS := $(EXCLUDE_TAGS) -e exodusii
EXCLUDE_TAGS := $(EXCLUDE_TAGS) -o exodusii
endif
ifneq (@HAVE_ASSESS@,yes)
EXCLUDE_TAGS := $(EXCLUDE_TAGS) -e assess
EXCLUDE_TAGS := $(EXCLUDE_TAGS) -o assess
endif

.SUFFIXES: .f90 .F90 .c .cpp .o .a
Expand Down Expand Up @@ -190,14 +190,14 @@ static: fluidity_library

shared: lib/shared/$(SLIB_FLUIDITY).1

lib/shared/$(SLIB_FLUIDITY).1: fluidity_library
lib/shared/$(SLIB_FLUIDITY).1: fluidity_library
@echo "BUILD shared libfluidity"
@rm -rf tmp
@mkdir -p tmp lib/shared
@cp $(LIB_FLUIDITY) tmp
@cd tmp; ar x lib$(FLUIDITY).a; rm lib$(FLUIDITY).a; cd ..
@echo " LD lib$(FLUIDITY).so"
@$(EVAL) $(LINKER) -shared -Wl,-soname,$(SLIB_FLUIDITY).1 -o lib/shared/$(SLIB_FLUIDITY).1 tmp/* -L./lib -lvtkfortran
@$(EVAL) $(LINKER) -shared -Wl,-soname,$(SLIB_FLUIDITY).1 -o lib/shared/$(SLIB_FLUIDITY).1 tmp/* -L./lib -lvtkfortran
@rm -rf tmp
@cd lib/shared; ln -sf $(SLIB_FLUIDITY).1 $(SLIB_FLUIDITY); cd ../..

Expand Down Expand Up @@ -299,7 +299,7 @@ endif



fldecomp: fluidity_library
fldecomp: fluidity_library
@echo "BUILD fldecomp"
@echo " MKDIR bin"
@mkdir -p bin
Expand Down Expand Up @@ -381,11 +381,11 @@ endif

clean-debian:
@echo " CLEAN debian"
@cd debian; rm -rf files tmp fluidity python-fluidity *.substvars *.debhelper*
@cd debian; rm -rf files tmp fluidity python-fluidity *.substvars *.debhelper*

clean-test:
clean-test:
@echo " CLEAN tests"
@cd tests; PYTHONPATH=../python ../tools/testharness.py --clean >/dev/null
@tools/testharness.py --clean >/dev/null
@cd tests/data; $(MAKE) clean

clean-unittest:
Expand All @@ -404,13 +404,9 @@ clean-unittest:
@echo " CLEAN ocean_forcing/tests"
@cd ocean_forcing/tests; $(MAKE) clean

clean-all-tests: clean-test
@echo " CLEAN parallel/special/long tests"
@PYTHONPATH=python tools/testharness.py --parallelism=parallel --clean >/dev/null
@PYTHONPATH=python tools/testharness.py --length=special --clean >/dev/null
@PYTHONPATH=python tools/testharness.py --length=special --parallelism=parallel --clean >/dev/null
@PYTHONPATH=python tools/testharness.py --length=long --clean >/dev/null
@PYTHONPATH=python tools/testharness.py --length=long --parallelism=parallel --clean >/dev/null
clean-all-tests: clean-test
@echo " CLEAN long and vlong tests"
@tools/testharness.py -l long -l vlong --clean >/dev/null

distclean: clean
@echo " DISTCLEAN"
Expand Down Expand Up @@ -451,21 +447,19 @@ distclean: clean
@find ./ \( -name make.log \) -exec rm -f {} \; > /dev/null
@rm -f Makefile > /dev/null

test: serialtest

serialtest: fltools bin/$(FLUIDITY)
@cd tests; ../bin/testharness -x test_results.xml -l short $(EXCLUDE_TAGS) -n $(THREADS)
test: fltools bin/$(FLUIDITY)
@cd tests; ../bin/testharness -x shorttests.xml -l vshort -l short $(EXCLUDE_TAGS) -n $(CORES)

mediumtest: fltools bin/$(FLUIDITY) manual spudtools
@cd tests; ../bin/testharness -x test_results_medium.xml -l medium $(EXCLUDE_TAGS) -n $(THREADS)
@cd tests; ../bin/testharness -x mediumtests.xml -l medium $(EXCLUDE_TAGS) -n $(CORES)

.PHONY: spudtools

spudtools:
@cd libspud ; $(MAKE) install-spudtools
@echo " INSTALL spudtools"

setuputs:
setuputs:
@echo "SETUP tests"
@echo " RMDIR bin/tests"
@rm -rf bin/tests
Expand Down Expand Up @@ -494,7 +488,7 @@ endif

unittest: build_unittest
@echo "RUN bin/tests"
@bin/unittestharness -d bin/tests -x tests/test_results_unittests.xml
@bin/unittestharness -d bin/tests -x tests/unittests.xml

bin/spud-preprocess:
@echo "Installing spudtools"
Expand Down Expand Up @@ -543,14 +537,14 @@ endif
@cd diagnostics; ../bin/create_makefile --exclude \
"Diagnostic_Fields_Interfaces.F90 Diagnostic_Fields_New.F90" $(TESTOPTS)
@cd diagnostics; $(MAKE) Diagnostic_Fields_Interfaces.o \
Diagnostic_Fields_New.o
Diagnostic_Fields_New.o
@echo " Generating main dependencies"
@cd main; ../bin/create_makefile --exclude test_coupler.F90 $(TESTOPTS)
@echo " Cleaning up the mess"
$(MAKE) clean-light
@echo " Congratulations, make makefiles succeeded!"

install: default fltools
install: default fltools
@mkdir -p $(DESTDIR)$(bindir) $(DESTDIR)$(docdir)/fluidity
find bin/ -maxdepth 1 -type f -exec cp '{}' $(DESTDIR)$(bindir) \;
rm -f $(DESTDIR)$(bindir)/spud-* $(DESTDIR)$(bindir)/diamond $(DESTDIR)$(bindir)/silenteval
Expand All @@ -566,7 +560,7 @@ install: default fltools
cd $(DESTDIR)$(docdir)/fluidity ; tar -czvf $(DESTDIR)$(docdir)/fluidity/examples.tar.gz examples/
rm -rf $(DESTDIR)$(docdir)/fluidity/examples/

install-diamond:
install-diamond:
cd libspud; ./configure --prefix=@prefix@; cd ../..
cd libspud; $(MAKE) clean; cd ../..
cd libspud; $(MAKE) install-diamond; cd ../..
Expand Down
Loading