Adapted from Austin Schwartz's scripts that he posted on project 2. https://gist.github.com/nawns/3befd88d5bdd39d43e96
These assume you'll be running from the root of the project (ie, alongside src
and bin
.) Have the tests inside p4tests/output
.
See the diagram at the bottom for the intended directory structure.
./test.sh t1.mj
Or a prettier version with side by side diff (requires sdiff)
./test.sh t1.mj -p
And to test everything at once
./testall
.
├── Makefile
├── bin
├──── (truncated)
├── p4tests
│ ├── Expected_Output.pdf
│ ├── Expected_Output.txt
│ ├── List_of_TODO.pdf
│ ├── Or_1.mj
│ ├── output
│ │ ├── t1.mj.out
│ │ ├── t10.mj.out
│ │ ├── t11.mj.out
│ │ ├── t12.mj.out
│ │ ├── t13.mj.out
│ │ ├── t14.mj.out
│ │ ├── t15.mj.out
│ │ ├── t16.mj.out
│ │ ├── t17.mj.out
│ │ ├── t18.mj.out
│ │ ├── t19.mj.out
│ │ ├── t2.mj.out
│ │ ├── t20.mj.out
│ │ ├── t21.mj.out
│ │ ├── t3.mj.out
│ │ ├── t4.mj.out
│ │ ├── t5.mj.out
│ │ ├── t6.mj.out
│ │ ├── t7.mj.out
│ │ ├── t8.mj.out
│ │ └── t9.mj.out
│ ├── output.txt
│ ├── p4output.tar.gz
│ ├── t1.mj
│ ├── t10.mj
│ ├── t11.mj
│ ├── t12.mj
│ ├── t13.mj
│ ├── t14.mj
│ ├── t15.mj
│ ├── t16.mj
│ ├── t17.mj
│ ├── t18.mj
│ ├── t19.mj
│ ├── t2.mj
│ ├── t20.mj
│ ├── t21.mj
│ ├── t3.mj
│ ├── t4.mj
│ ├── t5.mj
│ ├── t6.mj
│ ├── t7.mj
│ ├── t8.mj
│ └── t9.mj
├── src
│ ├── Translate
│ │ ├── Frag.java
│ │ ├── Frame.java
│ │ ├── Temp.java
│ │ └── Tree.java
│ ├── mojo
│ │ ├── Absyn.java
│ │ ├── Error.java
│ │ ├── ProcBody.java
│ │ ├── Scope.java
│ │ └── Translate.java
│ └── x64
│ └── Frame.java
├── test
└── testall