forked from Alepha/Alepha
More progress on the testing front.
This commit is contained in:
@ -26,6 +26,7 @@ add_subdirectory( Testing )
|
|||||||
add_subdirectory( AutoRAII.test )
|
add_subdirectory( AutoRAII.test )
|
||||||
add_subdirectory( comparisons.test )
|
add_subdirectory( comparisons.test )
|
||||||
add_subdirectory( Exception.test )
|
add_subdirectory( Exception.test )
|
||||||
|
add_subdirectory( word_wrap.test )
|
||||||
|
|
||||||
# Sample applications
|
# Sample applications
|
||||||
add_executable( example example.cc )
|
add_executable( example example.cc )
|
||||||
|
@ -1 +1,3 @@
|
|||||||
add_subdirectory( TableTest.test )
|
add_subdirectory( TableTest.test )
|
||||||
|
|
||||||
|
add_library( unit-test SHARED testlib.cc )
|
||||||
|
@ -34,7 +34,7 @@ namespace Alepha::Hydrogen::Testing
|
|||||||
{
|
{
|
||||||
const bool debug= false;
|
const bool debug= false;
|
||||||
const bool debugCaseTypes= false or C::debug;
|
const bool debugCaseTypes= false or C::debug;
|
||||||
using namespace Alepha::exports::console::C;
|
using namespace Alepha::console::C;
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace Utility::exports::evaluation;
|
using namespace Utility::exports::evaluation;
|
||||||
|
@ -32,7 +32,7 @@ namespace Alepha::Hydrogen::Testing
|
|||||||
const bool debugTestRegistration= false or C::debug;
|
const bool debugTestRegistration= false or C::debug;
|
||||||
const bool debugTestRun= false or C::debug;
|
const bool debugTestRun= false or C::debug;
|
||||||
|
|
||||||
using namespace Alepha::exports::C;
|
using namespace Alepha::Hydrogen::exports::C;
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace std::literals::string_literals;
|
using namespace std::literals::string_literals;
|
||||||
@ -227,4 +227,9 @@ namespace Alepha::Hydrogen::Testing
|
|||||||
{
|
{
|
||||||
using namespace detail::testing::exports;
|
using namespace detail::testing::exports;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace exports::inline literals::inline program_option_literals
|
||||||
|
{
|
||||||
|
using namespace detail::testing::exports::literals;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
25
Testing/testlib.cc
Normal file
25
Testing/testlib.cc
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
static_assert( __cplusplus > 2020'00 );
|
||||||
|
|
||||||
|
#include <Alepha/Testing/test.h>
|
||||||
|
#include <Alepha/ProgramOptions.h>
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
namespace impl
|
||||||
|
{
|
||||||
|
int
|
||||||
|
main( const int argcnt, const char *const *const argvec )
|
||||||
|
{
|
||||||
|
// TODO: Have test selection options here and more.
|
||||||
|
const auto args= Alepha::handleOptions( argcnt, argvec );
|
||||||
|
const auto result= Alepha::Testing::runAllTests( args );
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main( const int argcnt, const char *const *const argvec )
|
||||||
|
{
|
||||||
|
return impl::main( argcnt, argvec );
|
||||||
|
}
|
21
word_wrap.test/0.cc
Normal file
21
word_wrap.test/0.cc
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
static_assert( __cplusplus > 2020'00 );
|
||||||
|
|
||||||
|
#include "../word_wrap.h"
|
||||||
|
|
||||||
|
#include <Alepha/Testing/test.h>
|
||||||
|
#include <Alepha/Testing/TableTest.h>
|
||||||
|
#include <Alepha/Utility/evaluation.h>
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
using namespace Alepha::Testing::literals::program_option_literals;
|
||||||
|
using Alepha::Testing::TableTest;
|
||||||
|
}
|
||||||
|
|
||||||
|
static auto init= Alepha::Utility::enroll <=[]
|
||||||
|
{
|
||||||
|
"Does word wrap with no-indent do sensible things?"_test <=TableTest< Alepha::wordWrap >::Cases
|
||||||
|
{
|
||||||
|
{ "Three word with break after first?", { "Goodbye cruel world!", 12, 0 }, "Goodbye \ncruel world!" },
|
||||||
|
};
|
||||||
|
};
|
2
word_wrap.test/CMakeLists.txt
Normal file
2
word_wrap.test/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
link_libraries( unit-test )
|
||||||
|
unit_test( 0 )
|
Reference in New Issue
Block a user