diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 18:42:24 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 18:42:24 +0000 |
commit | f508189682b6fba62e08feeb1596f682bad5fff9 (patch) | |
tree | 28aeb0e6c19386c385c1ce5edf8a92c1bca15281 /src/piklab-test/base/generator_check.h | |
download | piklab-f508189682b6fba62e08feeb1596f682bad5fff9.tar.gz piklab-f508189682b6fba62e08feeb1596f682bad5fff9.zip |
Added KDE3 version of PikLab
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/piklab-test/base/generator_check.h')
-rw-r--r-- | src/piklab-test/base/generator_check.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/src/piklab-test/base/generator_check.h b/src/piklab-test/base/generator_check.h new file mode 100644 index 0000000..9ad426a --- /dev/null +++ b/src/piklab-test/base/generator_check.h @@ -0,0 +1,102 @@ +/*************************************************************************** + * Copyright (C) 2007 Nicolas Hadacek <[email protected]> * + * * + * 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. * + ***************************************************************************/ +#ifndef GPUTILS_GENERATOR_CHECK_H +#define GPUTILS_GENERATOR_CHECK_H + +#include "device_test.h" +#include "common/cli/cli_log.h" +#include "common/global/pfile.h" +#include "coff/base/disassembler.h" +#include "common/global/process.h" +namespace Pic { class Memory; } + +//---------------------------------------------------------------------------- +class GeneratorCheckHelper +{ +public: + GeneratorCheckHelper(); + virtual ~GeneratorCheckHelper(); + virtual void initSupported() = 0; + virtual bool init(const Device::Data &data) = 0; + void cleanup(); + bool isSupported(const Device::Data &data) const { return _supported.contains(&data); } + virtual PURL::FileType sourceFileType() const = 0; + const Tool::SourceGenerator *generator() const { return _generator; } + virtual SourceLine::List configEndLines() const = 0; + +protected: + QValueList<const Device::Data *> _supported; + Process::StringOutput *_cprocess, *_lprocess; + Tool::SourceGenerator *_generator; + + friend class GeneratorCheck; +}; + +class GeneratorCheck : public DeviceTest +{ +public: + GeneratorCheck(GeneratorCheckHelper *helper); + virtual ~GeneratorCheck(); + virtual bool skip(const Device::Data &data) const; + virtual void runTest(); + virtual bool init(const Device::Data &data); + virtual bool execute(const Device::Data &data); + virtual void cleanup(const Device::Data &data); + +protected: + GeneratorCheckHelper *_helper; + CLI::View *_view; + PURL::File *_fdest, *_fhex; + Pic::Memory *_memory1; + QString _source; +}; + +//---------------------------------------------------------------------------- +class ConfigGeneratorCheck : public GeneratorCheck +{ +public: + ConfigGeneratorCheck(GeneratorCheckHelper *helper) : GeneratorCheck(helper), _memory2(0) {} + virtual bool init(const Device::Data &data); + virtual bool execute(const Device::Data &data); + virtual void cleanup(const Device::Data &data); + +private: + Pic::Memory *_memory2; +}; + +//---------------------------------------------------------------------------- +class TemplateGeneratorCheck : public GeneratorCheck +{ +public: + TemplateGeneratorCheck(GeneratorCheckHelper *helper) : GeneratorCheck(helper) {} + virtual bool init(const Device::Data &data); +}; + +//---------------------------------------------------------------------------- +class GPUtilsGeneratorCheckHelper : public GeneratorCheckHelper +{ +public: + GPUtilsGeneratorCheckHelper(); + virtual void initSupported(); + virtual bool init(const Device::Data &data); + virtual PURL::FileType sourceFileType() const { return PURL::AsmGPAsm; } + virtual SourceLine::List configEndLines() const; +}; + +//---------------------------------------------------------------------------- +class SDCCGeneratorCheckHelper : public GeneratorCheckHelper +{ +public: + SDCCGeneratorCheckHelper(); + virtual void initSupported(); + virtual bool init(const Device::Data &data); + virtual PURL::FileType sourceFileType() const { return PURL::CSource; } + virtual SourceLine::List configEndLines() const; +}; +#endif |