Skip to content

Commit

Permalink
test a gv with multiline comment
Browse files Browse the repository at this point in the history
  • Loading branch information
pmendes committed May 17, 2024
1 parent 6561df4 commit c087daf
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/0022_GVMultilineComment/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 0022_GVMultilineComment

creates a set of four replicate units with a simple binding reaction each using a network file containing a multi-line comment.

## tests

- cps file reads well
- gv file reads well
- produces an expected warning about parameter scan
- produces no other warning or error
- four transport reactions are created
- a reaction between units 3 and 4 is not created (it is inside a comment in the network file)
44 changes: 44 additions & 0 deletions tests/0022_GVMultilineComment/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

# work out our folder name
test=${PWD##*/} # to assign to a variable
test=${test:-/} # to correct for the case where PWD=/

# run sbmodelr
../../sbmodelr -t b -n ../sources/net4mlcomm.gv ../sources/BindingKa.cps 4 > output

fail=0

# compare output and target
difference=$(diff output target_stdout)
if [[ $difference ]]; then
printf 'FAIL %s\n' "${test}"
fail=1
fi

# create model summary
../model_report.py BindingKa_4.cps >/dev/null
if ! [[ $? = 0 ]]; then
printf 'FAIL %s\n' "${test}"
exit -1
fi

# check that there are 4 transport reactions
n=$(grep -Pc "^t_b_[12]-[234]\s+b_[12] = b_[234]" BindingKa_4.summary.txt)
if ((n != 4)) ; then
printf 'FAIL %s\n' "${test}"
let "fail = $fail + 2"
fi

# check if a reaction 3 -- 4 exists
if grep -Pq "^t_b_3-4\s+b_3 = b_4" BindingKa_4.summary.txt; then
printf 'FAIL %s\n' "${test}"
let "fail = $fail + 4"
fi

if [ "$fail" = 0 ] ; then
printf 'PASS %s\n' "${test}"
rm BindingKa_4.summary.txt output *.cps
fi

exit $fail
10 changes: 10 additions & 0 deletions tests/0022_GVMultilineComment/target_stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Processing ../sources/BindingKa.cps
Reactions: 1
Species: 3 (Reactions: 3, Fixed: 0, Assignment: 0, ODE: 0)
Compartments: 1 (Fixed: 1, Assignment: 0, ODE: 0)
Global quantities: 3 (Fixed: 2, Assignment: 1, ODE: 0)
Events: 0 (Only time-dependent: 0, variable-dependent: 0)
Network: undirected (Nodes: 4, Edges: 4)
Warning: in Parameter scan task the scanned or sampled items were converted to those of the first unit only.
created new model BindingKa_4.cps with a set of 4 replicas of ../sources/BindingKa.cps

0 comments on commit c087daf

Please sign in to comment.