star-3d

Surface structuring for efficient 3D geometric queries
git clone git://git.meso-star.fr/star-3d.git
Log | Files | Refs | README | LICENSE

commit 6e0ccab1076c28a4f0d20bde62b60d595bbae147
parent 7040437fd26cab9f514423f6451eb891f62431a9
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Sat,  6 May 2023 19:17:26 +0200

Do not build tests in the src directory

This commit reverses an update to the previous commit where it seemed
less error-prone to infer the test binary from its sources. However,
this choice is less flexible since in this case all tests must use the
same linker command. If this is the case now, it remains to be seen
whether this will always be the case.

Diffstat:
MMakefile | 21+++++++++++++++++++--
Mmake.sh | 8++++----
2 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile @@ -153,5 +153,22 @@ clean_test: $(TEST_OBJ): config.mk $(CC) -std=c89 $(CFLAGS_$(BUILD_TYPE)) $(RSYS_INC) -c $(@:.o=.c) -o $@ -$(TEST_OBJ:.o=): - $(CC) -o $@ $@.o $(LDFLAGS) -L$$(pwd) -ls3d $(RSYS_LIB) +test_s3d_accel_struct_conf \ +test_s3d_closest_point \ +test_s3d_device \ +test_s3d_primitive \ +test_s3d_sampler \ +test_s3d_sample_sphere \ +test_s3d_scene \ +test_s3d_scene_view_aabb \ +test_s3d_scene_view \ +test_s3d_seams \ +test_s3d_shape \ +test_s3d_sphere_box \ +test_s3d_sphere \ +test_s3d_sphere_instance \ +test_s3d_trace_ray \ +test_s3d_trace_ray_instance \ +test_s3d_trace_ray_sphere \ +: + $(CC) -o $@ src/$@.o $(LDFLAGS) -L$$(pwd) -ls3d $(RSYS_LIB) diff --git a/make.sh b/make.sh @@ -32,8 +32,8 @@ config_test() { for i in "$@"; do test=$(basename "${i}" ".c") - test_list="${test_list} src/${test}" - printf "%s: %s\n" "src/${test}" "src/${test}.o" + test_list="${test_list} ${test}" + printf "%s: %s\n" "${test}" "src/${test}.o" done printf "test_bin: %s\n" "${test_list}" } @@ -45,7 +45,7 @@ check() shift 2 printf "%s " "${name}" - if ./src/"${prog}" "$@" > /dev/null 2>&1; then + if ./"${prog}" "$@" > /dev/null 2>&1; then printf "\e[1;32mOK\e[m\n" else printf "\e[1;31mError\e[m\n" @@ -69,7 +69,7 @@ run_test() clean_test() { for i in "$@"; do - rm -f "src/$(basename "${i}" ".c")" + rm -f "$(basename "${i}" ".c")" done }