diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 13a921daafb..ef1dd224e9a 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -8,7 +8,6 @@ SUBDIRS += \ fakevim \ generichighlighter \ # icheckbuild \ -# profilereader \ # profilewriter \ qml \ utils_stringutils diff --git a/tests/auto/profilereader/data/includefiles/pri.cpp b/tests/auto/profilereader/data/includefiles/pri.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/auto/profilereader/data/includefiles/pro.cpp b/tests/auto/profilereader/data/includefiles/pro.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/auto/profilereader/data/includefiles/test.pri b/tests/auto/profilereader/data/includefiles/test.pri deleted file mode 100644 index 6a25f2a87a0..00000000000 --- a/tests/auto/profilereader/data/includefiles/test.pri +++ /dev/null @@ -1 +0,0 @@ -SOURCES += pri.cpp diff --git a/tests/auto/profilereader/data/includefiles/test.pro b/tests/auto/profilereader/data/includefiles/test.pro deleted file mode 100644 index 2939b5fbfd0..00000000000 --- a/tests/auto/profilereader/data/includefiles/test.pro +++ /dev/null @@ -1,6 +0,0 @@ -include(test.pri) - -SOURCES += pro.cpp - -CONFIG += testscope -testscope:SCOPED_VARIABLE = 1 diff --git a/tests/auto/profilereader/profilecache.h b/tests/auto/profilereader/profilecache.h deleted file mode 100644 index b3d995701d5..00000000000 --- a/tests/auto/profilereader/profilecache.h +++ /dev/null @@ -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 -#include - -namespace Qt4ProjectManager { -namespace Internal { - -class ProFileCache { -public: - ProFile *proFile(const QString &arg) - { return new ProFile(arg); } -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // PROFILECACHE_H diff --git a/tests/auto/profilereader/profilereader.pro b/tests/auto/profilereader/profilereader.pro deleted file mode 100644 index 3e807d1a177..00000000000 --- a/tests/auto/profilereader/profilereader.pro +++ /dev/null @@ -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 diff --git a/tests/auto/profilereader/qtversionmanager.h b/tests/auto/profilereader/qtversionmanager.h deleted file mode 100644 index cb551b117ae..00000000000 --- a/tests/auto/profilereader/qtversionmanager.h +++ /dev/null @@ -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 - -class QtVersion -{ -public: - QString path() { return QString(); } - QString sourcePath() { return QString(); } - QHash versionInfo() { return QHash(); } -}; - -#endif // QTVERSIONMANAGER_H diff --git a/tests/auto/profilereader/sync b/tests/auto/profilereader/sync deleted file mode 100755 index 9dcbc91dcae..00000000000 --- a/tests/auto/profilereader/sync +++ /dev/null @@ -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 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) diff --git a/tests/auto/profilereader/tst_profilereader.cpp b/tests/auto/profilereader/tst_profilereader.cpp deleted file mode 100644 index 520ecdbcac0..00000000000 --- a/tests/auto/profilereader/tst_profilereader.cpp +++ /dev/null @@ -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 -#include - -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"