Skip to content

Commit

Permalink
Restructured & added a GUI testing framework
Browse files Browse the repository at this point in the history
Use the subdirs structure. Create a static lib of OMEdit. The static lib is linked for the GUI application and used by the testsuite for running the tests.
  • Loading branch information
adeas31 committed Nov 6, 2019
1 parent aeb08ca commit cc6e3e8
Show file tree
Hide file tree
Showing 480 changed files with 1,382 additions and 545 deletions.
11 changes: 8 additions & 3 deletions Makefile.in
@@ -1,9 +1,11 @@
# main Makefile template for Linux and MacOS, populated by configure

defaultMakefileTarget = Makefile.unix

all: @ALL_TARGETS@ @OMLIBRARY_TARGET@

.PRECIOUS: Makefile
.PHONY: omc omlibrary-all omlibrary-core omplot omedit omnotebook omoptim omshell omc-diff omsimulator ReferenceFiles testsuite-depends
.PHONY: omc omlibrary-all omlibrary-core omplot omedit omedit-testsuite omnotebook omoptim omshell omc-diff omsimulator ReferenceFiles testsuite-depends

omc: omc.skip
omc.skip:
Expand All @@ -17,7 +19,10 @@ omplot.skip: omc
$(MAKE) -C OMPlot
omedit: omedit.skip
omedit.skip: omc omplot omsimulator
$(MAKE) -C OMEdit
$(MAKE) -f $(defaultMakefileTarget) -C OMEdit
omedit-testsuite: omedit-testsuite.skip
omedit-testsuite.skip: omedit
$(MAKE) -f $(defaultMakefileTarget) -C OMEdit/Testsuite
omsimulator: omsimulator.skip
omsimulator.skip:
$(MAKE) -C OMSimulator config-3rdParty CERES=OFF "host_short=@host_short@" CC="@CC@" CXX="@CXX@" CFLAGS="@CFLAGS@" CPPFLAGS="@CPPFLAGS@" CXXFLAGS="@CXXFLAGS@"
Expand All @@ -40,7 +45,7 @@ ReferenceFiles.skip:
$(MAKE) -C testsuite/ReferenceFiles
testsuite-depends: omc-diff ReferenceFiles

SOURCE_DIRS_UTF8=OMEdit/OMEdit OMShell/OMShell OMNotebook/OMNotebook OMOptim/OMOptim OMPlot/OMPlot OMCompiler/Compiler/ OMCompiler/SimulationRuntime/ `bash -c echo testsuite/flattening/libraries/3rdParty/{PlanarMechanics,siemens,SiemensPower,ThermoSysPro}` testsuite/openmodelica/modelicaML testsuite/AVM testsuite/simulation
SOURCE_DIRS_UTF8=OMEdit OMShell/OMShell OMNotebook/OMNotebook OMOptim/OMOptim OMPlot/OMPlot OMCompiler/Compiler/ OMCompiler/SimulationRuntime/ `bash -c echo testsuite/flattening/libraries/3rdParty/{PlanarMechanics,siemens,SiemensPower,ThermoSysPro}` testsuite/openmodelica/modelicaML testsuite/AVM testsuite/simulation
SOURCE_DIRS=$(SOURCE_DIRS_UTF8) # testsuite/flattening/libraries/3rdParty/HumMod

bom-error:
Expand Down
5 changes: 4 additions & 1 deletion Makefile.omdev.mingw
Expand Up @@ -34,7 +34,7 @@ BUILDTYPE=Debug
endif


.PHONY: omc omc-diff omlibrary-core omplot omedit omsimulator omnotebook omshell omoptim
.PHONY: omc omc-diff omlibrary-core omplot omedit omedit-testsuite omsimulator omnotebook omshell omoptim

all: omc omc-diff omlibrary-core

Expand All @@ -56,6 +56,9 @@ omplot: omc qtclientsDLLs
omedit: omplot omsimulator qtclientsDLLs
$(MAKE) -f $(defaultMakefileTarget) -C OMEdit OMBUILDDIR=$(OMBUILDDIR)

omedit-testsuite: omedit
$(MAKE) -f $(defaultMakefileTarget) -C OMEdit/Testsuite OMBUILDDIR=$(OMBUILDDIR)

omsimulator:
$(MAKE) -C OMSimulator config-3rdParty
$(MAKE) -C OMSimulator config-OMSimulator OMBUILDDIR=$(OMBUILDDIR)
Expand Down
65 changes: 40 additions & 25 deletions OMEdit/.gitignore
@@ -1,5 +1,6 @@
*.a
*.config
*.unix.config.pri
*.dll
*.exe
*.lib
Expand All @@ -15,32 +16,46 @@
/configure
/install-sh
/Makefile
/OMEdit*/bin/
/OMEdit*/build/release/
/OMEdit/generatedfiles/
/OMEdit/OMEditGUI/.qmake.stash
/OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutput.tokens
/OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutputLexer.c
/OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutputLexer.h
/OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutputParser.c
/OMEdit/OMEditGUI/Debugger/Parser/GDBMIOutputParser.h
/OMEdit/OMEditGUI/Debugger/Parser/libGDBMIParser.a
/OMEdit/OMEditGUI/Debugger/Parser/Makefile.lib.unix
/OMEdit/OMEditGUI/Makefile
/OMEdit/OMEditGUI/Makefile.Debug
/OMEdit/OMEditGUI/Makefile.Release
/OMEdit/OMEditGUI/object_script.*
/OMEdit/OMEditGUI/omc_config.h
/OMEdit/OMEditGUI/OMC/Parser/OMCOutput.tokens
/OMEdit/OMEditGUI/OMC/Parser/OMCOutputLexer.c
/OMEdit/OMEditGUI/OMC/Parser/OMCOutputLexer.cpp
/OMEdit/OMEditGUI/OMC/Parser/OMCOutputLexer.h
/OMEdit/OMEditGUI/OMC/Parser/OMCOutputParser.c
/OMEdit/OMEditGUI/OMC/Parser/OMCOutputParser.cpp
/OMEdit/OMEditGUI/OMC/Parser/OMCOutputParser.h
/OMEdit/OMEditGUI/OMEditGUI.pro.*
/OMEdit/OMEditGUI/version.h
/bin/
/build/release/
.qmake.stash
omc_config.h
OMEdit.pro.*
/OMEditLIB/generatedfiles/
/OMEditLIB/.qmake.stash
/OMEditLIB/Debugger/Parser/GDBMIOutput.tokens
/OMEditLIB/Debugger/Parser/GDBMIOutputLexer.c
/OMEditLIB/Debugger/Parser/GDBMIOutputLexer.h
/OMEditLIB/Debugger/Parser/GDBMIOutputParser.c
/OMEditLIB/Debugger/Parser/GDBMIOutputParser.h
/OMEditLIB/Debugger/Parser/libGDBMIParser.a
/OMEditLIB/Debugger/Parser/Makefile.lib.unix
/OMEditLIB/Makefile
/OMEditLIB/Makefile.Debug
/OMEditLIB/Makefile.Release
/OMEditLIB/object_script.*
/OMEditLIB/OMC/Parser/OMCOutput.tokens
/OMEditLIB/OMC/Parser/OMCOutputLexer.c
/OMEditLIB/OMC/Parser/OMCOutputLexer.cpp
/OMEditLIB/OMC/Parser/OMCOutputLexer.h
/OMEditLIB/OMC/Parser/OMCOutputParser.c
/OMEditLIB/OMC/Parser/OMCOutputParser.cpp
/OMEditLIB/OMC/Parser/OMCOutputParser.h
/OMEditLIB/OMEditLIB.pro.*
/OMEditGUI/.qmake.stash
/OMEditGUI/Makefile
/OMEditGUI/Makefile.Debug
/OMEditGUI/Makefile.Release
/OMEditGUI/object_script.*
/OMEditGUI/OMEditGUI.pro.*
/OMEditGUI/version.h
/qjson-0.8.1/build/
/qmake.sh
Makefile.unix
qm.stamp
Testsuite/Makefile
Testsuite/Testsuite.pro.*
Testsuite/*/generatedfiles/
Testsuite/*/Makefile
Testsuite/*/Makefile.Debug
Testsuite/*/Makefile.Release
46 changes: 0 additions & 46 deletions OMEdit/Makefile.in

This file was deleted.

64 changes: 58 additions & 6 deletions OMEdit/Makefile.omdev.mingw
Expand Up @@ -18,20 +18,72 @@ endif
AR = ar
CMAKE = $(OMDEVMSYS)/bin/cmake/bin/cmake
CMAKE_TARGET = "MSYS Makefiles"
QMAKE=qmake

builddir_bin=$(OMBUILDDIR)/bin
builddir_lib=$(OMBUILDDIR)/lib/omc
builddir_share=$(OMBUILDDIR)/share/
resourcedir=./OMEditLIB/Resources/nls/
CONFIG_DEFAULT_OPENMODELICAHOME = "$(OMBUILDDIR)/"
LSB_RELEASE = $(shell cmd /c "ver")

NAME=OMEdit
EXE=.exe
SHREXT=.dll
LIB=libOMEdit
LIBEXE=.a

omedit: mkbuilddirs install
cp -puf ../common/pre-commit.sh $(shell git rev-parse --git-dir)/hooks/pre-commit

mkbuilddirs:
mkdir -p $(OMBUILDDIR)/share/omedit/nls
mkdir -p $(buildlib)
mkdir -p $(buildbin)
mkdir -p $(builddir_lib)
mkdir -p $(builddir_bin)

omedit: mkbuilddirs qjson-build
$(MAKE) -C OMEdit/OMEditGUI -f Makefile.omdev.mingw
cp -puf ../common/pre-commit.sh $(shell git rev-parse --git-dir)/hooks/pre-commit
install: build OMEditLIB/Resources/nls/qm.stamp
cp -p $(resourcedir)/*.qm $(builddir_share)/omedit/nls/
cp -p bin/$(NAME)$(EXE) $(builddir_bin)
cp -p bin/$(LIB)$(LIBEXE) $(OMBUILDDIR)/lib/omc

OMEditLIB/Resources/nls/qm.stamp: OMEditLIB/OMEditLIB.pro OMEditLIB/Resources/nls/*.ts
lrelease $<
@touch $@

build: omc_config.h $(NAME)
$(MAKE) -f Makefile

$(NAME): Makefile
$(MAKE) -f Makefile

parsergen:
$(MAKE) -C OMEditLIB/Debugger/Parser -f Makefile.lib.omdev.mingw

Makefile: parsergen qjson-build OMEdit.pro
$(QMAKE) -r "CONFIG+=release"

omc_config.h:
@echo Current omhome: "$(CONFIG_DEFAULT_OPENMODELICAHOME)"
@echo Current lsb_release: "$(LSB_RELEASE)"
@if test -f omc_config.h; \
then \
echo "#define CONFIG_DEFAULT_OPENMODELICAHOME \"$(CONFIG_DEFAULT_OPENMODELICAHOME)\"" > omc_config.h.tmp; \
echo "#define LSB_RELEASE \"$(LSB_RELEASE)\"" >> omc_config.h.tmp; \
diff omc_config.h omc_config.h.tmp > /dev/null; \
if [ $$? -eq 0 ]; then echo No change in version; rm omc_config.h.tmp; \
else echo version has changed. updating omc_config.h; \mv omc_config.h.tmp omc_config.h; \
fi; \
else \
echo "#define CONFIG_DEFAULT_OPENMODELICAHOME \"$(CONFIG_DEFAULT_OPENMODELICAHOME)\"" > omc_config.h; \
echo "#define LSB_RELEASE \"$(LSB_RELEASE)\"" >> omc_config.h; \
fi;

clean:
cd qjson && rm -rf build
$(MAKE) -C OMEdit/OMEditGUI -f Makefile.omdev.mingw clean
$(MAKE) -C OMEditLIB/Debugger/Parser -f Makefile.lib.omdev.mingw clean
test ! -f Makefile || $(MAKE) -f Makefile clean
rm -f bin/$(NAME)$(EXE) bin/$(LIB)$(LIBEXE)
rm -rf omc_config.h Makefile OMEditLIB/debug OMEditLIB/release OMEditLIB/generatedfiles OMEditLIB/Makefile OMEditLIB/Makefile.Debug OMEditLIB/Makefile.Release OMEditLIB/object_script.* OMEditGUI/debug OMEditGUI/release OMEditGUI/Makefile OMEditGUI/Makefile.Debug OMEditGUI/Makefile.Release

qjson-build:
test -d qjson
Expand Down
71 changes: 71 additions & 0 deletions OMEdit/Makefile.unix.in
@@ -0,0 +1,71 @@
all: omedit

resourcedir=./OMEditLIB/Resources/nls/

NAME=OMEdit
APP=@APP@
LIB=libOMEdit
LIBEXE=.a
QMAKE=@QMAKE@
LRELEASE=@LRELEASE@

CMAKE=CC="@CC@" CXX="@CXX@" CFLAGS="@CFLAGS@" CPPFLAGS="@CPPFLAGS@" cmake
CMAKE_TARGET = "Unix Makefiles"

install: build OMEditLIB/Resources/nls/qm.stamp
cp -p $(resourcedir)/*.qm @OMBUILDDIR@/share/omedit/nls/
if [ "$(APP)" = ".app" ]; then mkdir -p @OMBUILDDIR@/Applications/ ; cp -rp bin/OMEdit$(APP) @OMBUILDDIR@/Applications/ ; else cp -p bin/OMEdit @OMBUILDDIR@/bin/; fi
cp -p bin/$(LIB)$(LIBEXE) @OMBUILDDIR@/lib/@host_short@/omc/

OMEditLIB/Resources/nls/qm.stamp: OMEditLIB/OMEditLIB.pro OMEditLIB/Resources/nls/*.ts
$(LRELEASE) $<
@touch $@

$(NAME): parsergen qjson-build Makefile OMEditLIB/OMEditLIB.unix.config.pri OMEditGUI/OMEditGUI.unix.config.pri omc_config.h
$(MAKE) -f Makefile

build: $(NAME)

parsergen:
$(MAKE) -C OMEditLIB/Debugger/Parser -f Makefile.lib.unix

Makefile: OMEdit.pro OMEditLIB/OMEditLIB.unix.config.pri OMEditGUI/OMEditGUI.unix.config.pri
@test ! -f $@ || rm $@
$(QMAKE) -r
Makefile.unix: Makefile.unix.in
(cd @top_builddir@; ./config.status)
OMEditLIB/OMEditLIB.unix.config.pri: OMEditLIB/OMEditLIB.unix.config.pri.in
(cd @top_builddir@ && ./config.status)
OMEditGUI/OMEditGUI.unix.config.pri: OMEditGUI/OMEditGUI.unix.config.pri.in
(cd @top_builddir@ && ./config.status)
omc_config.h: omc_config.h.in
(cd @top_builddir@ && ./config.status)

mkbuilddirs:
mkdir -p @OMBUILDDIR@/share/omedit/nls @OMBUILDDIR@/bin @OMBUILDDIR@/lib/@host_short@/omc
omedit: mkbuilddirs install

clean:
test ! -f qjson/build/Makefile || $(MAKE) -C qjson/build clean
rm -rf qjson/build
$(MAKE) -C OMEditLIB/Debugger/Parser -f Makefile.lib.unix clean
test ! -f Makefile || $(MAKE) -f Makefile clean
rm -f bin/OMEdit$(APP) bin/$(LIB)$(LIBEXE)
rm -rf omc_config.h Makefile OMEditLIB/debug OMEditLIB/release OMEditLIB/generatedfiles OMEditLIB/Makefile OMEditLIB/Makefile.Debug OMEditLIB/Makefile.Release OMEditLIB/object_script.* OMEditGUI/debug OMEditGUI/release OMEditGUI/Makefile OMEditGUI/Makefile.Debug OMEditGUI/Makefile.Release

distclean: clean
rm -rf config.log config.sub config.status install-sh autom4te.cache config.guess configure Makefile.unix OMEditLIB/OMEditLIB.unix.config.pri OMEditGUI/OMEditGUI.unix.config.pri

config.status: configure
./config.status -recheck
configure: configure.ac common/m4/corba.m4 common/m4/omhome.m4 common/m4/qmake.m4
autoconf

qjson-build:
test -d qjson
mkdir -p qjson/build/include/qjson
(cd qjson/build && test -f Makefile || CC="@CC@" CXX="@CXX@" CFLAGS="@CFLAGS@" CPPFLAGS="@CPPFLAGS@" CXXFLAGS="@CXXFLAGS@" $(CMAKE) .. @QT4BUILD@ -G $(CMAKE_TARGET))
test -f qjson/build/lib/libqjson$(SHREXT) || $(MAKE) -C qjson/build
test ! `uname` = Darwin || install_name_tool -id @rpath/libqjson.0.dylib qjson/build/lib/libqjson.0.dylib
cp -a qjson/build/lib/libqjson*$(SHREXT)* @OMBUILDDIR@/lib/@host_short@/omc/
cp -a qjson/src/*.h qjson/build/include/qjson
38 changes: 38 additions & 0 deletions OMEdit/OMEdit.pro
@@ -0,0 +1,38 @@
#
# This file is part of OpenModelica.
#
# Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC),
# c/o Linköpings universitet, Department of Computer and Information Science,
# SE-58183 Linköping, Sweden.
#
# All rights reserved.
#
# THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR
# THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.
# ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
# OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE.
#
# The OpenModelica software and the Open Source Modelica
# Consortium (OSMC) Public License (OSMC-PL) are obtained
# from OSMC, either from the above address,
# from the URLs: http://www.ida.liu.se/projects/OpenModelica or
# http://www.openmodelica.org, and in the OpenModelica distribution.
# GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
#
# This program is distributed WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
# IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.
#
# See the full OSMC Public License conditions for more details.
#
#/

TEMPLATE = subdirs

CONFIG += ordered

SUBDIRS = OMEditLIB \
OMEditGUI

OMEditGUI.depends = OMEditLIB
27 changes: 0 additions & 27 deletions OMEdit/OMEdit/OMEditGUI/OMEdit.config.in

This file was deleted.

File renamed without changes.

0 comments on commit cc6e3e8

Please sign in to comment.