forked from qt-creator/qt-creator
autotests: removed as it's unuseably out of date
This commit is contained in:
@@ -8,7 +8,6 @@ SUBDIRS += \
|
||||
fakevim \
|
||||
generichighlighter \
|
||||
# icheckbuild \
|
||||
# profilereader \
|
||||
# profilewriter \
|
||||
qml \
|
||||
utils_stringutils
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
SOURCES += pri.cpp
|
||||
@@ -1,6 +0,0 @@
|
||||
include(test.pri)
|
||||
|
||||
SOURCES += pro.cpp
|
||||
|
||||
CONFIG += testscope
|
||||
testscope:SCOPED_VARIABLE = 1
|
||||
@@ -1,48 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** Commercial Usage
|
||||
**
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** If you are unsure which license is appropriate for your use, please
|
||||
** contact the sales department at http://qt.nokia.com/contact.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef PROFILECACHE_H
|
||||
#define PROFILECACHE_H
|
||||
|
||||
#include <proitems.h>
|
||||
#include <QString>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class ProFileCache {
|
||||
public:
|
||||
ProFile *proFile(const QString &arg)
|
||||
{ return new ProFile(arg); }
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qt4ProjectManager
|
||||
|
||||
#endif // PROFILECACHE_H
|
||||
@@ -1,12 +0,0 @@
|
||||
TEMPLATE = app
|
||||
CONFIG += qt warn_on console depend_includepath
|
||||
CONFIG += qtestlib testcase
|
||||
|
||||
SOURCES += \
|
||||
tst_profilereader.cpp
|
||||
|
||||
HEADERS += \
|
||||
profilecache.h \
|
||||
qtversionmanager.h
|
||||
|
||||
TARGET=tst_$$TARGET
|
||||
@@ -1,43 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** Commercial Usage
|
||||
**
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** If you are unsure which license is appropriate for your use, please
|
||||
** contact the sales department at http://qt.nokia.com/contact.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef QTVERSIONMANAGER_H
|
||||
#define QTVERSIONMANAGER_H
|
||||
|
||||
#include <QtCore/QString>
|
||||
|
||||
class QtVersion
|
||||
{
|
||||
public:
|
||||
QString path() { return QString(); }
|
||||
QString sourcePath() { return QString(); }
|
||||
QHash<QString, QString> versionInfo() { return QHash<QString, QString>(); }
|
||||
};
|
||||
|
||||
#endif // QTVERSIONMANAGER_H
|
||||
@@ -1,114 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
use Cwd;
|
||||
use File::Copy;
|
||||
use File::Basename;
|
||||
use IO::File;
|
||||
use File::Spec;
|
||||
use File::Path;
|
||||
|
||||
# --------------------------------
|
||||
sub copyFiles
|
||||
{
|
||||
my ($srcDir, $destDir, @files) = @_;
|
||||
unless (-d $destDir) {
|
||||
mkpath $destDir;
|
||||
}
|
||||
die ('No directory ' . $srcDir) unless -d $srcDir;
|
||||
die ('No directory ' . $destDir) unless -d $destDir;
|
||||
foreach (@files) {
|
||||
my $src = File::Spec->catfile($srcDir, $_);
|
||||
print 'syncing ', $src, "...\n";
|
||||
my $dest = File::Spec->catfile($destDir, $_);
|
||||
if (-f $dest) {
|
||||
unlink($dest) or die ('Unable to delete existing ' . $dest . ' :' . $!);
|
||||
}
|
||||
copy($src, $dest) || die ($0 . ': Unable to copy ' . $src . ': ' . $! . "\n");
|
||||
chmod 0644, $destDir . $_;
|
||||
}
|
||||
}
|
||||
|
||||
# -----------------------------------------
|
||||
sub showUsage
|
||||
{
|
||||
print "$0 usage:\n";
|
||||
print " -qtdir <dir> Set directory for Qt (default: use qmake to figure out)\n";
|
||||
print " -help This help\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my $currentDir = getcwd;
|
||||
my @files;
|
||||
|
||||
my $qtSrcTree = '';
|
||||
|
||||
# Parse arguments
|
||||
while ( @ARGV ) {
|
||||
my $var = 0;
|
||||
my $val = 0;
|
||||
|
||||
#parse
|
||||
my $arg = shift @ARGV;
|
||||
if ("$arg" eq "-h" || "$arg" eq "-help" || "$arg" eq "--help" || "$arg" eq "?" || "$arg" eq "/?" || "$arg" eq "-?") {
|
||||
showUsage();
|
||||
exit(0);
|
||||
} elsif ("$arg" eq "-qtdir") {
|
||||
$qtSrcTree = shift @ARGV;
|
||||
} else {
|
||||
print "Unknown option: $arg\n";
|
||||
showUsage();
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
# If QTDIR is not set, use qmake to figure it out
|
||||
if (!$qtSrcTree) {
|
||||
my $qmakeInfo = `qmake -v` or die "Couldn't run qmake!";
|
||||
chomp($qmakeInfo);
|
||||
$qmakeInfo =~ m/Using Qt version .* in (.*)lib$/;
|
||||
$qtSrcTree = $1;
|
||||
# read Qt source directory from .qmake.cache
|
||||
my $fh = IO::File->new();
|
||||
$fh->open($qtSrcTree . '.qmake.cache');
|
||||
while (defined (my $line = $fh->getline())) {
|
||||
# parse line
|
||||
# QT_SOURCE_TREE = $$quote(/home/kkoehne/dev/qt)
|
||||
if ($line =~ /^\s*QT_SOURCE_TREE\s*=/) {
|
||||
$qtSrcTree = $line;
|
||||
$qtSrcTree =~ s/^QT_SOURCE_TREE\s*=\s*(\$\$quote\()?//g;
|
||||
$qtSrcTree =~ s/\)?\n//g;
|
||||
}
|
||||
}
|
||||
print "Detected qt source directory: " . $qtSrcTree . "\n";
|
||||
$fh->close();
|
||||
}
|
||||
$qtSrcTree =~ s/\\/\//g;
|
||||
|
||||
|
||||
# if the sources can't be found, check for shadow builds.
|
||||
my $preprocessor_h = File::Spec->catfile($qtSrcTree, 'src', 'tools', 'moc', 'preprocessor.h');
|
||||
|
||||
my $qtsrcdirEnv = $ENV{'QTSRCDIR'};
|
||||
if (defined $qtsrcdirEnv) {
|
||||
if ((! -e $preprocessor_h) && ($qtsrcdirEnv ne '')) {
|
||||
$qtSrcTree = $qtsrcdirEnv;
|
||||
}
|
||||
}
|
||||
|
||||
# copy files for Qt4ProjectManager
|
||||
|
||||
|
||||
@files = ( 'proitems.h',
|
||||
'abstractproitemvisitor.h',
|
||||
'proparserutils.h',
|
||||
'profileevaluator.h',
|
||||
|
||||
'proitems.cpp',
|
||||
'profileevaluator.cpp' );
|
||||
|
||||
copyFiles(File::Spec->catfile($qtSrcTree, 'tools', 'linguist', 'shared'), $currentDir,@files);
|
||||
|
||||
@files = ( 'profilereader.h',
|
||||
'profilereader.cpp');
|
||||
copyFiles(File::Spec->catfile('..', '..', '..', 'src', 'plugins', 'qt4projectmanager'), $currentDir, @files)
|
||||
@@ -1,74 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** Commercial Usage
|
||||
**
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** If you are unsure which license is appropriate for your use, please
|
||||
** contact the sales department at http://qt.nokia.com/contact.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "profilecache.h"
|
||||
|
||||
#include <QtTest/QtTest>
|
||||
#include <QtCore/QSet>
|
||||
|
||||
using Qt4ProjectManager::Internal::ProFileReader;
|
||||
using Qt4ProjectManager::Internal::ProFileCache;
|
||||
|
||||
|
||||
class tst_ProFileReader : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void readProFile();
|
||||
void includeFiles();
|
||||
void conditionalScopes();
|
||||
};
|
||||
|
||||
void tst_ProFileReader::readProFile()
|
||||
{
|
||||
ProFileReader reader;
|
||||
QCOMPARE(reader.readProFile("nonexistant"), false);
|
||||
QCOMPARE(reader.readProFile("data/includefiles/test.pro"), true);
|
||||
}
|
||||
|
||||
void tst_ProFileReader::includeFiles()
|
||||
{
|
||||
ProFileReader reader;
|
||||
QCOMPARE(reader.readProFile("data/includefiles/test.pro"), true);
|
||||
QCOMPARE(reader.includeFiles().size(), 2);
|
||||
}
|
||||
|
||||
void tst_ProFileReader::conditionalScopes()
|
||||
{
|
||||
ProFileReader reader;
|
||||
QCOMPARE(reader.readProFile("data/includefiles/test.pro"), true);
|
||||
|
||||
QStringList scopedVariable = reader.values("SCOPED_VARIABLE");
|
||||
QCOMPARE(scopedVariable.count(), 1);
|
||||
QCOMPARE(scopedVariable.first(), QLatin1String("1"));
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_ProFileReader)
|
||||
#include "tst_profilereader.moc"
|
||||
Reference in New Issue
Block a user