File: test_odb_split.sh

package info (click to toggle)
odc 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,252 kB
  • sloc: cpp: 21,453; f90: 2,610; python: 382; sh: 365; makefile: 30; sql: 25
file content (42 lines) | stat: -rwxr-xr-x 837 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash

set -uex

# A unique working directory

wd=$(pwd)
test_wd=$(pwd)/test_odb_split

mkdir -p ${test_wd}
cd ${test_wd}

# In case we are resuming from a previous failed run, which has left output in the directory
rm *.odb || true

odc split ../2000010106.odb "2000010106_varno_{varno}.odb"

nfiles=$(ls -lh *.odb | wc -l)

if [[ $nfiles -ne 16 ]]; then
    echo "Got $nfiles output files. Expected 17"
    exit -1
fi

for i in 1,12326 110,10914 112,13609 119,3084678 123,13609 2,8384 206,8881 29,1317 3,61640 39,32 4,61640 41,10192 42,10192 58,9381 7,1349 9,13609; do

    IFS=","
    set $i
    nrows=$(odc count 2000010106_varno_$1.odb)
    if [[ $nrows -ne $2 ]]; then
        echo "Mismatched odb size. Got $nrows rows, expected $2"
        exit -1;
    fi
    unset IFS

done
ls -lh

# Clean up

cd ${wd}
rm -rf ${test_wd}