Skip to content

Commit

Permalink
Clean up how C tests are launched in the Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
mauzey1 committed Dec 18, 2024
1 parent 6189f51 commit e9369e9
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,27 @@ backup: clean
@echo "Full backup tar file created : $$TGZNAME")
test: cmor test_C @TEST_FORTRAN@ test_python test_cmip6_cv
@echo "All C, Fortran, and Python tests passed successfully"
test_a_C:
@echo "${OK_COLOR}Testing ${TEST_NAME} ${NO_COLOR}"
@rm -f test_bin/${TEST_NAME}
@@CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/${TEST_NAME}.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ @LDFLAGS@ -o test_bin/${TEST_NAME}
@./test_bin/${TEST_NAME}
test_C: cmor
mkdir -p test_bin
rm -f test_bin/ipcc_test_code ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/ipcc_test_code.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ @LDFLAGS@ -o test_bin/ipcc_test_code @VERB@; ./test_bin/ipcc_test_code @VERB@
rm -f test_bin/test_singletons ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/test_singletons.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ @LDFLAGS@ -o test_bin/test_singletons @VERB@; ./test_bin/test_singletons @VERB@
rm -f test_bin/test_grid ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/test_grid.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ -o test_bin/test_grid @LDFLAGS@ @VERB@; ./test_bin/test_grid @VERB@;
rm -f test_bin/test_grid_unstructured ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/test_cmor_grid_unstructured_fabi.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ -o test_bin/test_grid_unstructured @LDFLAGS@ @VERB@; ./test_bin/test_grid_unstructured @VERB@;
rm -f test_bin/test_grid_unstructured_3d ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/test_cmor_grid_unstructured_3d_fabi.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ -o test_bin/test_grid_unstructured_3d @LDFLAGS@ @VERB@; ./test_bin/test_grid_unstructured_3d @VERB@;
rm -f test_bin/test_cat_unique ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/test_unit_cat_unique.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ @LDFLAGS@ -o test_bin/test_unit_cat_unique @VERB@; ./test_bin/test_unit_cat_unique @VERB@;
rm -f test_bin/test_cmor_append_associated ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/test_cmor_append_associated.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ @LDFLAGS@ -o test_bin/test_cmor_append_associated @VERB@; ./test_bin/test_cmor_append_associated @VERB@;
rm -f test_bin/test_cmor_append_associated_point ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/test_cmor_append_associated_point.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ @LDFLAGS@ -o test_bin/test_cmor_append_associated_point @VERB@; ./test_bin/test_cmor_append_associated_point @VERB@;
rm -f test_bin/test_cmor_singleton_and_generic ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/test_cmor_singleton_and_generic.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ @LDFLAGS@ -o test_bin/test_cmor_singleton_and_generic @VERB@; ./test_bin/test_cmor_singleton_and_generic @VERB@;
rm -f test_bin/test_cmor_nwdFracLut ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/test_cmor_nwdFracLut.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ @LDFLAGS@ -o test_bin/test_cmor_nwdFracLut @VERB@; ./test_bin/test_cmor_nwdFracLut @VERB@;
rm -f test_bin/test_cmor_depth_coord_half ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/test_cmor_depth_coord_half.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ @LDFLAGS@ -o test_bin/test_cmor_depth_coord_half @VERB@; ./test_bin/test_cmor_depth_coord_half @VERB@;
rm -f test_bin/test_sdepth1_float ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/test_sdepth1_float.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ @LDFLAGS@ -o test_bin/test_sdepth1_float @VERB@; ./test_bin/test_sdepth1_float @VERB@;
env TEST_NAME=ipcc_test_code make test_a_C
env TEST_NAME=test_singletons make test_a_C
env TEST_NAME=test_grid make test_a_C
env TEST_NAME=test_cmor_grid_unstructured_fabi make test_a_C
env TEST_NAME=test_cmor_grid_unstructured_3d_fabi make test_a_C
env TEST_NAME=test_unit_cat_unique make test_a_C
env TEST_NAME=test_cmor_append_associated make test_a_C
env TEST_NAME=test_cmor_append_associated_point make test_a_C
env TEST_NAME=test_cmor_singleton_and_generic make test_a_C
env TEST_NAME=test_cmor_nwdFracLut make test_a_C
env TEST_NAME=test_cmor_depth_coord_half make test_a_C
env TEST_NAME=test_sdepth1_float make test_a_C
ifeq ($(UNAME), Linux)
rm -f test_bin/test_lots_of_variables ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@ Test/test_lots_of_variables.c -L@prefix@/lib -I@prefix@/include -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @JSONCLDFLAGS@ @JSONCFLAGS@ @UUIDLDFLAGS@ @UUIDFLAGS@ @LDFLAGS@ -o test_bin/test_lots_of_variables @VERB@; ./test_bin/test_lots_of_variables @VERB@;
env TEST_NAME=test_lots_of_variables make test_a_C
# do something Linux-y
endif
python:
Expand Down

0 comments on commit e9369e9

Please sign in to comment.