Skip to content

Commit

Permalink
added third-party tests to CI
Browse files Browse the repository at this point in the history
can run with fpm test
removed old fobis file
  • Loading branch information
jacobwilliams committed May 22, 2022
1 parent a0bf0c7 commit 498b8a7
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 259 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@ Release
# misc
.DS_Store
*.suo
*.pdb
*.pdb

# test artifacts
/*.txt
/*.png
/*.csv
/*.py
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
============

[![GitHub release](https://img.shields.io/github/release/jacobwilliams/Fortran-Astrodynamics-Toolkit.svg?style=plastic)](https://github.com/jacobwilliams/Fortran-Astrodynamics-Toolkit/releases/latest)
[![DOI](https://zenodo.org/badge/21782788.svg)](https://zenodo.org/badge/latestdoi/21782788)
[![Build Status](https://github.com/jacobwilliams/Fortran-Astrodynamics-Toolkit/actions/workflows/CI.yml/badge.svg)](https://github.com/jacobwilliams/Fortran-Astrodynamics-Toolkit/actions)
[![codecov](https://codecov.io/gh/jacobwilliams/Fortran-Astrodynamics-Toolkit/branch/master/graph/badge.svg?token=BHtd51oUTE)](https://codecov.io/gh/jacobwilliams/Fortran-Astrodynamics-Toolkit)
[![DOI](https://zenodo.org/badge/21782788.svg)](https://zenodo.org/badge/latestdoi/21782788)

![Image](https://raw.githubusercontent.com/jacobwilliams/Fortran-Astrodynamics-Toolkit/master/tests/pork_chop/pork_chop.png)

Expand Down Expand Up @@ -63,24 +63,15 @@ fpm build --profile release
fpm test --profile release
```

A [FoBiS](https://github.com/szaghi/FoBiS) configuration file (`fortran-astrodynamics-toolkit.fobis`) is also provided that can build the library and examples. Use the `mode` flag to indicate what to build. For example:

* To build all the examples using gfortran: `FoBiS.py build -f fortran-astrodynamics-toolkit.fobis -mode tests-gnu`
* To build all the examples using ifort: `FoBiS.py build -f fortran-astrodynamics-toolkit.fobis -mode tests-intel`
* To build a static library using gfortran: `FoBiS.py build -f fortran-astrodynamics-toolkit.fobis -mode static-gnu`
* To build a static library using ifort: `FoBiS.py build -f fortran-astrodynamics-toolkit.fobis -mode static-intel`

The full set of modes are: `static-gnu`, `static-gnu-debug`, `static-intel`, `static-intel-debug`, `shared-gnu`, `shared-gnu-debug`, `shared-intel`, `shared-intel-debug`, `tests-gnu`, `tests-gnu-debug`, `tests-intel`, `tests-intel-debug`

To generate the documentation using [ford](https://github.com/Fortran-FOSS-Programmers/ford), run: ```FoBis.py rule --execute makedoc -f fortran-astrodynamics-toolkit.fobis```
To generate the documentation using [ford](https://github.com/Fortran-FOSS-Programmers/ford), run: `ford fortran-astrodynamics-toolkit.md`

## Third-Party Requirements

A script `get_third_party.sh` is included to download and build the third-party dependencies on unix-like operating systems.

### Pyplot-Fortran

The plots generated by the examples are done using the [pyplot-fortran](https://github.com/jacobwilliams/pyplot-fortran) module. When compiling with FPM, this will automatically be downloaded and compiled. If using FoBiS, you must obtain this manually.
The plots generated by the examples are done using the [pyplot-fortran](https://github.com/jacobwilliams/pyplot-fortran) module. When compiling with FPM, this will automatically be downloaded and compiled.

### Ephemeris files

Expand Down
233 changes: 0 additions & 233 deletions fortran-astrodynamics-toolkit.fobis

This file was deleted.

24 changes: 19 additions & 5 deletions fpm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,22 @@ name = "kepler_tests"
source-dir = "tests/kepler"
main = "kepler_tests.f90"

#... the ones that use the third-party components aren't enabled yet ...
# cw_test
# ephemeris_comparison
# fat_tests
# gravity_test
[[test]]
name = "cw_test"
source-dir = "tests/cw_test"
main = "cw_test.f90"

[[test]]
name = "ephemeris_comparison"
source-dir = "tests/ephemeris"
main = "ephemeris_comparison.f90"

[[test]]
name = "fat_tests"
source-dir = "tests/unit_tests"
main = "fat_tests.f90"

[[test]]
name = "gravity_test"
source-dir = "tests/gravity"
main = "gravity_test.f90"
2 changes: 1 addition & 1 deletion src/geopotential_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ subroutine geopotential_module_test()

implicit none

character(len=*),parameter :: gravfile = '../grav/GGM03C.GEO' !! the coefficient file
character(len=*),parameter :: gravfile = './grav/GGM03C.GEO' !! the coefficient file

class(geopotential_model),pointer :: g
type(geopotential_model_mueller) ,target :: g_mueller
Expand Down
6 changes: 3 additions & 3 deletions src/jpl_ephemeris_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ end subroutine get_constants
!
!### Ephemeris files
! This routine requires the DE405 and DE421 JPL binary ephemeris files
! to be present in the `../eph` directory.
! to be present in the `./eph` directory.
! These can be built by using the instructions
! [here](ftp://ssd.jpl.nasa.gov/pub/eph/planets/fortran/userguide.txt).
!
Expand Down Expand Up @@ -915,8 +915,8 @@ subroutine ephemeris_test()
type(jpl_ephemeris) :: eph405, eph421
logical :: status_ok_405,status_ok_421

character(len=*),parameter :: ephemeris_file_405 = '../eph/JPLEPH.405' !! JPL DE405 ephemeris file
character(len=*),parameter :: ephemeris_file_421 = '../eph/JPLEPH.421' !! JPL DE421 ephemeris file
character(len=*),parameter :: ephemeris_file_405 = './eph/JPLEPH.405' !! JPL DE405 ephemeris file
character(len=*),parameter :: ephemeris_file_421 = './eph/JPLEPH.421' !! JPL DE421 ephemeris file

write(*,*) ''
write(*,*) '---------------'
Expand Down
2 changes: 1 addition & 1 deletion src/transformation_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ subroutine transformation_module_test()
3.0_wp] !! km, km/s
real(wp),parameter :: et = zero !! ephemeris time [sec]
real(wp),parameter :: scale = 384400.0_wp !! scale factor [km]
character(len=*),parameter :: ephemeris_file_421 = '../eph/JPLEPH.421' !! JPL DE421 ephemeris file
character(len=*),parameter :: ephemeris_file_421 = './eph/JPLEPH.421' !! JPL DE421 ephemeris file

type(icrf_frame) :: from
type(two_body_rotating_pulsating_frame) :: to
Expand Down
2 changes: 1 addition & 1 deletion tests/cw_test/cw_test.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ program cw_test
real(wp),parameter :: mu_earth = 398600.4418_wp !! grav. param of earth [km3/s2]
real(wp),parameter :: orbit_inc = 45.0_wp*deg2rad !! orbit inclination [rad]
real(wp),parameter :: orbit_sma = 6778.0_wp !! orbit semimajor axis [km]
character(len=*),parameter :: gravfile = '../grav/GGM03C.GEO' !! grav coefficient file
character(len=*),parameter :: gravfile = './grav/GGM03C.GEO' !! grav coefficient file
integer,parameter :: grav_n = 10 !! max degree
integer,parameter :: grav_m = 10 !! max order
real(wp),dimension(3),parameter :: r_chaser_lvlh = [1.0_wp,1.0_wp,1.0_wp] !! chaser r relative to target (LVLH)
Expand Down
2 changes: 1 addition & 1 deletion tests/ephemeris/ephemeris_comparison.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ program ephemeris_comparison
integer :: i
integer :: jd_start, jd_end

character(len=*),parameter :: ephemeris_file_405 = '../eph/JPLEPH.405' !! JPL DE405 ephemeris file
character(len=*),parameter :: ephemeris_file_405 = './eph/JPLEPH.405' !! JPL DE405 ephemeris file

write(*,*) ''
write(*,*) '---------------'
Expand Down
2 changes: 1 addition & 1 deletion tests/gravity/gravity_test.f90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ program gravity_test
real(wp),parameter :: orbit_sma = 6778.0_wp !orbit semimajor axis [km]

!the coefficient file:
character(len=*),parameter :: gravfile = '../grav/GGM03C.GEO'
character(len=*),parameter :: gravfile = './grav/GGM03C.GEO'
integer,parameter :: grav_n = 10 !max degree
integer,parameter :: grav_m = 10 !max order

Expand Down

0 comments on commit 498b8a7

Please sign in to comment.