forked from qt-creator/qt-creator
debugger: Added project for testing CLI I/O
Change-Id: I0240ec0a258ad52a3b65ae320a8630a9711538cc Reviewed-by: Robert Loehning <robert.loehning@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
12
tests/manual/debugger/cli-io/cli-io.pro
Normal file
12
tests/manual/debugger/cli-io/cli-io.pro
Normal file
@@ -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
|
||||||
49
tests/manual/debugger/cli-io/main.cpp
Normal file
49
tests/manual/debugger/cli-io/main.cpp
Normal file
@@ -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 <QCoreApplication>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user