-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#169: Merge AXRWrapper functionality into AXRCore and remove the former.
Moved AXRTest* to a new target as that sort of functionality doesn't belong in core and should later be integrated into a future unit test.
- Loading branch information
1 parent
2d57143
commit 2d7d9a1
Showing
27 changed files
with
698 additions
and
760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/******************************************************************** | ||
* a A | ||
* AM\/MA | ||
* (MA:MMD | ||
* :: VD | ||
* :: º | ||
* :: | ||
* :: ** .A$MMMMND AMMMD AMMM6 MMMM MMMM6 | ||
+ 6::Z. TMMM MMMMMMMMMDA VMMMD AMMM6 MMMMMMMMM6 | ||
* 6M:AMMJMMOD V MMMA VMMMD AMMM6 MMMMMMM6 | ||
* :: TMMTMC ___MMMM VMMMMMMM6 MMMM | ||
* MMM TMMMTTM, AMMMMMMMM VMMMMM6 MMMM | ||
* :: MM TMMTMMMD MMMMMMMMMM MMMMMM MMMM | ||
* :: MMMTTMMM6 MMMMMMMMMMM AMMMMMMD MMMM | ||
* :. MMMMMM6 MMMM MMMM AMMMMMMMMD MMMM | ||
* TTMMT MMMM MMMM AMMM6 MMMMD MMMM | ||
* TMMMM8 MMMMMMMMMMM AMMM6 MMMMD MMMM | ||
* TMMMMMM$ MMMM6 MMMM AMMM6 MMMMD MMMM | ||
* TMMM MMMM | ||
* TMMM .MMM | ||
* TMM .MMD ARBITRARY·······XML········RENDERING | ||
* TMM MMA ==================================== | ||
* TMN MM | ||
* MN ZM | ||
* MM, | ||
* | ||
* | ||
* AUTHORS: see AUTHORS file | ||
* | ||
* COPYRIGHT: ©2012 - All Rights Reserved | ||
* | ||
* LICENSE: see LICENSE file | ||
* | ||
* WEB: http://axr.vg | ||
* | ||
* THIS CODE AND INFORMATION ARE PROVIDED "AS IS" | ||
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | ||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR | ||
* FITNESS FOR A PARTICULAR PURPOSE. | ||
* | ||
********************************************************************/ | ||
|
||
#include <QCoreApplication> | ||
#include <QDir> | ||
#include <QFile> | ||
#include <QUrl> | ||
#include "AXRDebugging.h" | ||
#include "AXRInitializer.h" | ||
#include "AXRTestThread.h" | ||
#include "AXRTestRunner.h" | ||
#include "AXRWarning.h" | ||
#include "HSSFunction.h" | ||
#include "HSSSelFunction.h" | ||
|
||
using namespace AXR; | ||
|
||
AXRTestRunner::AXRTestRunner() | ||
{ | ||
} | ||
|
||
AXRTestRunner::~AXRTestRunner() | ||
{ | ||
} | ||
|
||
AXRString AXRTestRunner::getPathToTestsFile() | ||
{ | ||
QDir dir = QDir(QCoreApplication::applicationDirPath()); | ||
#ifdef Q_WS_MACX | ||
dir.cdUp(); | ||
#endif | ||
dir.cd("Resources"); | ||
dir.cd("views"); | ||
return dir.filePath("layoutTests.hss"); | ||
} | ||
|
||
void AXRTestRunner::executeLayoutTests(HSSObservableProperty passnull, void*data) | ||
{ | ||
HSSContainer::p status; | ||
AXRCore* core = AXRCore::getInstance(); | ||
HSSContainer::p root = core->getController()->getRoot(); | ||
std::deque<HSSParserNode::p> arguments = *(std::deque<HSSParserNode::p>*)data; | ||
|
||
for (std::deque<HSSParserNode::p>::iterator it = arguments.begin(); it != arguments.end(); ++it) | ||
{ | ||
HSSParserNode::p argument = *it; | ||
if (argument->isA(HSSFunctionTypeSel)) | ||
{ | ||
HSSSelFunction::p selFunction = qSharedPointerCast<HSSSelFunction>(argument); | ||
QVariant remoteValue = selFunction->evaluate(); | ||
if (remoteValue.canConvert<std::vector< std::vector<HSSDisplayObject::p> > >()) | ||
{ | ||
std::vector< std::vector<HSSDisplayObject::p> > selection = remoteValue.value<std::vector< std::vector<HSSDisplayObject::p> > >(); | ||
std::vector<HSSDisplayObject::p> innerSelection = selection[0]; | ||
status = HSSContainer::asContainer(innerSelection[0]); | ||
} | ||
} | ||
} | ||
|
||
AXRTestThread thrd(this, QUrl::fromLocalFile(this->getPathToTestsFile()), status); | ||
thrd.start(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/******************************************************************** | ||
* a A | ||
* AM\/MA | ||
* (MA:MMD | ||
* :: VD | ||
* :: º | ||
* :: | ||
* :: ** .A$MMMMND AMMMD AMMM6 MMMM MMMM6 | ||
+ 6::Z. TMMM MMMMMMMMMDA VMMMD AMMM6 MMMMMMMMM6 | ||
* 6M:AMMJMMOD V MMMA VMMMD AMMM6 MMMMMMM6 | ||
* :: TMMTMC ___MMMM VMMMMMMM6 MMMM | ||
* MMM TMMMTTM, AMMMMMMMM VMMMMM6 MMMM | ||
* :: MM TMMTMMMD MMMMMMMMMM MMMMMM MMMM | ||
* :: MMMTTMMM6 MMMMMMMMMMM AMMMMMMD MMMM | ||
* :. MMMMMM6 MMMM MMMM AMMMMMMMMD MMMM | ||
* TTMMT MMMM MMMM AMMM6 MMMMD MMMM | ||
* TMMMM8 MMMMMMMMMMM AMMM6 MMMMD MMMM | ||
* TMMMMMM$ MMMM6 MMMM AMMM6 MMMMD MMMM | ||
* TMMM MMMM | ||
* TMMM .MMM | ||
* TMM .MMD ARBITRARY·······XML········RENDERING | ||
* TMM MMA ==================================== | ||
* TMN MM | ||
* MN ZM | ||
* MM, | ||
* | ||
* | ||
* AUTHORS: see AUTHORS file | ||
* | ||
* COPYRIGHT: ©2012 - All Rights Reserved | ||
* | ||
* LICENSE: see LICENSE file | ||
* | ||
* WEB: http://axr.vg | ||
* | ||
* THIS CODE AND INFORMATION ARE PROVIDED "AS IS" | ||
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | ||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR | ||
* FITNESS FOR A PARTICULAR PURPOSE. | ||
* | ||
********************************************************************/ | ||
|
||
#ifndef AXRWRAPPER_H | ||
#define AXRWRAPPER_H | ||
|
||
#include <QMap> | ||
#include <QMutex> | ||
#include <QSharedPointer> | ||
#include <QThread> | ||
#include <QThreadPool> | ||
#include "AXRError.h" | ||
#include "AXRBuffer.h" | ||
#include "HSSContainer.h" | ||
#include "HSSObservableProperties.h" | ||
|
||
namespace AXR | ||
{ | ||
/** | ||
* @brief This is the abstract superclass from with all OS-specific wrappers | ||
* should inherit from. | ||
*/ | ||
class AXR_API AXRTestRunner | ||
{ | ||
public: | ||
/** | ||
* Creates a new instance of the wrapper. It will obtain the singleton instance of | ||
* the AXRCore and initialize it. | ||
*/ | ||
AXRTestRunner(); | ||
|
||
/** | ||
* Destructs the wrapper | ||
*/ | ||
virtual ~AXRTestRunner(); | ||
|
||
virtual AXRString getPathToTestsFile(); | ||
|
||
void executeLayoutTests(HSSObservableProperty passnull, void*data); | ||
|
||
QMap<unsigned, AXRBuffer::p> files; | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
if(BUILD_SHARED_LIBS) | ||
add_definitions(-DAXR_EXPORTS) | ||
endif() | ||
|
||
# Find all sources | ||
file(GLOB_RECURSE test_SOURCES *.c *.cpp *.h) | ||
list(SORT test_SOURCES) | ||
|
||
group_by_folder(${CMAKE_CURRENT_SOURCE_DIR} "${test_SOURCES}") | ||
|
||
add_library(TEST ${test_SOURCES}) | ||
target_link_libraries(TEST ${TARGET_NAME_LIB_CORE}) | ||
set_target_properties(TEST PROPERTIES FOLDER Libraries) | ||
|
||
if(APPLE AND BUILD_SHARED_LIBS AND AXR_BUILD_FRAMEWORKS) | ||
set_target_properties(TEST PROPERTIES FRAMEWORK TRUE) | ||
endif() | ||
|
||
if(IS_RELEASE_BUILD) | ||
install(TARGETS TEST | ||
LIBRARY DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY_REL} COMPONENT libraries | ||
ARCHIVE DESTINATION ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_REL} COMPONENT libraries | ||
FRAMEWORK DESTINATION Frameworks COMPONENT frameworks | ||
) | ||
endif() |
Oops, something went wrong.