File: runtest.sh

package info (click to toggle)
pymol 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 74,084 kB
  • sloc: cpp: 482,660; python: 89,328; ansic: 29,512; javascript: 6,792; sh: 84; makefile: 25
file content (68 lines) | stat: -rw-r--r-- 1,810 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
##
## Generate PyMOL Session Files (.pse) with different PyMOL versions
## and different "pse_export_version"s, and load them into previous
## program versions.
##

# exit on error
set -e

# where to find PyMOL installations
installprefix="/opt/pymol-"
installsuffix="*/pymol"

# temporary directory
tmpdir=.

# pse_binary_dump=0/1
bin_dump=1

gen() {
    testversions_outer=""
    while [[ $# > 0 ]]; do
        v_in=$1

        # pse_export_version new in PyMOL 1.7.6
        if [[ $v_in < 1.76 ]]; then
            return
        fi

        # for all installations of "v_in" version
        for pymol in $installprefix${v_in}${installsuffix}; do
            echo $pymol
            build=$(basename $(dirname $pymol))
            testversions="$testversions_outer"

            # for all applicable "pse_export_version"s
            for v_out in $*; do
                filename="$tmpdir/$build-ev$v_out.pse"

                # generate session file
                $pymol -ckq makesession.pml \
                    -d "set pse_binary_dump, $bin_dump" \
                    -d "set pse_export_version, $v_out" \
                    -d "save $filename"

                testversions="$v_out $testversions"

                # load session file with older installations
                for v_test in $testversions; do
                    for pymoltest in $installprefix${v_test}${installsuffix}; do
                        echo "TESTING $pymoltest $filename"
                        $pymoltest -ckq $filename verify.py
                    done
                done
            done
        done

        shift
        testversions_outer="$v_in $testversions_outer"
    done
}

# run on these versions
# (must be floats, and must match the installation directories)
gen 2.0 1.86 1.74 1.2

echo DONE