compiler-script + return tests

This commit is contained in:
Christoph J. Scherr 2022-11-24 19:38:53 +01:00
parent 70f6498bad
commit 39b3ee0664
6 changed files with 35 additions and 0 deletions

BIN
fail Executable file

Binary file not shown.

10
fail.c Normal file
View File

@ -0,0 +1,10 @@
#include <stdio.h>
/*
* This program has the purpose of returning a -1 value, indicating the shell that something has gone wrong
* while the program was running.
*/
int main(){
return -1;
}

BIN
return-specified Executable file

Binary file not shown.

15
return-specified.c Normal file
View File

@ -0,0 +1,15 @@
#include <stdio.h>
#include <stdlib.h>
/*
* This program takes the given argument and returns it as an integer.
* It might be useful to test a shell.
*/
int main(int argc, char** argv){
if(argc<2){
printf("No argument given.\n");
return -1;
}
return atoi(argv[1]);
}

BIN
success Executable file

Binary file not shown.

10
success.c Normal file
View File

@ -0,0 +1,10 @@
#include <stdio.h>
/*
* This program has the purpose of returning a 0 value, indicating to the shell that the program was
* executed successfully.
*/
int main(){
return 0;
}