Skip to content

Commit ab319f0

Browse files
committed
🎉
1 parent 91ed0ec commit ab319f0

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

Functions/clib/clib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/* file: functions.h
1+
/* file: clib.h
22
author: David De Potter
3-
description: header file for the functions library
3+
description: header file for the clib library
44
*/
55

66
#ifndef FUNCTIONS_H_INCLUDED

Functions/libex1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
file: libex1.c
33
author: David De Potter
4-
description: example program using functions from Functions library
4+
description: example program using functions from clib library
55
Program asks for a pos. integer and prints some of its properties
66
compilation: ../ctest.sh libex1.c
77
usage: ./a.out

Functions/libex2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
file: libex2.c
33
author: David De Potter
4-
description: example program for using the functions library
4+
description: example program for using the clib library
55
Compile with the test script and feed it the input file:
66
../ctest.sh libex2.c
77
Usage: ./a.out <input.txt

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ If you want to use the script, you basically have two options:
6060
Opening a terminal from the working directory containing your program, the solution, and the folder with the tests, run the below commands.
6161
First, make the script executable:
6262

63-
```linux
63+
```shell
6464
chmod +x ../../../ctest.sh
6565
```
6666

6767
Then run the script by using the following command:
6868

69-
```linux
69+
```shell
7070
../../../ctest.sh myprogram.c
7171
```
7272

@@ -75,27 +75,27 @@ Then run the script by using the following command:
7575
Alternatively, you can add the script to your PATH variable and run it from anywhere.
7676
To display the current $PATH, run the following command:
7777

78-
```linux
78+
```shell
7979
echo $PATH
8080
```
8181

8282
Then, copy the script to one of the folders in $PATH. If you have copied the script to the folder before, the command will simply overwrite the previous version. For example:
8383

84-
```linux
84+
```shell
8585
sudo cp ctest.sh /usr/bin/
8686
```
8787

8888
Now you can run the script from the directory containing your program and the folder with test cases by using the following command:
8989

90-
```linux
90+
```shell
9191
ctest.sh myprogram.c
9292
```
9393

9494
&nbsp;
9595

9696
You may also choose to redirect the output to a file, in which case the color codes will be removed automatically to render a plain text file:
9797

98-
```linux
98+
```shell
9999
ctest.sh myprogram.c > results.txt
100100
```
101101

@@ -119,11 +119,15 @@ The script was tested on Ubuntu 22.04 LTS, using GCC 13.1.0, Valgrind 3.18.1, an
119119

120120
If you want to compile and test your code manually, you can use the following commands:
121121

122-
```linux
122+
```shell
123123
gcc -O2 -std=c99 -pedantic -Wall -o a.out myprogram.c -lm
124-
valgrind --leak-check=full ./a.out < tests/input.in
124+
```
125+
126+
```shell
127+
valgrind --leak-check=full ./a.out < tests/1.in
125128
```
126129

130+
127131
&nbsp;&nbsp;&nbsp;
128132

129133
## ${\color{cadetblue}\text{Output example of the script}}$

0 commit comments

Comments
 (0)