Skip to content

Commit

Permalink
Merge branch 'develop' into 3.4.0-beta.1-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
highperformancecoder committed May 14, 2024
2 parents 36760d5 + 0d50dd0 commit a871fd8
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 61 deletions.
2 changes: 1 addition & 1 deletion ecolab
Submodule ecolab updated 1 files
+1 −1 src/plot.cc
2 changes: 1 addition & 1 deletion model/minsky.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ namespace minsky
model->removeGroup(*i);
for (auto& i: canvas.selection.wires)
model->removeWire(*i);
garbageCollect();
canvas.item.reset();
canvas.itemFocus.reset();
#ifndef NDEBUG
garbageCollect();
for (auto& i: canvas.selection.items)
{
if (auto v=i->variableCast())
Expand Down
9 changes: 0 additions & 9 deletions obsCheck/Dockerfile-centos

This file was deleted.

2 changes: 2 additions & 0 deletions obsCheck/Dockerfile-debian
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ RUN apt-get update
RUN apt-get install -y --allow-unauthenticated $project
RUN useradd -m minsky
RUN su - minsky -c minsky --version
RUN apt install -y python3
RUN python3 -c "import pyminsky"
1 change: 1 addition & 0 deletions obsCheck/Dockerfile-fedora
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ RUN dnf config-manager --add-repo https://download.opensuse.org/repositories/hom
RUN dnf install -y $project
RUN useradd -m minsky
RUN su - minsky -c "minsky --version --no-sandbox"
RUN python3 -c "import pyminsky"
3 changes: 2 additions & 1 deletion obsCheck/Dockerfile-leap
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ RUN zypper addrepo https://download.opensuse.org/repositories/home:hpcoder1/${ve
RUN zypper --gpg-auto-import-keys refresh
RUN zypper --non-interactive install $project
RUN useradd -m minsky
RUN su - minsky -c minsky --version
RUN su - minsky -c "minsky --version --no-sandbox"
#RUN python3 -c "import pyminsky"
1 change: 1 addition & 0 deletions obsCheck/Dockerfile-rawhide
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ RUN yum install -y sudo $project --nogpgcheck
RUN useradd -m minsky
RUN chmod 4755 /usr/lib/minsky/chrome-sandbox
RUN sudo -u minsky minsky --version
RUN python3 -c "import pyminsky"
1 change: 1 addition & 0 deletions obsCheck/Dockerfile-tumbleweed
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ RUN zypper --gpg-auto-import-keys refresh
RUN zypper --non-interactive install $project
RUN useradd -m minsky
RUN su - minsky -c minsky --version
RUN python3 -c "import pyminsky"
3 changes: 2 additions & 1 deletion obsCheck/Dockerfile-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ RUN echo "deb http://download.opensuse.org/repositories/home:/hpcoder1/xUbuntu_$
RUN apt-get update -qq -y
RUN apt-get install -y --allow-unauthenticated $project
RUN useradd -m minsky
RUN su - minsky -c "minsky --version --no-sandbox"
#RUN su - minsky -c "minsky --version --no-sandbox"
#RUN python3 -c "import pyminsky"
34 changes: 20 additions & 14 deletions test/00/exportGodley.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,28 @@ pass()

trap "fail" 1 2 3 15

cat >input.tcl <<EOF
minsky.load $here/examples/1Free.mky
minsky.findObject GodleyIcon
minsky.canvas.item.table.exportToLaTeX 1FreeGodley.tex
minsky.canvas.item.table.exportToCSV 1FreeGodley.csv
minsky.load $here/test/testEq.mky
minsky.findObject GodleyIcon
minsky.canvas.item.table.exportToLaTeX testEqGodley.tex
minsky.canvas.item.table.exportToCSV testEqGodley.csv
tcl_exit
cat >input.py <<EOF
import sys
sys.path.append('$here')
from pyminsky import minsky
minsky.load('$here/examples/1Free.mky')
for i in range(len(minsky.model.items)):
item=minsky.model.items[i]
if item.classType()=='GodleyIcon':
item.table.exportToLaTeX('1FreeGodley.tex')
item.table.exportToCSV('1FreeGodley.csv')
break
minsky.load('$here/test/testEq.mky')
for i in range(len(minsky.model.items)):
item=minsky.model.items[i]
if item.classType()=='GodleyIcon':
item.table.exportToLaTeX('testEqGodley.tex')
item.table.exportToCSV('testEqGodley.csv')
break
EOF

$here/gui-tk/minsky input.tcl
python3 input.py
if [ $? -ne 0 ]; then fail; fi

for i in *.tex *.csv; do
Expand Down
57 changes: 23 additions & 34 deletions test/00/findDefinition.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,42 +28,31 @@ pass()

trap "fail" 1 2 3 15

cat >input.tcl <<EOF
source $here/test/assert.tcl
minsky.load $here/test/findDefinition.mky
set msgBox 0
for {set i 0} {\$i<[minsky.model.items.size]} {incr i} {
minsky.model.items.@elem \$i
set item minsky.model.items(\$i)
if {[\$item.visible] && ([regexp "Variable:" [\$item.classType]]||[\$item.classType]=="VarConstant")} {
minsky.canvas.getItemAt [\$item.x] [\$item.y]
set searchItem [minsky.TCLItem]
set findResult [minsky.canvas.findVariableDefinition]
set foundItem [minsky.TCLItem]
switch [\$item.name] {
"undef" {assert "\$findResult==0" undef}
"param1" -
"3" {assert "\"\$searchItem\"==\"\$foundItem\"" paramConst}
"foo" {
assert "[\$foundItem.inputWired]"
assert "[\$item.x]==[\$foundItem.x]" "var coordx fail"
assert "[\$item.y]==[\$foundItem.y]" "var coordy fail"
}
"int" {
assert "\"[\$foundItem.classType]\"==\"IntOp\"" "IntOp"
}
"bar" {
assert "\$findResult"
assert "\"[\$foundItem.classType]\"==\"GodleyIcon\"" "GodleyIcon"
}
}
}
}
tcl_exit
cat >input.py <<EOF
import sys
sys.path.append('$here')
from pyminsky import minsky
minsky.load('$here/test/findDefinition.mky')
for i in range(len(minsky.model.items)):
item=minsky.model.items[i]
if item.visible() and item.classType().startswith("Variable:") or item.classType().startswith("VarConstant"):
minsky.canvas.getItemAt(item.x(), item.y())
findResult=minsky.canvas.findVariableDefinition()
foundItem=minsky.canvas.item()
if item.name()=="undef": assert not findResult,"undef"
if item.name() in ["param1","3"]: assert item.id()==foundItem.id(), "paramConst"
if item.name()=="foo":
assert minsky.canvas.item().inputWired()
assert item.x()==foundItem.x(), "var coordx fail"
assert item.y()==foundItem.y(), "var coordy fail"
if item.name()=="int": assert foundItem.classType()=="IntOp", "IntOp"
if item.name()=="bar":
assert findResult
assert foundItem.classType()=="GodleyIcon", "GodleyIcon"
EOF

$here/gui-tk/minsky input.tcl
python3 input.py
if [ $? -ne 0 ]; then fail; fi

pass

0 comments on commit a871fd8

Please sign in to comment.