Skip to content

Commit

Permalink
Fix tests and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Korotkov authored and Konstantin Korotkov committed Aug 14, 2024
1 parent 4f7f240 commit ce60335
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ C++ wrapper for Labs64 NetLicensing [RESTful API](https://netlicensing.io/wiki/r
Visit Labs64 NetLicensing at https://netlicensing.io

## Dependencies
1. C++11 STL
2. [libcurl](https://github.com/curl/curl) (with libcurl's transitive dependencies)
3. [jsoncpp](https://github.com/open-source-parsers/jsoncpp) (included)
1. C++11 toolset + STL
2. cmake
3. [libcurl](https://github.com/curl/curl) (with libcurl's transitive dependencies)
4. [jsoncpp](https://github.com/open-source-parsers/jsoncpp) (included)
5. [boost](https://www.boost.org/) (optional, needed for unit tests)


## Compatibility

Expand All @@ -32,6 +35,7 @@ Windows 10 | Visual studio 14 2015 x86 - x64
Windows 10 | Visual studio 15 2017 x86 - x64
macOS Mojave | Xcode 10.1


## Windows build

### Build curl
Expand All @@ -58,12 +62,13 @@ macOS Mojave | Xcode 10.1
(replace `-G` argument with your actual version / platform, see [`cmake` documentation](https://cmake.org/cmake/help/latest/))
5. Open solution created in `NetLicensingClient-cpp\build` directory in Visual Studio and build the library and demo client.


## Linux build

### Build NetLincesing-cpp
1. Download the latest release and unpack to `NetLicensingClient-cpp` (or checkout [master](https://github.com/Labs64/NetLicensingClient-cpp.git) to build the latest development version)
2. Install **curl** (for development, including C headers and libraries). E.g. in **Ubuntu**:
```sudo apt-get install libcurl4-openssl```
```sudo apt-get install libcurl4-openssl-dev```
3. In the `NetLicensingClient-cpp` directory create `build/` subdirectory
4. Execute:
```
Expand All @@ -77,6 +82,33 @@ macOS Mojave | Xcode 10.1
Unit tests require [**Boost**](https://www.boost.org) Unit Test Framework. To build project with the unit tests activated add cmake option `-DBUILD_TESTS=yes`. The tests must be executed from `tests/` subdirectory on Linux or `tests\Debug\` on Windows in order to properly locate the JSON files with test data.


## Linux build using docker

_TODO: full description_

1. Prepare container
- Image: ubuntu:22.04
- apt-get update
- apt-get install cmake g++ libcurl4-openssl-dev libboost-all-dev

2. Map `NetLicensingClient-cpp` or clone it inside the container

3. Build as described in [Linux Build](#linux-build)


## MacOS build

_TODO: full description_

1. Prepare environment:
- Install XCode 10.1+
- Install `homebrew`
- `libcurl` is provided
- `brew install cmake boost`

2. Build as described in [Linux Build](#linux-build)


## Execution environment

**libcurl** dynamic library should be either installed system-wide or otherwise available for the loading at run-time (typically located in the same directory as your executable)
2 changes: 2 additions & 0 deletions include/netlicensing/mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "netlicensing/token.h"
#include "netlicensing/transaction.h"
#include "netlicensing/licensing_model.h"
#include "netlicensing/license_type.h"
#include "netlicensing/license_template.h"

namespace netlicensing {

Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class TestObserver {
BOOST_AUTO_TEST_SUITE(test_mapper)

BOOST_AUTO_TEST_CASE(initial_test) {
std::string str = read_whole_file("../json/product.json");
std::string str = read_whole_file("product.json");
BOOST_REQUIRE(!str.empty());
Json::Value root;
Json::Reader reader;
Expand Down

0 comments on commit ce60335

Please sign in to comment.