Skip to content

Add script to test examples with h5*cc pkg-config wrappers #5486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 62 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
362a943
Update examples and add scripts
byrnHDF Apr 24, 2025
371cda2
pkg-config doesn't understand Fflags
byrnHDF Apr 24, 2025
1c462fd
Add test scripts for h5*cc testing
byrnHDF Apr 25, 2025
ecf0753
Add note about test-pc.sh script
byrnHDF Apr 25, 2025
dafdea7
Fix comment symbol
byrnHDF Apr 25, 2025
5b2ff22
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Apr 28, 2025
4805f1c
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Apr 28, 2025
115e354
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Apr 29, 2025
d55a312
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Apr 30, 2025
90f1e1f
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 1, 2025
68b4389
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 5, 2025
dfc277b
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 6, 2025
65b39ff
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 8, 2025
a2130f8
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 8, 2025
785a8e9
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 9, 2025
23a7026
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 13, 2025
f5c95d2
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 15, 2025
4bbed93
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 15, 2025
e783475
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 21, 2025
5b710fb
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 22, 2025
3d1808a
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 22, 2025
af78b01
Merge updates
byrnHDF May 27, 2025
7325f94
Correct missed merge
byrnHDF May 27, 2025
0ccc027
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 27, 2025
6ca2dbb
Update shell scripts with args for paths
byrnHDF May 27, 2025
fb298f6
Add Note for shell script usage
byrnHDF May 27, 2025
1c70909
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 29, 2025
357d318
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 30, 2025
9cb4101
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 30, 2025
e98ebe1
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF May 30, 2025
311f712
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 4, 2025
c320528
Check if pkg-config is available and check if HL libs enabled
byrnHDF Jun 4, 2025
fce499a
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 6, 2025
1637c64
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 9, 2025
5dd3495
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 11, 2025
36a5dde
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 12, 2025
4d67a51
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 13, 2025
0a65ec1
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 13, 2025
4dac2ec
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 17, 2025
8adc0fe
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 17, 2025
85a554f
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 17, 2025
a6c0f9c
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 19, 2025
2cc34c0
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 19, 2025
35287dd
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 20, 2025
724b653
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 20, 2025
52b9ae0
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 23, 2025
2cae66f
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 23, 2025
046dc23
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 26, 2025
0ecdaa8
Correct some issues from reviews
byrnHDF Jun 26, 2025
b06ee19
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 27, 2025
581ec59
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jun 28, 2025
66ff197
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jul 1, 2025
f9bb6c9
add workflow bintest for h5cc scripts
byrnHDF Jul 1, 2025
c5c5683
Add missing args
byrnHDF Jul 1, 2025
5a3c99a
Use absolute paths
byrnHDF Jul 1, 2025
45f3854
Fix path typo
byrnHDF Jul 1, 2025
6556696
Correct path
byrnHDF Jul 1, 2025
2b99acd
Remove duplicate path
byrnHDF Jul 1, 2025
b50bf5b
Correct output name
byrnHDF Jul 1, 2025
25ba6ad
Fix shell if syntax
byrnHDF Jul 1, 2025
8df0296
Fix if statement syntax
byrnHDF Jul 1, 2025
2dab662
Merge branch 'HDFGroup:develop' into develop-sh-exam
byrnHDF Jul 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/cmake-bintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,58 @@ jobs:
cmake --workflow --preset=ci-StdShar-macos-Clang --fresh
shell: bash

test_h5cc_linux:
# Linux (Ubuntu) w/ gcc + CMake
#
name: "Ubuntu h5cc Binary Test"
runs-on: ubuntu-latest
steps:
- name: Install CMake Dependencies (Linux)
run: |
sudo apt-get update
sudo apt-get install ninja-build doxygen graphviz

- name: Set up JDK 19
uses: actions/setup-java@v4
with:
java-version: '19'
distribution: 'temurin'

- name: Get published binary (Linux)
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: tgz-ubuntu-2404_gcc-${{ inputs.build_mode }}-binary
path: ${{ github.workspace }}

- name: Uncompress hdf5 binary (Linux)
run: |
cd "${{ github.workspace }}"
tar -zxvf ${{ github.workspace }}/HDF5-*-Linux.tar.gz --strip-components 1

- name: set hdf5lib name
id: set-hdf5lib-name
run: |
HDF5DIR=${{ github.workspace }}/HDF_Group/HDF5/
FILE_NAME_HDF5=$(ls ${{ github.workspace }}/HDF_Group/HDF5)
echo "HDF5_ROOT=$HDF5DIR$FILE_NAME_HDF5" >> $GITHUB_OUTPUT
echo "HDF5_PLUGIN_PATH=$HDF5_ROOT/lib/plugin" >> $GITHUB_OUTPUT

- name: List files for the binaries (Linux)
run: |
ls -l ${{ github.workspace }}/HDF_Group/HDF5

- name: List files for the space (Linux)
run: |
ls -l ${{ github.workspace }}
ls ${{ runner.workspace }}

- name: Run testpc (Linux)
env:
HDF5_HOME: ${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}
HDF5_PLUGIN_PATH: ${{ steps.set-hdf5lib-name.outputs.HDF5_PLUGIN_PATH }}
run: |
mkdir "${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}/share/build"
cd "${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}/share/HDF5Examples"
sh ./test-pc.sh ${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}/share/HDF5Examples ${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}/share/build .
shell: bash

60 changes: 35 additions & 25 deletions HDF5Examples/C/H5D/test-pc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@
# If you do not have access to either file, you may request a copy from
# [email protected].

# This file is for use of h5cc created with the CMake process
# HDF5_HOME is expected to be set

srcdir=..
builddir=.
# This file is for use of h5cc created with the CMake process.
# Environment variable, HDF5_HOME is expected to be set.
# $1 is the path name of the source directory.
# $2 is the path name of the build directory.
# $3 is the current path name.

top_srcdir=$1
top_builddir=$2
currentpath=$3
verbose=yes
nerrors=0

echo "Current build directory: $top_builddir/$currentpath"

# HDF5 compile commands, assuming they are in your $PATH.
H5CC=$HDF5_HOME/bin/h5cc
LD_LIBRARY_PATH=$HDF5_HOME/lib
Expand Down Expand Up @@ -52,7 +58,7 @@ AWK='awk'
# setup plugin path
ENVCMD="env HDF5_PLUGIN_PATH=$LD_LIBRARY_PATH/plugin"

TESTDIR=$builddir
TESTDIR=$top_builddir/$currentpath


case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
Expand All @@ -65,11 +71,18 @@ ECHO_N="echo $ECHO_N"


exout() {
$*
cd $TESTDIR
"$@"
}

dumpout() {
$H5DUMP $*
cd $TESTDIR
$H5DUMP "$@"
}

compileout() {
cd $TESTDIR
$H5CC "$@"
}

# compare current version, required version.
Expand Down Expand Up @@ -102,29 +115,29 @@ rm -f h5ex_d_extern.data

for topic in $topics
do
$H5CC $srcdir/h5ex_d_$topic.c -o h5ex_d_$topic
compileout $top_srcdir/$currentpath/$dir16/h5ex_d_$topic.c -o h5ex_d_$topic
done

for topic in $topics
do
fname=h5ex_d_$topic
$ECHO_N "Testing C/H5D/$fname...$ECHO_C"
exout .$dir16/$fname >tmp.test
exout ./$fname >tmp.test
status=$?
if test $status -eq 1
then
echo " Unsupported feature"
status=0
else
cmp -s tmp.test $srcdir/tfiles/16/$fname.tst
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/16/$fname.tst
status=$?
if test $status -ne 0
then
echo " FAILED!"
else
dumpout $fname.h5 >tmp.test
rm -f $fname.h5
cmp -s tmp.test $srcdir/tfiles/16/$fname.ddl
rm -f $TESTDIR/$fname.h5
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/16/$fname.ddl
status=$?
if test $status -ne 0
then
Expand Down Expand Up @@ -159,7 +172,7 @@ fi

for topic in $topics18
do
$H5CC $srcdir/h5ex_d_$topic.c -o h5ex_d_$topic
compileout $top_srcdir/$currentpath/h5ex_d_$topic.c -o h5ex_d_$topic
done

for topic in $topics18
Expand All @@ -173,11 +186,9 @@ do
echo " Unsupported feature"
status=0
else
if [[ $fname == "h5ex_d_nbit" ]]
then
if [ "$fname" = "h5ex_d_nbit" ]; then
tdir=$nbitdir
if [[ $USE_ALT == "" ]]
then
if [ "$USE_ALT" = "" ]; then
### set USE_ALT=07 if not set above
USE_ALT="07"
fi
Expand All @@ -186,21 +197,20 @@ do
### unset USE_ALT for the other topics
USE_ALT=""
fi
cmp -s tmp.test $srcdir/tfiles/18/$fname.tst
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/18/$fname.tst
status=$?
if test $status -ne 0
then
echo " FAILED!"
else
if [[ $fname == "h5ex_d_transform" ]]
then
if [ "$fname" = "h5ex_d_transform" ]; then
targ="-n"
else
targ=""
fi
dumpout $targ $fname.h5 >tmp.test
rm -f $fname.h5
cmp -s tmp.test $srcdir/tfiles/$tdir/$fname$USE_ALT.ddl
rm -f $TESTDIR/$fname.h5
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/$tdir/$fname$USE_ALT.ddl
status=$?
if test $status -ne 0
then
Expand All @@ -215,7 +225,7 @@ done


#Remove external data file from h5ex_d_extern
rm -f h5ex_d_extern.data
rm -f tmp.test
rm -f $TESTDIR/h5ex_d_extern.data
rm -f $TESTDIR/tmp.test
echo "$return_val tests failed in C/H5D/"
exit $return_val
Loading
Loading