mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
DOM
- Stubbed shell of DOM, with limited support for 'system....'. - Added unit tests.
This commit is contained in:
parent
17d1e59e29
commit
b72173bb0e
4 changed files with 147 additions and 5 deletions
71
test/dom.t.cpp
Normal file
71
test/dom.t.cpp
Normal file
|
@ -0,0 +1,71 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// taskwarrior - a command line task list manager.
|
||||
//
|
||||
// Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free Software
|
||||
// Foundation; either version 2 of the License, or (at your option) any later
|
||||
// version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
// details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with
|
||||
// this program; if not, write to the
|
||||
//
|
||||
// Free Software Foundation, Inc.,
|
||||
// 51 Franklin Street, Fifth Floor,
|
||||
// Boston, MA
|
||||
// 02110-1301
|
||||
// USA
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
#include "../cmake.h"
|
||||
#include <main.h>
|
||||
#include <test.h>
|
||||
|
||||
#ifdef HAVE_LIBLUA
|
||||
extern "C"
|
||||
{
|
||||
#include <lua.h>
|
||||
}
|
||||
#endif
|
||||
|
||||
Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest t (2);
|
||||
|
||||
try
|
||||
{
|
||||
DOM dom;
|
||||
|
||||
t.is (dom.get ("system.version"), VERSION, "DOM system.version -> VERSION");
|
||||
t.is (dom.get ("system.lua.version"), LUA_RELEASE, "DOM system.lua.version -> LUA_RELEASE");
|
||||
}
|
||||
|
||||
catch (std::string& error)
|
||||
{
|
||||
t.diag (error);
|
||||
return -1;
|
||||
}
|
||||
|
||||
catch (...)
|
||||
{
|
||||
t.diag ("Unknown error.");
|
||||
return -2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue