Skip to content

Commit 1f7cd08

Browse files
committed
passing erroneous tests.
1 parent 72a06ec commit 1f7cd08

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

java_sk/encoder.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ def __init__(self, program):
5353
def find_main(self):
5454
mtds = []
5555
for c in self.clss:
56-
mtds = utils.extract_nodes([MethodDeclaration, ConstructorDeclaration], c)
57-
mtds = filter(lambda m: td.isStatic(m) and m.name == u'main', mtds)
58-
lenn = len(mtds)
59-
if lenn > 1:
60-
raise Exception("multiple main()s", mtds)
61-
return mtds[0] if lenn == 1 else None
56+
m = utils.extract_nodes([MethodDeclaration, ConstructorDeclaration], c)
57+
mtds.extend(filter(lambda m: td.isStatic(m) and m.name == u'main', m))
58+
lenn = len(mtds)
59+
if lenn > 1:
60+
raise Exception("multiple main()s", map(lambda m: m.parentNode.name, mtds))
61+
return mtds[0] if lenn == 1 else None
6262

6363
def find_harness(self):
6464
# TODO: these can also be specified with annotations -- we don't support those yet
@@ -74,7 +74,7 @@ def main_cls(self):
7474
harness = self.prg.gsymtab[harness.atr] if harness else None
7575
if main: return main
7676
elif harness: return harness
77-
else: raise Exception("No main(), @Harness, or harness found")
77+
else: raise Exception("No main(), @Harness, or harness found, None")
7878

7979
def to_sk(self):
8080
# clean up result directory

jsk.sh

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
11
#!/bin/bash
22

3-
if [[ $1 == "-test" ]]
4-
then
5-
wd=`pwd`
6-
if [ ! -d $wd/tmp ]; then mkdir -p $wd/tmp
7-
else rm $wd/tmp/*
8-
fi
9-
10-
shift
11-
in=$1
12-
shift
13-
python -m java_sk.main -o result/tmp $wd/$in
14-
15-
diff -Bwr result/tmp results/output
16-
else
17-
python -m java_sk.main -o result $@
18-
fi
3+
python -m java_sk.main -o result $@

0 commit comments

Comments
 (0)