Skip to content

Commit 3b2b815

Browse files
committed
Removed biicode put tests into its own directory
- added make target 'check' for running tests
1 parent a4897c5 commit 3b2b815

File tree

7 files changed

+27
-25
lines changed

7 files changed

+27
-25
lines changed

CMakeLists.txt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
cmake_minimum_required(VERSION 3.9)
2+
project(cmdparser)
3+
4+
enable_testing()
5+
6+
set(CMAKE_CXX_STANDARD 11)
7+
set(CMAKE_CXX_EXTENSIONS OFF)
8+
9+
add_subdirectory(cmdparser.Test EXCLUDE_FROM_ALL)
10+
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --verbose)
11+
add_test(cmdparserTest cmdparser.Test/cmdparserTest)
12+
add_dependencies(check cmdparserTest)
113

2-
ADD_BII_TARGETS()
3-
SET_TARGET_PROPERTIES(${BII_tests_TARGET} PROPERTIES OUTPUT_NAME tests)
414

5-
IF(APPLE)
6-
TARGET_COMPILE_OPTIONS(${BII_BLOCK_TARGET} INTERFACE "-std=c++11 -stdlib=libc++")
7-
ELSEIF (WIN32 OR UNIX)
8-
TARGET_COMPILE_OPTIONS(${BII_BLOCK_TARGET} INTERFACE "-std=c++11")
9-
ENDIF(APPLE)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Simple C++ command line parser
22

3-
This project supplies a simple, single-header, command-line parser. It is very lightweight and relies on templates. The easiest way is to use it is as a dependency via *biicode*. The parser requires C++11 and works fine on gcc (v4.8.2 or later, some earlier versions should work as well), icc (v14 or later), clang and msvc (v18 or later).
3+
This project supplies a simple, single-header, command-line parser. It is very lightweight and relies on templates. The easiest way is to use it by adding it to your source code. The parser requires C++11 and works fine on gcc (v4.8.2 or later, some earlier versions should work as well), icc (v14 or later), clang and msvc (v18 or later).
44

55
## Using the parser
66

biicode.conf

Lines changed: 0 additions & 15 deletions
This file was deleted.

cmdparser.Test/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
set(SOURCE_FILES TestMain.cpp catch.hpp tests.cpp)
2+
add_executable(cmdparserTest ${SOURCE_FILES})
3+
IF(APPLE)
4+
TARGET_COMPILE_OPTIONS(cmdparserTest PUBLIC INTERFACE "-stdlib=libc++")
5+
ENDIF(APPLE)

cmdparser.Test/TestMain.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//
2+
// Created by marcel on 12/21/17.
3+
//
4+
5+
#define CATCH_CONFIG_MAIN
6+
7+
#include "catch.hpp"
8+
File renamed without changes.

tests.cpp renamed to cmdparser.Test/tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
Copyright (c) 2015 - 2016 Florian Rappl
44
*/
55

6-
#define CATCH_CONFIG_MAIN
76
#include "catch.hpp"
8-
#include "cmdparser.hpp"
97
#include <sstream>
8+
#include "../cmdparser.hpp"
109

1110
using namespace cli;
1211

0 commit comments

Comments
 (0)