diff options
author | Igor Gnatenko <i.gnatenko.brain@gmail.com> | 2018-07-18 15:15:12 +0200 |
---|---|---|
committer | Igor Gnatenko <i.gnatenko.brain@gmail.com> | 2018-07-18 15:15:12 +0200 |
commit | 0f934ad96576a6ecf1b616a5a824cc253abb5b3d (patch) | |
tree | 0d3c372b6adba721e71e9d4fc7370faeddd12d15 | |
parent | 42c934681970381a15aa1714822e65492bd51cc3 (diff) | |
download | libnitrokey-0f934ad96576a6ecf1b616a5a824cc253abb5b3d.tar.gz libnitrokey-0f934ad96576a6ecf1b616a5a824cc253abb5b3d.tar.bz2 |
meson: improve generation of vcs_tag
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
-rw-r--r-- | meson.build | 1 | ||||
-rw-r--r-- | unittest/test_offline.cc | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/meson.build b/meson.build index b14fe0c..258445e 100644 --- a/meson.build +++ b/meson.build @@ -53,6 +53,7 @@ version_cc_in = configure_file( version_cc = vcs_tag( input : version_cc_in, output : 'version.cc', + fallback : 'v@0@'.format(meson.project_version()), ) libnitrokey = library( 'nitrokey', diff --git a/unittest/test_offline.cc b/unittest/test_offline.cc index 92af78c..3f79fa8 100644 --- a/unittest/test_offline.cc +++ b/unittest/test_offline.cc @@ -179,7 +179,7 @@ TEST_CASE("Test version getter", "[fast]") { std::string s = library_version; std::string version("v[0-9]+\\.[0-9]+(\\.[0-9]+)?"); std::string git_suffix("-[0-9]+-g[0-9a-z]+"); - std::regex pattern(version + "(" + git_suffix + "|)"); + std::regex pattern(version + "(" + git_suffix + ")?"); REQUIRE(std::regex_match(s, pattern)); } |