Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding do-nothing
tests/fortran
directory.
The `Makefile` depends on `test.f90` as the main program that runs tests.
- Loading branch information
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
CURR_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
SRC_DIR := $(realpath $(CURR_DIR)/../../src/bezier) | ||
QUADPACK_DIR := $(realpath $(SRC_DIR)/quadpack) | ||
|
||
FC = gfortran | ||
F77 = .f | ||
F90 = .f90 | ||
OBJ = .o | ||
FCFLAGS = -fPIC -O3 | ||
|
||
# NOTE: **Must** specify the order for source files. | ||
F77_SOURCES := \ | ||
$(QUADPACK_DIR)/d1mach$(F77) \ | ||
$(QUADPACK_DIR)/dqelg$(F77) \ | ||
$(QUADPACK_DIR)/dqpsrt$(F77) \ | ||
$(QUADPACK_DIR)/dqk21$(F77) \ | ||
$(QUADPACK_DIR)/dqagse$(F77) | ||
F90_SOURCES := \ | ||
$(SRC_DIR)/types$(F90) \ | ||
$(SRC_DIR)/helpers$(F90) \ | ||
$(SRC_DIR)/curve$(F90) \ | ||
$(SRC_DIR)/surface$(F90) \ | ||
$(SRC_DIR)/curve_intersection$(F90) | ||
F77_OBJS := $(patsubst $(QUADPACK_DIR)/%$(F77), $(QUADPACK_DIR)/%$(OBJ), $(F77_SOURCES)) | ||
F90_OBJS := $(patsubst $(SRC_DIR)/%$(F90), $(SRC_DIR)/%$(OBJ), $(F90_SOURCES)) | ||
|
||
test: $(CURR_DIR)/test-bin | ||
$(CURR_DIR)/test-bin | ||
|
||
$(SRC_DIR)/%$(OBJ): $(SRC_DIR)/%$(F90) | ||
$(FC) $(FCFLAGS) -c $< -o $@ | ||
|
||
$(QUADPACK_DIR)/%$(OBJ): $(QUADPACK_DIR)/%$(F77) | ||
$(FC) $(FCFLAGS) -c $< -o $@ | ||
|
||
$(CURR_DIR)/test-bin: $(F77_OBJS) $(F90_OBJS) $(CURR_DIR)/test.f90 | ||
$(FC) $(FCFLAGS) \ | ||
-o $(CURR_DIR)/test-bin \ | ||
$(F77_OBJS) \ | ||
$(F90_OBJS) \ | ||
$(CURR_DIR)/test.f90 | ||
|
||
clean: | ||
rm -f $(CURR_DIR)/*.mod | ||
rm -f $(SRC_DIR)/*$(OBJ) | ||
rm -f $(QUADPACK_DIR)/*$(OBJ) | ||
rm -f $(CURR_DIR)/test-bin | ||
|
||
.PHONY: all test clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Unit Tests for Fortran Surface of `libbezier` | ||
|
||
This is so that the Fortran source can evolve without | ||
having to have an equivalent Python function for every | ||
piece of code. | ||
|
||
To run the tests, simply run `make test` from this directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
program test | ||
|
||
use types, only: dp | ||
implicit none | ||
|
||
print *, dp | ||
|
||
end program test |