Merge branch 'qPCR4vir-testing' into hotfix-1.3
This commit is contained in:
commit
02c2553c91
@ -56,7 +56,7 @@ matrix:
|
|||||||
- llvm-toolchain-precise
|
- llvm-toolchain-precise
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- git clone --depth=50 --branch=dev_nana_in_examples https://github.com/qPCR4vir/nana-demo.git nana-demo
|
- git clone --depth=50 --branch=testing https://github.com/qPCR4vir/nana-demo.git nana-demo
|
||||||
- export PATH="$HOME/bin:$PATH"
|
- export PATH="$HOME/bin:$PATH"
|
||||||
- mkdir ~/bin
|
- mkdir ~/bin
|
||||||
- wget --no-check-certificate --no-clobber -O /tmp/tools/cmake https://cmake.org/files/v3.4/cmake-3.4.0-rc3-Linux-x86_64.sh || true
|
- wget --no-check-certificate --no-clobber -O /tmp/tools/cmake https://cmake.org/files/v3.4/cmake-3.4.0-rc3-Linux-x86_64.sh || true
|
||||||
@ -70,6 +70,7 @@ before_script :
|
|||||||
- cd bld
|
- cd bld
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- cmake -G"Unix Makefiles" .. -DNANA_CMAKE_ENABLE_JPEG=ON -DNANA_CMAKE_ENABLE_PNG=OFF -DNANA_CMAKE_BUILD_DEMOS=ON -DNANA_CMAKE_ENABLE_AUDIO=OFF -DNANA_CMAKE_FIND_BOOST_FILESYSTEM=ON -DNANA_CMAKE_INCLUDE_EXPERIMENTAL_DEMOS=ON
|
- cmake -G"Unix Makefiles" .. -DNANA_CMAKE_ENABLE_JPEG=ON -DNANA_CMAKE_ENABLE_PNG=OFF -DNANA_CMAKE_BUILD_DEMOS=ON -DNANA_CMAKE_ENABLE_AUDIO=OFF -DNANA_CMAKE_FIND_BOOST_FILESYSTEM=ON -DNANA_CMAKE_INCLUDE_EXPERIMENTAL_DEMOS=OFF -DNANA_CMAKE_AUTOMATIC_GUI_TESTING=ON -DNANA_CMAKE_ADD_DEF_AUTOMATIC_GUI_TESTING=ON
|
||||||
|
|
||||||
- make
|
- make
|
||||||
|
- ls
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,10 @@ option(NANA_CMAKE_VERBOSE_PREPROCESSOR "Show annoying debug messages during comp
|
|||||||
option(NANA_CMAKE_STOP_VERBOSE_PREPROCESSOR "Stop compilation after showing the annoying debug messages." ON)
|
option(NANA_CMAKE_STOP_VERBOSE_PREPROCESSOR "Stop compilation after showing the annoying debug messages." ON)
|
||||||
option(NANA_CMAKE_BUILD_DEMOS "Build all the demos form the nana_demo repository." OFF)
|
option(NANA_CMAKE_BUILD_DEMOS "Build all the demos form the nana_demo repository." OFF)
|
||||||
option(NANA_CMAKE_INCLUDE_EXPERIMENTAL_DEMOS "" ON)
|
option(NANA_CMAKE_INCLUDE_EXPERIMENTAL_DEMOS "" ON)
|
||||||
|
option(NANA_CMAKE_AUTOMATIC_GUI_TESTING "Activate automatic GUI testing?" OFF)
|
||||||
|
option(NANA_CMAKE_ADD_DEF_AUTOMATIC_GUI_TESTING "Add defoult automatic GUI test?" OFF)
|
||||||
|
option(NANA_CMAKE_BUILD_FreeMe "Build FreeMe (currently broken)?" OFF)
|
||||||
|
|
||||||
|
|
||||||
# The ISO C++ File System Technical Specification (ISO-TS, or STD) is optional.
|
# The ISO C++ File System Technical Specification (ISO-TS, or STD) is optional.
|
||||||
# http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4100.pdf
|
# http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4100.pdf
|
||||||
@ -109,8 +113,6 @@ if(WIN32)
|
|||||||
add_definitions(-DNANA_ENABLE_MINGW_STD_THREADS_WITH_MEGANZ)
|
add_definitions(-DNANA_ENABLE_MINGW_STD_THREADS_WITH_MEGANZ)
|
||||||
endif(NANA_CMAKE_ENABLE_MINGW_STD_THREADS_WITH_MEGANZ)
|
endif(NANA_CMAKE_ENABLE_MINGW_STD_THREADS_WITH_MEGANZ)
|
||||||
endif(MINGW)
|
endif(MINGW)
|
||||||
elseif(WIN32)
|
|
||||||
set(BUILD_FreeMe OFF)
|
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
@ -175,6 +177,22 @@ if(NANA_CMAKE_ENABLE_AUDIO)
|
|||||||
endif(UNIX)
|
endif(UNIX)
|
||||||
endif(NANA_CMAKE_ENABLE_AUDIO)
|
endif(NANA_CMAKE_ENABLE_AUDIO)
|
||||||
|
|
||||||
|
if (NANA_CMAKE_BUILD_FreeMe)
|
||||||
|
add_definitions(-DBUILD_FreeMe)
|
||||||
|
endif (NANA_CMAKE_BUILD_FreeMe)
|
||||||
|
|
||||||
|
|
||||||
|
if(NANA_CMAKE_AUTOMATIC_GUI_TESTING)
|
||||||
|
add_definitions(-DNANA_AUTOMATIC_GUI_TESTING)
|
||||||
|
|
||||||
|
if(NANA_CMAKE_ADD_DEF_AUTOMATIC_GUI_TESTING)
|
||||||
|
add_definitions(-DNANA_ADD_DEF_AUTOMATIC_GUI_TESTING)
|
||||||
|
endif(NANA_CMAKE_ADD_DEF_AUTOMATIC_GUI_TESTING)
|
||||||
|
|
||||||
|
endif(NANA_CMAKE_AUTOMATIC_GUI_TESTING)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(NANA_CMAKE_VERBOSE_PREPROCESSOR)
|
if(NANA_CMAKE_VERBOSE_PREPROCESSOR)
|
||||||
add_definitions(-DVERBOSE_PREPROCESSOR)
|
add_definitions(-DVERBOSE_PREPROCESSOR)
|
||||||
endif(NANA_CMAKE_VERBOSE_PREPROCESSOR)
|
endif(NANA_CMAKE_VERBOSE_PREPROCESSOR)
|
||||||
@ -238,11 +256,36 @@ set_property( TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14 )
|
|||||||
|
|
||||||
if (NANA_CMAKE_BUILD_DEMOS)
|
if (NANA_CMAKE_BUILD_DEMOS)
|
||||||
|
|
||||||
set (demos calculator helloworld_demo notepad widget_show widget_show2 )
|
if(NANA_CMAKE_AUTOMATIC_GUI_TESTING)
|
||||||
|
add_definitions(-DNANA_AUTOMATIC_GUI_TESTING)
|
||||||
|
enable_testing ()
|
||||||
|
endif(NANA_CMAKE_AUTOMATIC_GUI_TESTING)
|
||||||
|
|
||||||
|
if(NANA_CMAKE_ADD_DEF_AUTOMATIC_GUI_TESTING)
|
||||||
|
add_definitions(-DNANA_ADD_DEF_AUTOMATIC_GUI_TESTING)
|
||||||
|
endif(NANA_CMAKE_ADD_DEF_AUTOMATIC_GUI_TESTING)
|
||||||
|
|
||||||
|
set (demos helloworld_demo notepad )
|
||||||
|
|
||||||
|
foreach ( demo ${demos})
|
||||||
|
add_executable(${demo} "../nana-demo/${demo}.cpp")
|
||||||
|
set_property( TARGET ${demo} PROPERTY CXX_STANDARD 14 )
|
||||||
|
target_link_libraries(${demo} ${PROJECT_NAME})
|
||||||
|
#if(NANA_CMAKE_AUTOMATIC_GUI_TESTING)
|
||||||
|
#add_custom_command( TARGET ${demo} POST_BUILD COMMAND ${demo} )
|
||||||
|
#add_custom_target(do_always_${demo} ALL COMMAND ${demo})
|
||||||
|
add_test(${demo} COMMAND ${demo})
|
||||||
|
#endif(NANA_CMAKE_AUTOMATIC_GUI_TESTING)
|
||||||
|
install(TARGETS ${demo} RUNTIME DESTINATION "../nana-demo/")
|
||||||
|
message("... to build: ../nana-demo/${demo}.cpp" )
|
||||||
|
endforeach( demo ${demos})
|
||||||
|
|
||||||
|
set (demos calculator widget_show widget_show2 )
|
||||||
|
|
||||||
if (NANA_CMAKE_INCLUDE_EXPERIMENTAL_DEMOS)
|
if (NANA_CMAKE_INCLUDE_EXPERIMENTAL_DEMOS)
|
||||||
list(APPEND demos file_explorer)
|
list(APPEND demos file_explorer FreeMe)
|
||||||
endif (NANA_CMAKE_INCLUDE_EXPERIMENTAL_DEMOS)
|
endif (NANA_CMAKE_INCLUDE_EXPERIMENTAL_DEMOS)
|
||||||
# Pending: FreeMe
|
# Pending: FreeMe (added but really completelly compiled if defined BUILD_FreeMe )
|
||||||
|
|
||||||
foreach ( demo ${demos})
|
foreach ( demo ${demos})
|
||||||
add_executable(${demo} "../nana-demo/${demo}.cpp")
|
add_executable(${demo} "../nana-demo/${demo}.cpp")
|
||||||
@ -267,10 +310,10 @@ if (NANA_CMAKE_BUILD_DEMOS)
|
|||||||
set_property( TARGET ${demo} PROPERTY CXX_STANDARD 14 )
|
set_property( TARGET ${demo} PROPERTY CXX_STANDARD 14 )
|
||||||
target_link_libraries(${demo} ${PROJECT_NAME})
|
target_link_libraries(${demo} ${PROJECT_NAME})
|
||||||
install(TARGETS ${demo} RUNTIME DESTINATION "../nana-demo/Examples/")
|
install(TARGETS ${demo} RUNTIME DESTINATION "../nana-demo/Examples/")
|
||||||
|
|
||||||
message("... to build: ../nana-demo/Examples/${demo}.cpp" )
|
message("... to build: ../nana-demo/Examples/${demo}.cpp" )
|
||||||
endforeach( demo ${demos})
|
endforeach( demo ${demos})
|
||||||
|
|
||||||
|
|
||||||
endif (NANA_CMAKE_BUILD_DEMOS)
|
endif (NANA_CMAKE_BUILD_DEMOS)
|
||||||
|
|
||||||
|
|
||||||
@ -308,5 +351,7 @@ message ( "NANA_CMAKE_FIND_BOOST_FILESYSTEM = " ${NANA_CMAKE_FIND_BOOST
|
|||||||
message ( "NANA_CMAKE_BOOST_FILESYSTEM_FORCE = " ${NANA_CMAKE_BOOST_FILESYSTEM_FORCE})
|
message ( "NANA_CMAKE_BOOST_FILESYSTEM_FORCE = " ${NANA_CMAKE_BOOST_FILESYSTEM_FORCE})
|
||||||
message ( "NANA_CMAKE_BOOST_FILESYSTEM_INCLUDE_ROOT = " ${NANA_CMAKE_BOOST_FILESYSTEM_INCLUDE_ROOT})
|
message ( "NANA_CMAKE_BOOST_FILESYSTEM_INCLUDE_ROOT = " ${NANA_CMAKE_BOOST_FILESYSTEM_INCLUDE_ROOT})
|
||||||
message ( "NANA_CMAKE_BOOST_FILESYSTEM_LIB = " ${NANA_CMAKE_BOOST_FILESYSTEM_LIB})
|
message ( "NANA_CMAKE_BOOST_FILESYSTEM_LIB = " ${NANA_CMAKE_BOOST_FILESYSTEM_LIB})
|
||||||
|
message ( "NANA_CMAKE_AUTOMATIC_GUI_TESTING = " ${NANA_CMAKE_AUTOMATIC_GUI_TESTING})
|
||||||
|
message ( "NANA_CMAKE_ADD_DEF_AUTOMATIC_GUI_TESTING = " ${NANA_CMAKE_ADD_DEF_AUTOMATIC_GUI_TESTING})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -93,6 +93,21 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////
|
||||||
|
// Support for NANA_AUTOMATIC_GUI_TESTING
|
||||||
|
// Will cause the program to self-test the GUI.
|
||||||
|
// If NANA_ADD_DEF_AUTOMATIC_GUI_TESTING is also defined a default automatic GUI test
|
||||||
|
// will be added to all programs which don't have yet one defined. This default test will simple
|
||||||
|
// wait 10 sec. (time to construct, show and execute the GUI) and then exit normally.
|
||||||
|
//
|
||||||
|
//#define NANA_AUTOMATIC_GUI_TESTING
|
||||||
|
//#if defined(NANA_AUTOMATIC_GUI_TESTING)
|
||||||
|
//#define NANA_ADD_DEF_AUTOMATIC_GUI_TESTING
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined(VERBOSE_PREPROCESSOR)
|
#if !defined(VERBOSE_PREPROCESSOR)
|
||||||
//#define VERBOSE_PREPROCESSOR
|
//#define VERBOSE_PREPROCESSOR
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -15,6 +15,8 @@
|
|||||||
#ifndef NANA_GUI_WVL_HPP
|
#ifndef NANA_GUI_WVL_HPP
|
||||||
#define NANA_GUI_WVL_HPP
|
#define NANA_GUI_WVL_HPP
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "programming_interface.hpp"
|
#include "programming_interface.hpp"
|
||||||
#include "screen.hpp"
|
#include "screen.hpp"
|
||||||
#include "widgets/form.hpp"
|
#include "widgets/form.hpp"
|
||||||
@ -58,6 +60,7 @@ namespace nana
|
|||||||
template<typename Form, bool IsVisible = true>
|
template<typename Form, bool IsVisible = true>
|
||||||
using form_loader = detail::form_loader<Form, IsVisible>;
|
using form_loader = detail::form_loader<Form, IsVisible>;
|
||||||
|
|
||||||
void exec();
|
void exec(unsigned wait = 0, std::function<void()> = {}, unsigned wait_end=0, form *fm= nullptr);
|
||||||
|
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -13,6 +13,20 @@
|
|||||||
|
|
||||||
#include <nana/gui/wvl.hpp>
|
#include <nana/gui/wvl.hpp>
|
||||||
#include <nana/gui/detail/bedrock.hpp>
|
#include <nana/gui/detail/bedrock.hpp>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
|
inline unsigned Wait_or_not(unsigned wait = 0)
|
||||||
|
{
|
||||||
|
#ifdef NANA_AUTOMATIC_GUI_TESTING
|
||||||
|
return wait;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
namespace nana
|
namespace nana
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
@ -23,8 +37,38 @@ namespace nana
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void exec()
|
void exec(unsigned wait, std::function<void()> f, unsigned wait_end, form *fm )
|
||||||
{
|
{
|
||||||
|
#ifdef NANA_ADD_DEF_AUTOMATIC_GUI_TESTING
|
||||||
|
if (!wait)
|
||||||
|
wait = 10;
|
||||||
|
if (!f)
|
||||||
|
f = []() {API::exit(); };
|
||||||
|
#endif
|
||||||
|
|
||||||
|
wait = Wait_or_not(wait);
|
||||||
|
|
||||||
|
std::cout << "Will wait " << wait << " sec...\n";
|
||||||
|
std::thread t([wait, &f, wait_end, fm]()
|
||||||
|
{ if (wait)
|
||||||
|
{
|
||||||
|
std::cout << "Waiting " << wait << " sec...\n";
|
||||||
|
std::this_thread::sleep_for(std::chrono::seconds{ wait } );
|
||||||
|
std::cout << "running... \n" ;
|
||||||
|
f();
|
||||||
|
std::cout << "Done... \n";
|
||||||
|
std::cout << "Now waiting anothers " << wait_end << " sec...\n";
|
||||||
|
std::this_thread::sleep_for(std::chrono::seconds{ wait_end } );
|
||||||
|
std::cout << "Done... \n";
|
||||||
|
if (fm)
|
||||||
|
fm->close();
|
||||||
|
API::exit(); // why not works?
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
detail::bedrock::instance().pump_event(nullptr, false);
|
detail::bedrock::instance().pump_event(nullptr, false);
|
||||||
|
|
||||||
|
if (t.joinable())
|
||||||
|
t.join();
|
||||||
}
|
}
|
||||||
}//end namespace nana
|
}//end namespace nana
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user