[DEV] update new lutin 0.8.0

This commit is contained in:
Edouard DUPIN 2015-10-14 21:21:03 +02:00
parent 991fe08bac
commit 293e32b2b4
6 changed files with 131 additions and 86 deletions

View File

@ -3,22 +3,33 @@ import lutin.module as module
import lutin.tools as tools import lutin.tools as tools
import datetime import datetime
def get_type():
return "BINARY"
def get_sub_type():
return "TEST"
def get_desc(): def get_desc():
return "e-tk test software" return "e-tk test software"
def get_licence():
return "APACHE-2"
def create(target): def get_compagny_type():
# module name is 'edn' and type binary. return "com"
my_module = module.Module(__file__, 'etk-test', 'BINARY')
# add the file to compile: def get_compagny_name():
return "atria-soft"
def get_maintainer():
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
def create(target, module_name):
my_module = module.Module(__file__, module_name, get_type())
my_module.add_src_file([ my_module.add_src_file([
'test/main.cpp']) 'test/main.cpp'
])
my_module.add_module_depend(['etk', 'gtest']) my_module.add_module_depend(['etk', 'gtest', 'test-debug'])
#my_module.compile_flags_XX(["-nostdinc++"]);
# add the currrent module at the system
return my_module return my_module

View File

@ -2,14 +2,30 @@
import lutin.module as module import lutin.module as module
import lutin.tools as tools import lutin.tools as tools
def get_type():
return "LIBRARY"
def get_desc(): def get_desc():
return "e-tk : Ewol tool kit" return "Ewol tool kit"
def get_licence():
return "APACHE-2"
def create(target): def get_compagny_type():
# module name is 'edn' and type binary. return "com"
my_module = module.Module(__file__, 'etk', 'LIBRARY')
# add extra compilation flags : def get_compagny_name():
return "atria-soft"
def get_maintainer():
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
def get_version():
return [0,0,0]
def create(target, module_name):
my_module = module.Module(__file__, module_name, get_type())
my_module.add_extra_compile_flags() my_module.add_extra_compile_flags()
# add the file to compile: # add the file to compile:
my_module.add_src_file([ my_module.add_src_file([
@ -64,8 +80,7 @@ def create(target):
if target.name != "Windows": if target.name != "Windows":
my_module.add_export_flag('link', "-ldl -rdynamic") my_module.add_export_flag('link', "-ldl -rdynamic")
my_module.compile_version_XX(2011) my_module.compile_version("c++", 2011)
# name of the dependency
my_module.add_optionnal_module_depend('minizip', ["c++", "-DETK_BUILD_MINIZIP"]) my_module.add_optionnal_module_depend('minizip', ["c++", "-DETK_BUILD_MINIZIP"])
my_module.add_optionnal_module_depend('linearmath', ["c", "-DETK_BUILD_LINEARMATH"], export=True) my_module.add_optionnal_module_depend('linearmath', ["c", "-DETK_BUILD_LINEARMATH"], export=True)
@ -77,8 +92,6 @@ def create(target):
my_module.add_export_flag('link', "-lpthread") my_module.add_export_flag('link', "-lpthread")
my_module.add_path(tools.get_current_path(__file__)) my_module.add_path(tools.get_current_path(__file__))
# add the currrent module at the
return my_module return my_module

View File

@ -7,7 +7,7 @@
*/ */
#include <etk/types.h> #include <etk/types.h>
#include <etk/debug.h> #include <test-debug/debug.h>
#include <vector> #include <vector>
#include <string> #include <string>
#include <etk/Hash.h> #include <etk/Hash.h>

View File

@ -23,7 +23,7 @@ TEST(TestEtkColor, RGBA8) {
void testColor() { void testColor() {
TK_INFO("==> test of COLOR (START)"); TEST_INFO("==> test of COLOR (START)");
etk::Color<uint8_t, 4> colorRGBA8(0x52,0x0F, 0x65, 0x44); etk::Color<uint8_t, 4> colorRGBA8(0x52,0x0F, 0x65, 0x44);
etk::Color<uint16_t, 4> colorRGBA16(0x52,0x0F, 0x65, 0x44); etk::Color<uint16_t, 4> colorRGBA16(0x52,0x0F, 0x65, 0x44);
etk::Color<uint32_t, 4> colorRGBA32(0x52,0x0F, 0x65, 0x44); etk::Color<uint32_t, 4> colorRGBA32(0x52,0x0F, 0x65, 0x44);
@ -56,20 +56,20 @@ void testColor() {
etk::Color<float, 4> colorRGBAf__(colorRGBA8); etk::Color<float, 4> colorRGBAf__(colorRGBA8);
etk::Color<uint32_t, 2> colorXX332__(colorRGBA8); etk::Color<uint32_t, 2> colorXX332__(colorRGBA8);
TK_INFO("Create a color : RGBA 8 : " << colorRGBA8); TEST_INFO("Create a color : RGBA 8 : " << colorRGBA8);
TK_INFO("Create a color : RGBA 8 : " << colorRGBAf__ << " (converted)"); TEST_INFO("Create a color : RGBA 8 : " << colorRGBAf__ << " (converted)");
TK_INFO("Create a color : XX 32 : " << colorXX332__ << " (converted)"); TEST_INFO("Create a color : XX 32 : " << colorXX332__ << " (converted)");
TK_INFO("Create a color : RGBA 16 : " << colorRGBA16); TEST_INFO("Create a color : RGBA 16 : " << colorRGBA16);
TK_INFO("Create a color : RGBA 32 : " << colorRGBA32); TEST_INFO("Create a color : RGBA 32 : " << colorRGBA32);
TK_INFO("Create a color : RGBA float : " << colorRGBAF); TEST_INFO("Create a color : RGBA float : " << colorRGBAF);
TK_INFO("Create a color : RGB 8 : " << colorRGB8); TEST_INFO("Create a color : RGB 8 : " << colorRGB8);
TK_INFO("Create a color : RGB 16 : " << colorRGB16); TEST_INFO("Create a color : RGB 16 : " << colorRGB16);
TK_INFO("Create a color : RGB 32 : " << colorRGB32); TEST_INFO("Create a color : RGB 32 : " << colorRGB32);
TK_INFO("Create a color : RGB float : " << colorRGBF); TEST_INFO("Create a color : RGB float : " << colorRGBF);
TK_INFO("Create a color : MONO 8 : " << colorMono8); TEST_INFO("Create a color : MONO 8 : " << colorMono8);
TK_INFO("Create a color : MONO 16 : " << colorMono16); TEST_INFO("Create a color : MONO 16 : " << colorMono16);
TK_INFO("Create a color : MONO 32 : " << colorMono32); TEST_INFO("Create a color : MONO 32 : " << colorMono32);
TK_INFO("Create a color : MONO float : " << colorMonoF); TEST_INFO("Create a color : MONO float : " << colorMonoF);
TK_INFO("Create a color : MONO double : " << colorMonoD); TEST_INFO("Create a color : MONO double : " << colorMonoD);
TK_INFO("==> test of Color (STOP)"); TEST_INFO("==> test of Color (STOP)");
} }

View File

@ -19,70 +19,70 @@ TEST(TestEtkFSNode, checkType) {
EXPECT_EQ(myNodeTest1.getNameFile(), "myFileTest.txt"); EXPECT_EQ(myNodeTest1.getNameFile(), "myFileTest.txt");
EXPECT_EQ(myNodeTest1.exist(), false); EXPECT_EQ(myNodeTest1.exist(), false);
/* /*
TK_INFO(" GetNameFolder() ='" << myNodeTest1.getNameFolder() << "'"); TEST_INFO(" GetNameFolder() ='" << myNodeTest1.getNameFolder() << "'");
TK_INFO(" GetName() ='" << myNodeTest1.getName() << "'"); TEST_INFO(" GetName() ='" << myNodeTest1.getName() << "'");
TK_INFO(" GetNameFile() ='" << myNodeTest1.getNameFile() << "'"); TEST_INFO(" GetNameFile() ='" << myNodeTest1.getNameFile() << "'");
TK_INFO(" GetRelativeFolder() ='" << myNodeTest1.getRelativeFolder() << "'"); TEST_INFO(" GetRelativeFolder() ='" << myNodeTest1.getRelativeFolder() << "'");
TK_INFO(" getFileSystemName() ='" << myNodeTest1.getFileSystemName() << "'"); TEST_INFO(" getFileSystemName() ='" << myNodeTest1.getFileSystemName() << "'");
TK_INFO(" exist =" << myNodeTest1.exist()); TEST_INFO(" exist =" << myNodeTest1.exist());
*/ */
} }
void testFSNode() { void testFSNode() {
TK_INFO("==> Start test of FSNode"); TEST_INFO("==> Start test of FSNode");
std::string fileName("USERDATA:myFileTest.txt"); std::string fileName("USERDATA:myFileTest.txt");
etk::FSNode myNodeTest1(fileName); etk::FSNode myNodeTest1(fileName);
TK_INFO("********************************************"); TEST_INFO("********************************************");
TK_INFO("** Filename=\"" << fileName << "\""); TEST_INFO("** Filename=\"" << fileName << "\"");
TK_INFO("********************************************"); TEST_INFO("********************************************");
TK_INFO(" GetNameFolder() ='" << myNodeTest1.getNameFolder() << "'"); TEST_INFO(" GetNameFolder() ='" << myNodeTest1.getNameFolder() << "'");
TK_INFO(" GetName() ='" << myNodeTest1.getName() << "'"); TEST_INFO(" GetName() ='" << myNodeTest1.getName() << "'");
TK_INFO(" GetNameFile() ='" << myNodeTest1.getNameFile() << "'"); TEST_INFO(" GetNameFile() ='" << myNodeTest1.getNameFile() << "'");
TK_INFO(" GetRelativeFolder() ='" << myNodeTest1.getRelativeFolder() << "'"); TEST_INFO(" GetRelativeFolder() ='" << myNodeTest1.getRelativeFolder() << "'");
TK_INFO(" getFileSystemName() ='" << myNodeTest1.getFileSystemName() << "'"); TEST_INFO(" getFileSystemName() ='" << myNodeTest1.getFileSystemName() << "'");
TK_INFO(" exist =" << myNodeTest1.exist()); TEST_INFO(" exist =" << myNodeTest1.exist());
if (true==myNodeTest1.exist()) { if (true==myNodeTest1.exist()) {
TK_ERROR(" ==> remove the file ==> bad for the test"); TEST_ERROR(" ==> remove the file ==> bad for the test");
} else { } else {
TK_INFO(" Display time when file does not exist :"); TEST_INFO(" Display time when file does not exist :");
TK_INFO(" TimeCreatedString() ='" << myNodeTest1.timeCreatedString() << "'"); TEST_INFO(" TimeCreatedString() ='" << myNodeTest1.timeCreatedString() << "'");
TK_INFO(" TimeModifiedString() ='" << myNodeTest1.timeModifiedString() << "'"); TEST_INFO(" TimeModifiedString() ='" << myNodeTest1.timeModifiedString() << "'");
TK_INFO(" TimeAccessedString() ='" << myNodeTest1.timeAccessedString() << "'"); TEST_INFO(" TimeAccessedString() ='" << myNodeTest1.timeAccessedString() << "'");
} }
myNodeTest1.touch(); myNodeTest1.touch();
if (false==myNodeTest1.exist()) { if (false==myNodeTest1.exist()) {
TK_ERROR(" ==> Error, can not create the file ...."); TEST_ERROR(" ==> Error, can not create the file ....");
} else { } else {
TK_INFO(" Display time when file does exist :"); TEST_INFO(" Display time when file does exist :");
TK_INFO(" TimeCreatedString() ='" << myNodeTest1.timeCreatedString() << "'"); TEST_INFO(" TimeCreatedString() ='" << myNodeTest1.timeCreatedString() << "'");
TK_INFO(" TimeModifiedString() ='" << myNodeTest1.timeModifiedString() << "'"); TEST_INFO(" TimeModifiedString() ='" << myNodeTest1.timeModifiedString() << "'");
TK_INFO(" TimeAccessedString() ='" << myNodeTest1.timeAccessedString() << "'"); TEST_INFO(" TimeAccessedString() ='" << myNodeTest1.timeAccessedString() << "'");
} }
etk::FSNode myNodeTest2(fileName); etk::FSNode myNodeTest2(fileName);
TK_INFO("********************************************"); TEST_INFO("********************************************");
TK_INFO("** Filename2=\"" << myNodeTest2<< "\""); TEST_INFO("** Filename2=\"" << myNodeTest2<< "\"");
TK_INFO("********************************************"); TEST_INFO("********************************************");
TK_INFO(" GetNameFolder() ='" << myNodeTest2.getNameFolder() << "'"); TEST_INFO(" GetNameFolder() ='" << myNodeTest2.getNameFolder() << "'");
TK_INFO(" GetName() ='" << myNodeTest2.getName() << "'"); TEST_INFO(" GetName() ='" << myNodeTest2.getName() << "'");
TK_INFO(" GetNameFile() ='" << myNodeTest2.getNameFile() << "'"); TEST_INFO(" GetNameFile() ='" << myNodeTest2.getNameFile() << "'");
TK_INFO(" GetRelativeFolder() ='" << myNodeTest2.getRelativeFolder() << "'"); TEST_INFO(" GetRelativeFolder() ='" << myNodeTest2.getRelativeFolder() << "'");
TK_INFO(" getFileSystemName() ='" << myNodeTest2.getFileSystemName() << "'"); TEST_INFO(" getFileSystemName() ='" << myNodeTest2.getFileSystemName() << "'");
TK_INFO(" exist =" << myNodeTest2.exist()); TEST_INFO(" exist =" << myNodeTest2.exist());
if (false==myNodeTest1.exist()) { if (false==myNodeTest1.exist()) {
TK_ERROR(" ==> Error, can not create the file ...."); TEST_ERROR(" ==> Error, can not create the file ....");
} else { } else {
TK_INFO(" Display time when file does exist :"); TEST_INFO(" Display time when file does exist :");
TK_INFO(" TimeCreatedString() ='" << myNodeTest2.timeCreatedString() << "'"); TEST_INFO(" TimeCreatedString() ='" << myNodeTest2.timeCreatedString() << "'");
TK_INFO(" TimeModifiedString() ='" << myNodeTest2.timeModifiedString() << "'"); TEST_INFO(" TimeModifiedString() ='" << myNodeTest2.timeModifiedString() << "'");
TK_INFO(" TimeAccessedString() ='" << myNodeTest2.timeAccessedString() << "'"); TEST_INFO(" TimeAccessedString() ='" << myNodeTest2.timeAccessedString() << "'");
} }
// Try remove the file : // Try remove the file :
myNodeTest1.remove(); myNodeTest1.remove();
if (true==myNodeTest1.exist()) { if (true==myNodeTest1.exist()) {
TK_ERROR(" ==> The file might be removed ==> but it is not the case ..."); TEST_ERROR(" ==> The file might be removed ==> but it is not the case ...");
} else { } else {
TK_INFO(" ==> The file is removed"); TEST_INFO(" ==> The file is removed");
} }
TK_INFO("********************************************"); TEST_INFO("********************************************");
TK_INFO("==> Stop test of FSNode"); TEST_INFO("==> Stop test of FSNode");
} }

View File

@ -3,17 +3,38 @@ import lutin.module as module
import lutin.tools as tools import lutin.tools as tools
import lutin.debug as debug import lutin.debug as debug
def get_type():
return "LIBRARY"
def get_sub_type():
return "TEST"
def get_desc(): def get_desc():
return "basic debug log for test" return "basic debug log for test"
def get_licence():
return "APACHE-2"
def create(target): def get_compagny_type():
my_module = module.Module(__file__, 'test-debug', 'LIBRARY') return "com"
def get_compagny_name():
return "atria-soft"
def get_maintainer():
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
def create(target, module_name):
my_module = module.Module(__file__, module_name, get_type())
my_module.add_src_file([ my_module.add_src_file([
'test-debug/debug.cpp' 'test-debug/debug.cpp'
]) ])
my_module.add_header_file([
'test-debug/debug.h'
])
my_module.add_module_depend('etk') my_module.add_module_depend('etk')
my_module.add_export_path(tools.get_current_path(__file__)) my_module.add_path(tools.get_current_path(__file__))
return my_module return my_module