summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgor Pugin <egor.pugin@gmail.com>2020-03-13 16:32:54 +0300
committerEgor Pugin <egor.pugin@gmail.com>2020-03-13 16:32:54 +0300
commit8dbd344c9bea5eb8f74adbaf51ec666aa9b1c420 (patch)
tree8fb5a4377c23fa9346e6f9bd0a5fefb391e32ad2
parent919ce7b596ebcbb3785e9d4eb0bbb8208b7ef6cb (diff)
[sw] Add test.
-rw-r--r--sw.cpp28
-rw-r--r--test/main.cpp2
2 files changed, 23 insertions, 7 deletions
diff --git a/sw.cpp b/sw.cpp
index 8ae298d..0ab5ecf 100644
--- a/sw.cpp
+++ b/sw.cpp
@@ -1,12 +1,26 @@
void build(Solution &s)
{
auto &tgbot = s.addTarget<StaticLibraryTarget>("reo7sp.tgbot", "1.2.0");
- tgbot += Git("https://github.com/reo7sp/tgbot-cpp", "v{M}.{m}");
+ {
+ tgbot += Git("https://github.com/reo7sp/tgbot-cpp", "v{M}.{m}");
- tgbot.Public += "org.sw.demo.boost.property_tree"_dep;
- tgbot.Public += "org.sw.demo.openssl.ssl"_dep;
- tgbot.Public += "org.sw.demo.boost.system"_dep;
- tgbot.Public += "org.sw.demo.boost.date_time"_dep;
- tgbot.Public += "org.sw.demo.badger.curl.libcurl"_dep, "HAVE_CURL"_def;
- tgbot.Public += "org.sw.demo.boost.asio"_dep;
+ tgbot.Public += "org.sw.demo.boost.property_tree"_dep;
+ tgbot.Public += "org.sw.demo.openssl.ssl"_dep;
+ tgbot.Public += "org.sw.demo.boost.system"_dep;
+ tgbot.Public += "org.sw.demo.boost.date_time"_dep;
+ tgbot.Public += "org.sw.demo.badger.curl.libcurl"_dep, "HAVE_CURL"_def;
+ tgbot.Public += "org.sw.demo.boost.asio"_dep;
+ }
+
+ auto &t = tgbot.addExecutable("test");
+ {
+ t.Scope = TargetScope::Test;
+ t += "test/.*"_rr;
+ t += "test"_idir;
+ t += "SW_BUILD"_def;
+ t += tgbot;
+ t += "org.sw.demo.boost.test"_dep;
+ }
+
+ tgbot.addTest(t);
}
diff --git a/test/main.cpp b/test/main.cpp
index c89e782..d9b0da0 100644
--- a/test/main.cpp
+++ b/test/main.cpp
@@ -1,4 +1,6 @@
+#ifndef SW_BUILD
#define BOOST_TEST_DYN_LINK
+#endif
#define BOOST_TEST_MODULE TgBot
#include <boost/test/unit_test.hpp>