mirror of
https://github.com/boostorg/nowide.git
synced 2026-02-15 01:02:17 +00:00
Add CI for CMake project + consumer test
This commit is contained in:
10
test/exampleProject/CMakeLists.txt
Normal file
10
test/exampleProject/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
# Project testing to consume Boost.Nowide
|
||||
cmake_minimum_required(VERSION 3.8.0)
|
||||
project(nowide_example_project)
|
||||
|
||||
find_package(boost_nowide 10.0 REQUIRED)
|
||||
|
||||
add_executable(example example_main.cpp)
|
||||
target_link_libraries(example PRIVATE Boost::nowide)
|
||||
enable_testing()
|
||||
add_test(NAME example COMMAND example)
|
||||
20
test/exampleProject/example_main.cpp
Normal file
20
test/exampleProject/example_main.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Copyright (c) 2019 Alexander Grund
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <boost/nowide/args.hpp>
|
||||
#include <boost/nowide/convert.hpp>
|
||||
|
||||
int main(int argc, char **argv, char **env)
|
||||
{
|
||||
boost::nowide::args _(argc, argv, env);
|
||||
if(argc < 1)
|
||||
return 1;
|
||||
if(boost::nowide::narrow(boost::nowide::widen(argv[0])) != argv[0])
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user