diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2024-01-30 18:20:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-30 18:20:58 (GMT) |
commit | 3a3501df2d35babb508fa4944690c564a43c22f5 (patch) | |
tree | 493a2480190f3019f9c359c8aa3b12f2615380d7 /examples | |
parent | 791915e92a291704393cd2e740d658f4e46a8683 (diff) | |
download | hdf5-3a3501df2d35babb508fa4944690c564a43c22f5.zip hdf5-3a3501df2d35babb508fa4944690c564a43c22f5.tar.gz hdf5-3a3501df2d35babb508fa4944690c564a43c22f5.tar.bz2 |
h5 compiler wrappers now pass all arguments passed to it to the compile line (#3954)
* The issue was that the "allargs" variable was not being used in the final command of the compiler wrapper. Any entries containing an escaped quote (\", \') or other non-matching argument (*) would not be passed to the compile line. I have fixed this problem by ensuring all arguments passed to the compiler wrapper are now included in the compile line.
* added testing for compiler wrappers
Diffstat (limited to 'examples')
-rw-r--r-- | examples/testh5cc.sh.in | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/examples/testh5cc.sh.in b/examples/testh5cc.sh.in index 40771ec..f95108d 100644 --- a/examples/testh5cc.sh.in +++ b/examples/testh5cc.sh.in @@ -69,6 +69,8 @@ prog1=${H5TOOL}_prog1.$suffix prog1_o=${H5TOOL}_prog1.o prog2=${H5TOOL}_prog2.$suffix prog2_o=${H5TOOL}_prog2.o +args=${H5TOOL}_args.$suffix +args_o=${H5TOOL}_args.o applib=libapp${H5TOOL}.a # short hands @@ -327,16 +329,38 @@ main (void) } EOF +# Generate args: +# An application main that test misc command line arguments being passed. +cat > $args <<EOF +#include "hdf5.h" +#define H5FILE_NAME "check_args.h5" +int +main (void) +{ + char c = SGL_QUOTE; /* 'H' */ + char *s = DBL_QUOTE; /* "HDF" */ + int val = MISC; /* 42 */ + hid_t file; /* file and dataset handles */ + + file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + H5Fclose(file); + + printf("HDF5 C Sample program ran successfully. File %s generated.\n", H5FILE_NAME); + remove(H5FILE_NAME); + + return 0; +} +EOF # Parse option # None -# Print a line-line message left justified in a field of 70 characters +# Print a line-line message left justified in a field of 71 characters # beginning with the word "Testing". # TESTING() { SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' + echo "Testing $* $SPACES" | cut -c1-71 | tr -d '\012' } @@ -512,6 +536,10 @@ else TOOLTEST $v114main fi +# Group 6: # HDF5 program that depends on input args. +echo "***"Simple Compile and Link in one step with user-supplied arguments. +TOOLTEST -DSGL_QUOTE=\'H\' -DDBL_QUOTE=\"HDF\" -DMISC=42 $args + ############################################################################## # END ############################################################################## |