Skip to content

Commit

Permalink
test(fdb-list): moved it to its own directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mcakircali committed Aug 9, 2024
1 parent 39b27cd commit d8c3ec2
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 15 deletions.
3 changes: 2 additions & 1 deletion tests/fdb/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
list( APPEND fdb_tools_tests
fdb_info
fdb_list
fdb_axes )

foreach( _t ${fdb_tools_tests} )
Expand All @@ -15,3 +14,5 @@ foreach( _t ${fdb_tools_tests} )
endforeach()

add_subdirectory( auxiliary )

add_subdirectory( list )
8 changes: 8 additions & 0 deletions tests/fdb/tools/list/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set(test_name fdb_list)

configure_file( ${test_name}.sh.in ${test_name}.sh @ONLY )

ecbuild_add_test(
TYPE SCRIPT
CONDITION HAVE_FDB_BUILD_TOOLS
COMMAND ${test_name}.sh)
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ try grib_set -s step=6 x.grib 6.grib
try grib_set -s step=9 x.grib 9.grib

for f in *.grib; do
try grib_set -s type=an "$f" "cf.$f"
try grib_set -s type=cf "$f" "cf.$f"
done

for f in *.grib; do
Expand All @@ -55,10 +55,10 @@ exp="{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=fc
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=fc,levtype=sfc}{step=12,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=fc,levtype=sfc}{step=6,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=fc,levtype=sfc}{step=9,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=an,levtype=sfc}{step=0,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=an,levtype=sfc}{step=12,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=an,levtype=sfc}{step=6,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=an,levtype=sfc}{step=9,param=166}"
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=cf,levtype=sfc}{step=0,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=cf,levtype=sfc}{step=12,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=cf,levtype=sfc}{step=6,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=cf,levtype=sfc}{step=9,param=166}"
try test "$exp" = "$out"

# test date depth=1
Expand All @@ -69,23 +69,23 @@ try test "$exp" = "$out"
# test date depth=2
out=$(fdb-list date=20201102 --minimum-keys="" --porcelain --depth=2)
exp="{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=fc,levtype=sfc}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=an,levtype=sfc}"
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=cf,levtype=sfc}"
try test "$exp" = "$out"

# test cf depth=1
out=$(fdb-list type=an --minimum-keys="" --porcelain --depth=1)
out=$(fdb-list type=cf --minimum-keys="" --porcelain --depth=1)
exp="{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}"
try test "$exp" = "$out"

# test cf depth=2
out=$(fdb-list type=an --minimum-keys="" --porcelain --depth=2)
exp="{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=an,levtype=sfc}"
out=$(fdb-list type=cf --minimum-keys="" --porcelain --depth=2)
exp="{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=cf,levtype=sfc}"
try test "$exp" = "$out"

# test cf depth=3
out=$(fdb-list type=an --minimum-keys="" --porcelain --depth=3)
exp="{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=an,levtype=sfc}{step=0,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=an,levtype=sfc}{step=12,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=an,levtype=sfc}{step=6,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=an,levtype=sfc}{step=9,param=166}"
out=$(fdb-list type=cf --minimum-keys="" --porcelain --depth=3)
exp="{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=cf,levtype=sfc}{step=0,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=cf,levtype=sfc}{step=12,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=cf,levtype=sfc}{step=6,param=166}
{class=rd,expver=xxxx,stream=oper,date=20201102,time=0000,domain=g}{type=cf,levtype=sfc}{step=9,param=166}"
try test "$exp" = "$out"
6 changes: 6 additions & 0 deletions tests/fdb/tools/list/local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
type: local
engine: toc
spaces:
- roots:
- path: ./localroot
1 change: 1 addition & 0 deletions tests/fdb/tools/list/x.grib

0 comments on commit d8c3ec2

Please sign in to comment.