You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**xtest** is a C++ testing framework inspired by [`gtest`][_gtest]. This is just a minimal implementation of a C++ unit testing framework which gives all the required facilities for unit testing a software without going template crazy and causing compilation issues.
64
25
65
-
A better and more robust version of this library is [`GoogleTest`][_gtest] which is developed and maintained by Google. It is a official Google product and is used by many notable projects.
66
-
67
-
<divalign="right">
68
-
<ahref="#top">
69
-
70
-
![Back to top][back_to_top]
71
-
72
-
</a>
73
-
</div>
74
-
75
-
# Commence
76
-
77
-
To download and install library [**xtest**][_xtest] in your system follow the following steps.
78
-
79
-
## Prerequisites
80
-
81
-
You must have a `g++ 9.3.0` or greater version with a `cmake` version `3.16.3` or _higher_ installed in your system.
82
-
83
-
### Ubuntu
84
-
85
-
**Step 1: Install gcc**
86
-
87
-
```shell
88
-
sudo apt update
89
-
sudo apt install build-essential
90
-
```
91
-
92
-
If this is the first time you are installing `g++` then you may also want to install the manual pages about using GNU/Linux for development.
93
-
94
-
```shell
95
-
sudo apt install manpages-dev
96
-
```
97
-
98
-
Verify that the compiler is installed.
99
-
100
-
```shell
101
-
g++ --version
102
-
```
103
-
104
-
and it should print,
105
-
106
-
```shell
107
-
g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
108
-
Copyright (C) 2019 Free Software Foundation, Inc.
109
-
This is free software; see the sourcefor copying conditions. There is NO
110
-
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
111
-
```
112
-
113
-
In the above output **ubuntu1~20.04** is my version, yours may be different.
114
-
115
-
**Step 2: Install cmake**
116
-
117
-
1. Uninstall the default `cmake` version provided by Ubuntu's package manager and configuration by using:
118
-
119
-
```shell
120
-
sudo apt remove --purge --auto-remove cmake
121
-
```
122
-
123
-
OR:
124
-
125
-
```shell
126
-
sudo apt purge --auto-remove cmake
127
-
```
128
-
129
-
This step is crucial if you have a old version of `cmake` installed in your system.
5. As an optional step it is recommended that we also install the kitware-archive-keyring package to ensure that Kitware's keyring stays up to date as they rotate their keys.
152
-
153
-
```shell
154
-
sudo apt update
155
-
sudo apt install kitware-archive-keyring
156
-
sudo rm /etc/apt/trusted.gpg.d/kitware.gpg
157
-
```
158
-
159
-
6. Finally we can update and install the cmake package.
160
-
161
-
```shell
162
-
sudo apt update
163
-
sudo apt install cmake
164
-
```
26
+
A better and more robust version of this library is [`GoogleTest`][_gtest] which is developed and maintained by Google. It is a official Google product and is used by many notable projects.
165
27
166
28
<divalign="right">
167
29
<ahref="#top">
@@ -179,31 +41,13 @@ Clone the repository.
179
41
git clone https://github.com/joshiayush/xtest.git
180
42
```
181
43
182
-
**Build xtest**
183
-
184
-
Next step is to build `xtest` as a shared library using our build system `cmake`.
185
-
186
-
```shell
187
-
cmake -B build/ -S .
188
-
cd build
189
-
make install
190
-
```
191
-
192
-
This will build `xtest` library as `libxtest.so` file inside the `build` directory. Now as the next step you have to create a symbolic link of `libxtest.so` in `/usr/lib/` directory,
Now create symbolic link for the header files inside `/usr/include/C++/9` inside `xtest`,
44
+
**Install `libxtest`**
199
45
200
46
```shell
201
-
sudo mkdir /usr/include/C++/9/xtest
202
-
sudo ln -s /include/** /usr/include/C++/9/xtest
47
+
sudo chmod +x ./tools/install_libxtest.sh
48
+
./tools/install_libxtest.sh
203
49
```
204
50
205
-
Now you are all set.
206
-
207
51
**Build samples**
208
52
209
53
To build samples,
@@ -229,7 +73,7 @@ Now run the `samples`,
229
73
</a>
230
74
</div>
231
75
232
-
# Usage
76
+
##Usage
233
77
234
78
Testing a custom function that returns the sqaure of a given number.
235
79
@@ -256,8 +100,6 @@ Now compile the file and link the `libxtest.so` file with it:
256
100
g++ -lxtest square_test.cc -o square_test
257
101
```
258
102
259
-
For more information on usage see our [wiki](https://github.com/joshiayush/xtest/wiki).
260
-
261
103
<divalign="right">
262
104
<ahref="#top">
263
105
@@ -266,9 +108,7 @@ For more information on usage see our [wiki](https://github.com/joshiayush/xtest
266
108
</a>
267
109
</div>
268
110
269
-
# Contribution
270
-
271
-
Contributions are what makes the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
111
+
## Contribution
272
112
273
113
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement", "bug", or "documentation". Don't forget to give the project a star! Thanks again!
274
114
@@ -282,82 +122,14 @@ Project [**xtest**][_xtest] is hosted on [GitHub][_github]. If you want to contr
282
122
</a>
283
123
</div>
284
124
285
-
# License
286
-
287
-
Distributed under the BSD 3-Clause License. See [`LICENSE`][_xtest_license_f] for more information. Please do not use project [**xtest**][_xtest] if you have any issue with the BSD 3-Clause License.
0 commit comments