melt-umn / copper

An integrated context-aware scanner and parser generator
http://melt.cs.umn.edu/copper
GNU Lesser General Public License v3.0
17 stars 4 forks source link

Create a JUnit test harness for Copper. #12

Closed schwerdf closed 6 years ago

schwerdf commented 7 years ago

Before the new release of Copper, it should be outfitted with its own test harness.

Historically I have avoided creating a test harness based on JUnit to avoid making the Copper build dependent on anything but the Java standard class library and ANT. This independence can be maintained if we move the existing Copper project into a directory Copper and then add a new Eclipse project in a directory CopperTests, with dependency links to the original project and to JUnit.

We can start with a set of regression tests that build each of the existing test grammars and then try to compile the resulting parsers. Later, runtime tests should be added as well, with at least one valid and one invalid input for each parser.

tedinski commented 7 years ago

One possibility is we could switch over to Maven. It can resolve compile-time build dependencies like JUnit and integrates well with Eclipse, I believe.

And... it might be a nice (very) long-term goal to someday have our jars in Maven Central. People could just write Silver code, invoke maven and have it fetch the copper compiler/runtime, silver compiler/runtime/stdlib automatically. Even the appropriate versions according to what the source specifies.

However, it would mean adopting the (seemingly fairly standard) java jar file naming conventions... edu.umn.cs.melt.copper.compiler-0.8.0.jar instead of CopperCompiler.jar for example. I don't think there'd be any other drawbacks, though? (Ah, perhaps reorganizing the repo into two artifacts... the runtime and the compiler.)

schwerdf commented 6 years ago

One runtime test has now been added, which should be enough to detect trouble with the output parsers.