Skip to content

Commit

Permalink
All all unit test call
Browse files Browse the repository at this point in the history
  • Loading branch information
akoumjian committed Sep 9, 2024
1 parent 0f67c22 commit 2187131
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 80 deletions.
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,25 @@ doc:
cd doc/doxygen && doxygen
$(MAKE) -C doc html


# Iterate through each directory in the unit_tests directory and compile the test files
# then run them
test:
@echo "Running tests ..."
@set -e; \
for dir in $(wildcard unit_tests/*); do \
if [ -d $$dir ]; then \
echo "Entering directory $$dir"; \
if $(MAKE) -C $$dir; then \
if [ -f "$$dir/rebound" ]; then \
(cd $$dir && LD_LIBRARY_PATH=$(REB_DIR):. ./rebound); \
else \
echo "No rebound executable found in $$dir"; \
exit 1; \
fi \
else \
echo "Make failed in $$dir"; \
exit 1; \
fi \
fi \
done
15 changes: 6 additions & 9 deletions src/assist.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,17 +416,14 @@ void assist_integrate_or_interpolate(struct assist_extras* ax, double t){
if ( !(dts*(sim->t-sim->dt_last_done) < dts*t && dts*t < dts*sim->t) ){
// Integrate if requested time not in interval of last timestep

// reb_simulation_integrate(sim, t);

// Use reb_simulation_step(r) until t is reached
while (sim->t < t){
reb_simulation_step(sim);
fprintf(stderr, "sim->t: %.17e\n", sim->t);
fprintf(stderr, "dt: %.17e\n", sim->dt);
fprintf(stderr, "dt_last_done: %.17e\n", sim->dt_last_done);
}
reb_simulation_integrate(sim, t);

}

fprintf(stderr, "sim->t: %.17e\n", sim->t);
fprintf(stderr, "dt: %.17e\n", sim->dt);
fprintf(stderr, "dt_last_done: %.17e\n", sim->dt_last_done);
fprintf(stderr, "t: %.17e\n", t);
double h = 1.0-(sim->t -t) / sim->dt_last_done;
if (sim->t - t==0.){
memcpy(ax->current_state, sim->particles, sizeof(struct reb_particle)*sim->N);
Expand Down
46 changes: 0 additions & 46 deletions unit_tests/ephem_init/Makefile

This file was deleted.

25 changes: 0 additions & 25 deletions unit_tests/ephem_init/problem.c

This file was deleted.

0 comments on commit 2187131

Please sign in to comment.