From ec91d3cb4cf819c3abf95e2f64a9b68c7122dbeb Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Fri, 13 Jun 2014 15:57:51 +0200 Subject: [PATCH] debugger: Added project for testing CLI I/O Change-Id: I0240ec0a258ad52a3b65ae320a8630a9711538cc Reviewed-by: Robert Loehning Reviewed-by: hjk --- tests/manual/debugger/cli-io/cli-io.pro | 12 ++++++ tests/manual/debugger/cli-io/main.cpp | 49 +++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 tests/manual/debugger/cli-io/cli-io.pro create mode 100644 tests/manual/debugger/cli-io/main.cpp diff --git a/tests/manual/debugger/cli-io/cli-io.pro b/tests/manual/debugger/cli-io/cli-io.pro new file mode 100644 index 00000000000..e0d688234e9 --- /dev/null +++ b/tests/manual/debugger/cli-io/cli-io.pro @@ -0,0 +1,12 @@ +# for testing with terminal +QT += core +QT -= gui +CONFIG += console +CONFIG -= app_bundle + +# for testing without terminal +#QT += core gui + +TARGET = cli-io +TEMPLATE = app +SOURCES += main.cpp diff --git a/tests/manual/debugger/cli-io/main.cpp b/tests/manual/debugger/cli-io/main.cpp new file mode 100644 index 00000000000..bdd230c6f02 --- /dev/null +++ b/tests/manual/debugger/cli-io/main.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** 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. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QCoreApplication a(argc, argv); + + qDebug() << "This is QDebug"; + std::cout << "This is stdout" << std::endl; + std::cerr << "This is stderr" << std::endl; + + return 0; // Comment out for testing stdin + + std::string s; + std::cout << "Enter something: "; + std::cin >> s; + std::cout << "You entered: " << s << std::endl; + return 0; +}