From 3dce3c9479f52fec8400bef532715f1de9fe6afb Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Tue, 30 Apr 2013 16:13:02 +0200 Subject: [PATCH] Put qt test to a single file To make later changes easier. --- tests/qt | 98 ++++++++++++++++++++++++++++++++++++++++++++++- tests/qt.files | 101 ------------------------------------------------- 2 files changed, 97 insertions(+), 102 deletions(-) delete mode 100644 tests/qt.files diff --git a/tests/qt b/tests/qt index 7e2dc65..73b2d72 100755 --- a/tests/qt +++ b/tests/qt @@ -9,4 +9,100 @@ QTDIR=/usr/share/qt4 export QTDIR [ -d $QTDIR ] || canttest "Can't find QT4 instalation" -. ./test.inc +cat > 'Makefile.omk' <<'EOF' +SUBDIRS = somelib +QT_SUBDIRS = qtapp +EOF +mkdir 'somelib' +cat > 'somelib/somelib.c' <<'EOF' +#include + +int some_function(int num) +{ + return SOME_CONST - num; +} +EOF +cat > 'somelib/Makefile.omk' <<'EOF' +include_HEADERS = header.h +shared_LIBRARIES = somelib + + +somelib_SOURCES = somelib.c +EOF +cat > 'somelib/header.h' <<'EOF' +#ifndef HEADER_H +#define HEADER_H + +#define SOME_CONST 123 + +#ifdef __cplusplus +extern "C" { +#endif + +int some_function(int); + +#ifdef __cplusplus +} +#endif + +#endif +EOF +mkdir 'qtapp' +cat > 'qtapp/qtapp.cxx' <<'EOF' +#include +#include +#include + + int main(int argc, char *argv[]) + { + QApplication app(argc, argv); + + some_function(SOME_CONST); + QPushButton hello("Hello world!"); + hello.resize(100, 30); + + hello.show(); + return app.exec(); + } +EOF +echo 'QT_PROJECTS=qtapp.pro' > 'qtapp/Makefile.omk' +cat > 'qtapp/qtapp.pro' <<'EOF' +###################################################################### +# Automatically generated by qmake (2.01a) po ?rc 16 18:49:31 2007 +###################################################################### + +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . + +# Input +SOURCES += qtapp.cxx +LIBS+=-lsomelib +EOF +omkize +WVPASS make +WVPASS test -x _compiled/bin/qtapp +make clean + +############################ +# QT Compilation in subdir # +############################ + +cat > Makefile.omk <<'EOF' +SUBDIRS = somelib dir +EOF +mkdir 'dir' +echo 'QT_SUBDIRS = ../qtapp' > 'dir/Makefile.omk' +omkize +WVPASS make +WVPASS test -x _compiled/bin/qtapp +make clean + +cat < Makefile.omk +SUBDIRS = somelib qtapp +EOF +WVPASS make +WVPASS test -x _compiled/bin/qtapp + +make clean diff --git a/tests/qt.files b/tests/qt.files deleted file mode 100644 index 33a4b70..0000000 --- a/tests/qt.files +++ /dev/null @@ -1,101 +0,0 @@ -echo 'SUBDIRS = somelib qtapp' > 'Makefile3.omk' -cat > 'Makefile2.omk' <<'EOF' -SUBDIRS = somelib dir - -EOF -cat > 'Makefile.omk' <<'EOF' -SUBDIRS = somelib -QT_SUBDIRS = qtapp -EOF -cat > 'test.inc' <<'EOF' -cp Makefile1.omk Makefile.omk -make || error "QT compilation" -[ -x _compiled/bin/qtapp ] || error "QT application was not compiled" - -make clean || error "QT clean 1" - -cp Makefile2.omk Makefile.omk -make || error "QT Compilation in subdir" -[ -x _compiled/bin/qtapp ] || error "QT application was not compiled" - -make clean || error "QT clean 2" - -cp Makefile3.omk Makefile.omk -make || error "QT_PROJECT test " -[ -x _compiled/bin/qtapp ] || error "QT application was not compiled" - -make clean || error "QT clean 3" -EOF -mkdir 'somelib' -cat > 'somelib/somelib.c' <<'EOF' -#include - -int some_function(int num) -{ - return SOME_CONST - num; -} -EOF -cat > 'somelib/Makefile.omk' <<'EOF' -include_HEADERS = header.h -shared_LIBRARIES = somelib - - -somelib_SOURCES = somelib.c -EOF -cat > 'somelib/header.h' <<'EOF' -#ifndef HEADER_H -#define HEADER_H - -#define SOME_CONST 123 - -#ifdef __cplusplus -extern "C" { -#endif - -int some_function(int); - -#ifdef __cplusplus -} -#endif - -#endif -EOF -mkdir 'dir' -echo 'QT_SUBDIRS = ../qtapp' > 'dir/Makefile.omk' -mkdir 'qtapp' -cat > 'qtapp/qtapp.cxx' <<'EOF' -#include -#include -#include - - int main(int argc, char *argv[]) - { - QApplication app(argc, argv); - - some_function(SOME_CONST); - QPushButton hello("Hello world!"); - hello.resize(100, 30); - - hello.show(); - return app.exec(); - } -EOF -echo 'QT_PROJECTS=qtapp.pro' > 'qtapp/Makefile.omk' -cat > 'qtapp/qtapp.pro' <<'EOF' -###################################################################### -# Automatically generated by qmake (2.01a) po ?rc 16 18:49:31 2007 -###################################################################### - -TEMPLATE = app -TARGET = -DEPENDPATH += . -INCLUDEPATH += . - -# Input -SOURCES += qtapp.cxx -LIBS+=-lsomelib -EOF -cat > 'Makefile1.omk' <<'EOF' -SUBDIRS = somelib -QT_SUBDIRS = qtapp -EOF -- 2.39.2