hardly | b1e7e14 | 2014-08-06 00:43:51 +0300 | [diff] [blame] | 1 | #pragma once
|
| 2 |
|
| 3 | // taken from https://gcc.gnu.org/wiki/Visibility
|
| 4 | #if defined _WIN32 || defined __CYGWIN__
|
| 5 | #ifdef BUILDING_DLL
|
| 6 | #ifdef __GNUC__
|
| 7 | #define DLL_PUBLIC __attribute__ ((dllexport))
|
| 8 | #else
|
| 9 | #define DLL_PUBLIC __declspec(dllexport)
|
| 10 | #endif
|
| 11 | #else
|
| 12 | #ifdef __GNUC__
|
| 13 | #define DLL_PUBLIC __attribute__ ((dllimport))
|
| 14 | #else
|
| 15 | #define DLL_PUBLIC __declspec(dllimport)
|
| 16 | #endif
|
| 17 | #endif
|
| 18 | #else
|
| 19 | #ifdef BUILDING_DLL
|
| 20 | #if __GNUC__ >= 4
|
| 21 | #define DLL_PUBLIC __attribute__ ((visibility ("default")))
|
| 22 | #else
|
| 23 | #define DLL_PUBLIC
|
| 24 | #endif
|
| 25 | #else
|
| 26 | #define DLL_PUBLIC
|
| 27 | #endif
|
| 28 | #endif
|
| 29 |
|
onqtam | 862a3bb | 2016-04-27 18:19:00 +0300 | [diff] [blame] | 30 | #define DOCTEST_CONFIG_IMPLEMENT
|
hardly | b1e7e14 | 2014-08-06 00:43:51 +0300 | [diff] [blame] | 31 | #include "doctest.h"
|
| 32 |
|
| 33 | #include <cstdio>
|
| 34 |
|
onqtam | ec75700 | 2016-05-06 01:56:21 +0300 | [diff] [blame] | 35 | TEST_CASE("shared") {
|
hardly | b1e7e14 | 2014-08-06 00:43:51 +0300 | [diff] [blame] | 36 | printf("I am a test in a header used by the executable and the dll!\n");
|
| 37 | }
|
| 38 |
|
| 39 | DLL_PUBLIC int call_tests_from_dll(int argc, char** argv);
|