mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 09:23:44 +00:00
Add tools for checking Java and C# output.
tools/make_java_csharp_arena_base:
tools/make_java_csharp_arena_diff:
Add these scripts, which can be used to check whether the output
of a new compiler in Java and C# grades is bit-identical to the output
of a known-good old compiler. This is particularly useful on machines
that can't check the correctness of the output in these grades
because they don't have Java or C# compilers installed.
This commit is contained in:
43
tools/make_java_csharp_arena_diff
Executable file
43
tools/make_java_csharp_arena_diff
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
# vim: ft=sh ts=4 sw=4 et
|
||||
#
|
||||
# This script is documented in the companion script make_java_csharp_base.
|
||||
|
||||
if test "${TEST_MMC}" = ""
|
||||
then
|
||||
echo "make_java_csharp_diff: you need to set TEST_MMC in the environment"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
root=`/bin/pwd`
|
||||
|
||||
/bin/rm -fr arena.java arena.csharp > /dev/null 2>&1
|
||||
cp -rp arena.base arena.java
|
||||
cp -rp arena.base arena.csharp
|
||||
|
||||
cd ${root}/arena.java
|
||||
for f in *.m
|
||||
do
|
||||
echo === JAVA ${f} ===
|
||||
${TEST_MMC} --grade java --target-code-only ${f}
|
||||
done
|
||||
|
||||
cd ${root}/arena.csharp
|
||||
for f in *.m
|
||||
do
|
||||
echo === CSHARP ${f} ===
|
||||
${TEST_MMC} --grade csharp --target-code-only ${f}
|
||||
done
|
||||
|
||||
cd ${root}
|
||||
diff -ur arena.base.java arena.java > DIFF.ARENA.JAVA 2>&1
|
||||
diff -ur arena.base.csharp arena.csharp > DIFF.ARENA.CSHARP 2>&1
|
||||
|
||||
echo JAVA DIFF START
|
||||
cat DIFF.ARENA.JAVA
|
||||
echo JAVA DIFF END
|
||||
echo CSHARP DIFF START
|
||||
cat DIFF.ARENA.CSHARP
|
||||
echo CSHARP DIFF END
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user