ice icon indicating copy to clipboard operation
ice copied to clipboard

Cleanup `cpp/test/Slice/errorDetection` Testing

Open InsertCreativityHere opened this issue 1 year ago • 0 comments

I was checking the C++ Code Coverage report, and to my surprise, parts of slice2java were being hit! Same for the other compilers.

After some searching, it turns out that the cpp/Slice/errorDetection test actually runs all the compilers. We have this little bit slapped on the end of our test script in that folder:

            current.write("Forward.ice... ")
            for language in [
                "cpp",
                "cs",
                "html",
                "java",
                "js",
                "matlab",
                "php",
                "py",
                "rb",
                "swift",
            ]:
                compiler = SliceTranslator("slice2%s" % language)
                if not os.path.isfile(compiler.getCommandLine(current)):
                    continue
                compiler.run(
                    current, args=["forward/Forward.ice", "--output-dir", "tmp"]
                )
  1. We should remove html from this list. slice2html is long dead. We should also remove this logic where we just silently skip any compilers that don't exist. If something in this list is bogus, we should obviously see an error for it.

  2. We're only testing the compilers over Forward.ice, a very small file: module test { class F; }. Either we should just completely remove this testing (because it is unexpected that a cpp test is running the other compilers). Or we should at least expand this testing and run the compilers on a less useless Slice file.

InsertCreativityHere avatar Dec 10 '24 19:12 InsertCreativityHere