![]() |
.. (לתיקייה המכילה) | |
When I'm writing ( myapp < test.in >! myapp.out ) >& myapp.err in a script file everything runs fine, | |
Since the command is in a variable it is now one long string. As we saw in class if you're simply writing $cmd in a script only the first word is considered a command and the other words are discarded. In your case the parenthesis are also causing problems. In order to execute a string in c-shell (and other languages as well) by simply producing it's value from a variable you should use the "eval" command. Simply write "eval $cmd" instead of just "$cmd" and all should work. |
In the testCheck folder, in the test if the compilation succeed it prints 100, and in the pdf it prints "passed". which one is true? | |
Should be as written in the assignment description (i.e. passed/failed). The tests have been updated accordingly. |
When we creates the new files "myApp.out" , "myApp.err" , in page 4 of the pdf, should we delete it when we finished? (it also says in the pdf we shouldn't create new files...) | |
Please read the assignment again carefully. The only temporary files allowed are for the check script for the application executable, and for the output redirections. As for any temporary files, you're always requested to make sure you delete them after you're done using them. |
In case the word ERR is missing from a test template (or OUT), do we need to test diff for experr file or test that an error output file is empty? | |
No. In case the test does not redirect the error stream you should not test anything in regards to the error output. The same goes for the standard output in case OUT is missing from the test template. |
Is the use of goto allowed? How do I enforce an early exit from a script? | |
No, goto is strictly not allowed. You should use "exit" instead. |
In validate - In case there's no file or directory with the given name, what should be printed? | |
<Filename> not found. Where <Filename> is the given argument. |
In validate - In case a line in the configuration file includes exactly 3 columns, should we also validate the columns content? | |
In case a row has exactly 3 columns, you can assume that the first and third column includes non-negative integer numbers, and that the second column includes a valid command template. You cannot assume anything else. |
In case there are multiple arguments which are invalid (e.g. not existing files/directories). Do we need to print to the screen an error message for each one? | |
No. You should only print the first error (according to the list in the assignment) for the first invalid argument. For example, for the following: suspicious missing_file1 missing_file2 valid_file3 you should only print: "missing_file1 not found" |
Can we assume that if ERR or OUT are missing from the template, the program will not print to the screen? | |
No, you cannot. You'll need to handle such output (for example by using /dev/null redirection). You can however, assume that if OUT (or ERR) is used, then it will be used only as the redirection target of the standard output stream (or error stream in case of ERR). Thus, you will not receive lines like: 1 % PROG >! ERR % 100 But you can get lines like: 1 % PROG >! OUT % 100 in which case you'll have to handle the error stream by yourself. |
In validate - In case of errors, should we print the first error we see or the first error according to the error list in the assignment?<br/> | |
You should always print the first error you see, i.e. the first line that has an error. If a line has multiple errors (e.g. invalid index & invalid points) only then, should you follow the order as stated in the assignment. So for the above example, you should print the invalid points error message. Update: The one exception is obviously the case where a given file is a directory. In which case you should print "<filename> is a directory". |
What is the delimiter for the columns in the configuration file? is it "%" or " % " (with spaces). | |
No spaces. Just %. |
In case OUT or ERR are missing, do we need to "capture" those results ourself and compare them against an expected output? | |
No. If OUT and/or ERR are missing, then the test don't care about the results in the missing stream and there will be no expected files of that kind. Thus, you should only check the results of the output channels which appear in the template. |
In suspicious - In case one of the files is missing, should we continue processing other files? | |
No. You need to print the error message and exit. |
Can we use the input files as temp files? | |
No. Writing to the input files counts as using temp files and is forbidden. |
In case OUT is missing, and there's only a redirection to ERR using ">&" both streams are redirected to the error output file. | |
The redirection of the streams to /dev/null is used to avoid printing to the screen and not to manipulate the output files. If the test, only redirected output to the ERR file, the checker intended to check both stderr and stdout in one file. In other words, you're job in this case is fairly simple - just check the error output file. No redirection is needed since no output will be printed to the screen. |
In suspicious - Can we assume we won't get the same file twice? | |
Yes, you may. |
In check - Should the test numbers be those of the input files or the line indexes? | |
Line indexes. test-X corresponds to line (test) number X in the .cfg file. |
Can we use continue in if or while statements? | |
Yes. You may use continue and break as these are not new commands. They are flow constructs which exist in any conditional statement. |
In collect_grades - What should we do if a folder is missing *.c files? | |
You should skip every folder that either don't have id.txt or that the check will fail (for whatever reason). If all folders are skipped you should print the correct error message. |
In collect_grades - can we assume every student submitted only one folder? | |
Yes |
In collect_grades - Should the IDs be sorted according to a numeric or lexicographic order? | |
lexicographic. So the ID "11" is smaller than ID "2". |