Skip to content

Commit

Permalink
Merge pull request #23 from DrCpp/rc-0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
maltekliemann authored Aug 13, 2021
2 parents d329ff7 + b9cb502 commit c705805
Show file tree
Hide file tree
Showing 246 changed files with 5,435 additions and 6,375 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Linux (install, test)
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
workflow_dispatch:

jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: jurplel/install-qt-action@v2
- uses: lukka/get-cmake@latest
- name: Install libclang
run: |
sudo apt-get update
sudo apt-get install libclang-7-dev
- name: Install drmock-generator
run: pip install drmock-generator
- name: Compile drmock
run: |
cmake . -DCMAKE_INSTALL_PREFIX=install -DCMAKE_PREFIX_PATH=$Qt5_Dir
make
ctest --output-on-failure
env:
DRMOCK_QT_PATH: $Qt5_Dir
31 changes: 31 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: macOS (install, test)
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
workflow_dispatch:

jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: jurplel/install-qt-action@v2
with:
version: '5.15.2'
- uses: lukka/get-cmake@latest
- name: Install drmock-generator
run: pip install drmock-generator
- name: Compile drmock
run: |
cmake . -DCMAKE_INSTALL_PREFIX=install -DCMAKE_PREFIX_PATH=$Qt5_Dir
make
ctest --output-on-failure
env:
DRMOCK_QT_PATH: /Users/runner/work/DrMock/Qt/5.15.2/clang_64 # For some reason, we have to kick macOS a little...
44 changes: 44 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Windows (install, test)
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
workflow_dispatch:

jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: jurplel/install-qt-action@v2
- uses: lukka/get-cmake@latest
- uses: ilammy/msvc-dev-cmd@v1
- uses: crazy-max/ghaction-chocolatey@v1
with:
args: -h
- name: Install libclang
run: |
choco install llvm
- name: Install drmock-generator
run: pip install drmock-generator
- name: Compile drmock
run: |
mkdir build
cd build
cmake .. -G "NMake Makefiles" # -DCMAKE_PREFIX_PATH=%DRMOCK_QT_PATH%
nmake
# No idea why nmake doesn't put these in the right dir
# automatically...
copy src/DrMock.dll tests/DrMock.dll
copy src/DrMock.dll tests/integration/DrMock.dll
ctest --output-on-failure
env:
# DRMOCK_QT_PATH: D:/a/DrMock/Qt/5.15.2/msvc2019_64/
CLANG_LIBRARY_FILE: C:\Program Files\LLVM\bin\libclang.dll

38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# build directory
build/

# vim swap files
*.swp
155 changes: 155 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<!--
Copyright 2019 Ole Kliemann, Malte Kliemann
This file is part of DrMock.
DrMock is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DrMock is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with DrMock. If not, see <https://www.gnu.org/licenses/>.
-->

# Building DrMock


## Dependencies

### Supported platforms

**DrMock** is current supported on the following platforms:

* Windows
* Linux
* macOS


### Installing dependencies

Go through the following steps to ensure that all dependencies are satisfied:

1. Install `cmake` (minimum 3.17):

```
choco install cmake (Windows)
sudo apt-get install cmake (Linux)
brew install cmake (macOS)
```

2. Install `libclang` (minimum 6.0.0):

```
choco install llvm (Windows)
sudo apt-get install libclang-6.0-dev (Linux)
```

On macOS, `libclang` is installed by default.
Note that, it is not sufficient to install the `libclang1-6.0` package
on Linux. Installing later versions of `libclang` should be fine.

3. Install `drmock-generator`:

```
pip install drmock-generator
```


## Building

### Manually

To build and install **DrMock**, run

```
cmake .
make
make install
```

Add whatever `-DCMAKE` directives you wish. Don't forget to set
`CMAKE_PREFIX_PATH` if necessary.

On Windows, CMake may fail to detect the correct `libclang.dll`. If that
is the case, you should set the `CLANG_LIBRARY_FILE` environment
variable to the path of the `libclang.dll`. When using `choco`, then
`C:\Program Files\LLVM\bin\libclang.dll` is usually correct.


### Using the Makefile

To build **DrMock** using the presupplied `Makefile`, proceed as
follows: In the source directory, do `make`, then `make install`. This
will install the **DrMock** cmake package into `build/install`. Move the
contents of that folder wherever you please. For example,
```
rsync -a build/install/ /usr/local
```


## Building with Qt

If you wish to mock `Q_OBJECT`s, set the environment variable
`$DRMOCK_QT_PATH` equal to the location of the Qt library before
following the steps above. Example:
```
export DRMOCK_QT_PATH="$HOME/Qt/5.13.1/clang_64"
```
If you're using the `Makefile` for building, `${DRMOCK_QT_PATH}` will be
used to set the `CMAKE_PREFIX_PATH`. If you're building manually and
haven't already, you will also have to add `${DRMOCK_QT_PATH}` to your
prefix path by using a CMake directive:
```
cmake. -D CMAKE_PREFIX_PATH=$DRMOCK_QT_PATH
```

**Note.** `$DRMOCK_QT_PATH` must be set in order to use **DrMock** with
Qt.


## Troubleshooting

### Installing CMake on Linux

On some Linux systems, CMake 3.17 might not be available via `apt-get`
(this seems to be the case with Ubuntu 18.04). It's not difficult to
build CMake from source, following
[https://cmake.org/install/ ](https://cmake.org/install/).

We've noticed that on a mint Ubuntu 18.04 installation, the following error
occurs during `./bootstrap` (see [CMake not able to find OpenSSL
library](https://stackoverflow.com/questions/16248775/cmake-not-able-to-find-openssl-library)),
which we were able to solve by installing `openssl-dev`:
```
sudo apt-get install libssl-dev
```
(or similar for other package managers).


### `libgl` missing

You might encounter the following on Linux when linking against
`Qt5::Widgets`:
```
${DRMOCK_QT_PATH}/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
Failed to find "GL/gl.h" in "/usr/include/libdrm".
```
The solution is to install `libgl-dev`:
```
sudo apt-get install libgl-dev
```


### Old versions of Python

On many systems, `python` will still point to Python 2.7.x, which has
reached the end of its life on 01/01/2020 (as of January 2020, macOS
Catalina and Ubuntu 18.04 are examples of this).
Using this configuration **DrMock** requires `python` to point to Python (minimum 3.7.0).
We recommend using [pyenv](https://github.com/pyenv/pyenv) for this.
49 changes: 46 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,52 @@ You should have received a copy of the GNU General Public License
along with DrMock. If not, see <https://www.gnu.org/licenses/>.
-->

# DrMock 0.6.0

Released 2021/xx/xx

* Reorganize project structure along the lines of
[vector-of-bool/pitchfork](gi thub.com/vector-of-bool/pitchfork)

* Move utility methods that are used in `mock/` and `test/` to
`utility/`

* Remove python component from this repository (`drmock-generator`, as
it is now called, will be installed using pip in the future)

* Clean up tutorials, add a specification for `drmock-generator`

* Remove broken (and superfluous) pkgconfig

* Add `USING_DRTEST` macro for removing `DRTEST_` prefix from test
macros

* Place data funcs in `DRTEST_NAMESPACE`

* Clean up cmake/DrMockMacros.cmake

* Convert all CMake functions/macros from camelCase to snake_case

* Introduce `drmock_library2` function for list-based mock object code
creation

* Update documentation for public `drmock::` classes

* Replace `MethodCollection` with `Controller`, a composition of a
vector of `Method` objects and a `StateObject`

* Clean up `Controller`/`MethodCollection` error logging

* Remove `QObject` dependency from `Signal`

* Remove need for `DRMOCK_USE_QT` macro

* Remove Qt includes from `Method.h`

* Add `Variant` class to revert interface change of `expects` and
`transition` which made using initializer-lists impossible


# DrMock 0.5.0

Released 2021/06/20
Expand Down Expand Up @@ -84,7 +130,6 @@ Released 2020/08/16
* Add `DRTEST_ASSERT_DEATH` macro for death testing



# DrMock 0.3.0

Released 2020/07/05
Expand Down Expand Up @@ -119,7 +164,6 @@ Released 2020/07/05
documentation regarding this has been clarified)



# DrMock 0.2.0

Released 2020/05/15
Expand Down Expand Up @@ -179,7 +223,6 @@ Released 2020/05/15
* Throw error message if `DrMockTest` can't find files specified in `TESTS`



# DrMock 0.1.0

Released 2020/01/10
Expand Down
Loading

0 comments on commit c705805

Please sign in to comment.