Compiler 2015: Phase 2: Testing environment specification - midterm
外观
How a submission is judged in this phase
- Boot a virtual machine in vbox of Ubuntu 14.04 with openjdk 1.8.0_45
git clone
one's compiler2015- (IMPORTANT)
git checkout midterm
, the version with the 'midterm' tag is literally the most important one. Do push tags! - To judge this submission (e.g.
abc/compiler2015/
)- Kill all irrelevant processes
- Setup a new bash process
- Reset environment variables
cd abc/compiler2015/
make clean
# delete the bin dirmake all
# compile your code, please put your executables in a bin directory. A makefile is required!source midtermvars.sh
# setup environment variables for mid-term testing. Define $CCHK in this script.cd bin
- For each test case, copy the test case to abc/compiler2015/bin/data.c
$CCHK < data.c
- Check
$?
(the exit status); 0 for OK, 1 for error - Don't output too much debug information to standard output in your submission. Please only return 0 or 1.
Notes
You need a Makefile for this mid-term testing. If you don't know how to write a Makefile, read http://mrbook.org/tutorials/make/
Note that you also need a Makefile even if you want to compile Java using ant or maven.
For each test case, your compiler is required to exit normally. Write operations to the file system are prohibited.
You can setup environment variables as follows, according to your Makefile:
export CCHK=java -cp .:classes/ cc.midterm.Main
or
export CCHK=java -jar midterm.jar
or
export CCHK=./c_compiler
In Java, use System.exit(...)
to specify the exit status. In C, use exit(...)
to specify the exit status.
Standard-library Functions
printf malloc getchar