File: generation.py

package info (click to toggle)
zeroc-ice 3.7.10-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 75,696 kB
  • sloc: cpp: 356,894; java: 226,081; cs: 98,312; javascript: 35,027; python: 28,716; objc: 27,050; php: 7,526; ruby: 7,190; yacc: 2,949; ansic: 2,469; xml: 1,589; lex: 1,241; makefile: 472; sh: 52
file content (32 lines) | stat: -rw-r--r-- 1,092 bytes parent folder | download | duplicates (4)
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
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#

class SliceGenerationTestCase(ClientTestCase):

    def runClientSide(self, current):
        current.write("testing list-generated... ")

        slice2java = SliceTranslator("slice2java")
        current.mkdirs("classes")

        slice2java.run(current,
                       args=["--list-generated", "--output-dir", "classes", "File1.ice", "File2.ice"] +
                       (["--compat"] if current.testsuite.getPath().find("java-compat") >= 0 else []))

        lines1 = slice2java.getOutput(current).strip().split("\n")
        lines2 = open(os.path.join(current.testsuite.getPath(), "list-generated.out"), "r").readlines()
        if len(lines1) != len(lines2):
            raise RuntimeError("failed!")

        i = 0
        while i < len(lines1):
            line1 = lines1[i].strip()
            line2 = lines2[i].strip()
            if line1 != line2:
                raise RuntimeError("failed!")
            i = i + 1
        else:
            current.writeln("ok")

TestSuite(__name__, [ SliceGenerationTestCase() ])