The C grader checks that your merger program produces the correct merged CSV output, that all operator processes exit successfully, and that there are no zombie processes left behind.
If you received a grader executable with your homework package:
./graderpath/to/grader --merger path/to/merger --build-dir path/to/dir --tests-dir path/to/testsYou can add your own test cases so the grader runs them too. Create a directory (e.g. my_tests) with the same layout as tests: for each test, provide:
tNN.spec – Merger specification:
filename num_chains. The top-level merger always rea the entire CSV file; there is no merger-level line range.start_line end_line pipeline..., where start_line and end_line are 1-based line numbers in the top-level CSV file.merger, the next block in the spec describes a sub-merger.num_chains (no filename) and then num_chains chain lines. For sub-mergers, start_line/end_line are relative to the sub-merger’s own input block (line 1 is the first line that sub-merger receives on stdin).tNN.csv – CSV data file.tNN.expected – Expected merged data only (no exit status lines). The grader never uses this file to check exit status; it is used only for the CSV data comparison.Then run:
./grader --extra-tests my_tests
Or use only your own test directory:
./grader --tests-dir my_tests
The grader verifies operator exit status using a dedicated communication channel, not by looking at the expected output file:
HW1_EXIT_REPORT to point to a per-test log file before running your merger.sort, filter, unique) is provided to you. They install an atexit handler that appends a line pid status to HW1_EXIT_REPORT when the process terminates.merger must, for every operator process it spawns (including those inside sub-mergers), write a line of the form EXIT-STATUS <pid> <status> to its standard output. These EXIT-STATUS lines may appear anywhere in the output; the grader scans the whole stream and ignores them when comparing CSV data to tNN.expected.EXIT-STATUS lines it sees in the output against the lines in the HW1_EXIT_REPORT file (same pid status pairs, and the expected number of operators). If HW1_EXIT_REPORT is unavailable, it falls back to counting operators from the spec and requiring that many EXIT-STATUS ... 0 lines.In summary: the expected files check only data. Operator exit status is checked via EXIT-STATUS lines and the HW1_EXIT_REPORT operator→grader log.