Commit a532f4fd authored by balaskoa's avatar balaskoa
Browse files

Json tests have been corrected to dynamic test jobs


Signed-off-by: default avatarbalaskoa <Jeno.Balasko@ericsson.com>
Change-Id: I2960726886f5c27f91de748984a8c8268b041e1d
parent 572b7e7d
......@@ -10,150 +10,57 @@
# Balasko, Jeno
#
##############################################################################
# uncomment this line to use alternative runtime (TITAN_RUNTIME_2)
# RT2 = yes
# The following make commands are available:
# - make, make all Builds the executable test suite.
# - make compile Translates TTCN-3 and ASN.1 modules to C++.
# - make clean Removes all generated files.
# - make dep Creates/updates dependency list.
# - make archive Archives all source files.
#
# Set these variables...
#
TOPDIR := ../../../
include $(TOPDIR)/Makefile.regression
# The path of your TTCN-3 Test Executor installation:
# Uncomment this line to override the environment variable.
# TTCN3_DIR =
# Your platform: (SOLARIS, LINUX, FREEBSD or WIN32)
ifndef PLATFORM
PLATFORM = SOLARIS
endif
# Your C++ compiler:
#CXX = g++
# Flags for the C++ preprocessor (and makedepend as well):
CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)/include -I$(XMLDIR)/include/libxml2
ifdef RT2
CPPFLAGS += -DTITAN_RUNTIME_2
endif
ifeq ($(DEBUG), yes)
CPPFLAGS += -DMEMORY_DEBUG
endif
# Flags for the C++ compiler:
CXXFLAGS = -Wall
# Flags for the linker:
LDFLAGS =
# Flags for the TTCN-3 and ASN.1 compiler:
COMPILER_FLAGS = -L
ifdef RT2
COMPILER_FLAGS += -R
endif
# Execution mode: (either ttcn3 or ttcn3-parallel)
ifndef RT2
TTCN3_LIB = ttcn3
else
TTCN3_LIB = ttcn3-rt2
endif
# The path of your OpenSSL installation:
# If you do not have your own one, leave it unchanged.
OPENSSL_DIR = $(TTCN3_DIR)
# Directory to store the archived source files:
# Note: you can set any directory except ./archive
ARCHIVE_DIR = ./backup
.SUFFIXES: .ttcn .asn .hh
.PHONY: all clean dep run distclean
#
# You may change these variables. Add your files if necessary...
#
TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
# The TTCN-3 modules needed for this project:
TTCN3_MODULES = JsonBasicASN1EncDecTest1.ttcn JsonBasicEncDecTest_os.ttcn JsonBasicTypeF.ttcn\
JsonBasicTypeOS.ttcn JsonTypeAny.ttcn JsonBasicTypeAltstep.ttcn JsonBasicTypeFuncRef.ttcn\
JsonBasicTypes.ttcn JsonTypeAny2.ttcn JsonBasicAttributeTest.ttcn JsonBasicTypeBS.ttcn JsonBasicTypeHS.ttcn \
JsonEncDecFunctions.ttcn JsonTypeRec.ttcn\
JsonBasicEncDecTest_bs.ttcn JsonBasicTypeE.ttcn JsonBasicTypeI.ttcn JsonRoUBug1.ttcn
# The ASN.1 modules needed for this project:
ASN1_MODULES = JsonBasicASN1Types.asn
# C++ source & header files generated by TTCN-3 & ASN.1 compilers:
GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
GENERATED_HEADERS = $(TTCN3_MODULES:.ttcn=.hh) $(ASN1_MODULES:.asn=.hh)
# Source & header files of Test Ports and your other modules:
USER_SOURCES =
USER_HEADERS =
# All object files needed for the executable test suite:
OBJECTS = $(GENERATED_SOURCES:.cc=.o)
# The name of the executable test suite:
TARGET = JsonBasicTest.exe
GENERATED_SOURCES = $(ASN1_MODULES:.asn=.cc) $(TTCN3_MODULES:.ttcn=.cc)
ifeq ($(COVERAGE), yes)
CPPFLAGS += -fprofile-arcs -ftest-coverage -g
CXXFLAGS += -fprofile-arcs -ftest-coverage -g
LDFLAGS += -fprofile-arcs -ftest-coverage -g -lgcov
GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
ifdef CODE_SPLIT
GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc))
else ifdef SPLIT_TO_SLICES
POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_))
POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc))
GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES)))
GENERATED_SOURCES += $(GENERATED_SOURCES2)
endif
#
# Do not modify these unless you know what you are doing...
#
SOLARIS_LIBS = -lxnet -L$(XMLDIR)/lib -lxml2 -lresolv -lcurses
SOLARIS8_LIBS = -lxnet -L$(XMLDIR)/lib -lxml2 -lresolv -lnsl -lsocket -lcurses
LINUX_LIBS = -L$(XMLDIR)/lib -lxml2 -lpthread -lrt -lncurses
FREEBSD_LIBS = -L$(XMLDIR)/lib -lxml2 -lncurses
WIN32_LIBS = -L$(XMLDIR)/lib -lxml2 -lncurses
OBJECTS = $(GENERATED_SOURCES:.cc=.o)
#
# Rules for building the executable...
#
all: $(TARGET) ;
TARGET = JsonBasicTest$(EXESUFFIX)
$(TARGET): $(OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $(OBJECTS) -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
-L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS)
all: $(TARGET)
.cc.o .c.o:
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $<
$(TARGET): $(GENERATED_SOURCES) $(USER_SOURCES)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) -L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS)
$(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
@if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
compile: $(TTCN3_MODULES) $(ASN1_MODULES)
$(TTCN3_DIR)/bin/compiler $(COMPILER_FLAGS) $(TTCN3_MODULES) \
$(ASN1_MODULES) $(ASN1_STATIC_MODULES) - $?
touch $@
run: $(TARGET) JsonBasicTest.cfg
./$^ 2> result.txt
cat result.txt
@grep "Overall verdict: pass" result.txt
$(TTCN3_COMPILER) $(COMPILER_FLAGS) $^
clean distclean:
-$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
$(GENERATED_SOURCES) compile *.log *.gcda *.gcno
$(RM) $(TARGET) $(GENERATED_HEADERS) $(GENERATED_SOURCES) $(OBJECTS) *.log Makefile.bak compile
dep: $(GENERATED_SOURCES)
makedepend $(CPPFLAGS) $(USER_SOURCES) $(GENERATED_SOURCES)
makedepend $(CPPFLAGS) $(GENERATED_SOURCES)
archive:
mkdir -p $(ARCHIVE_DIR)
tar -cvhf - $(TTCN3_MODULES) $(ASN1_MODULES) \
$(USER_HEADERS) $(USER_SOURCES) Makefile \
| gzip >$(ARCHIVE_DIR)/$(TARGET)-`date '+%y%m%d-%H%M'`.tgz
run: $(TARGET)
./$(TARGET) JsonBasicTest.cfg 2> result.txt
cat result.txt
grep "Overall verdict: pass" result.txt
json
json.exe
AttributeTestcases*.cc
AttributeTestcases*.hh
JsonFunctions*.cc
JsonFunctions*.hh
JsonData*.cc
JsonData*.hh
OtherTypes*.cc
OtherTypes*.hh
SemanticCheck*.cc
SemanticCheck*.hh
JsonTestcases*.cc
JsonTestcases*.hh
JsonTypes*.cc
JsonTypes*.hh
Cbor*.cc
Cbor*.hh
Bson*.cc
Bson*.hh
*.cc
*.hh
*.o
logs
compile
result.txt
##############################################################################
# Copyright (c) 2000-2019 Ericsson Telecom AB
# Copyright (c) 2000-2020 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
......@@ -27,7 +27,7 @@ endif
ASN1_MODULES = JsonData.asn
GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
GENERATED_SOURCES = $(ASN1_MODULES:.asn=.cc) $(TTCN3_MODULES:.ttcn=.cc)
GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
ifdef CODE_SPLIT
GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc))
......@@ -38,9 +38,7 @@ GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(f
GENERATED_SOURCES += $(GENERATED_SOURCES2)
endif
USER_SOURCES =
OBJECTS = $(GENERATED_SOURCES:.cc=.o) $(USER_SOURCES:.cc=.o)
OBJECTS = $(GENERATED_SOURCES:.cc=.o)
TARGET = json$(EXESUFFIX)
......@@ -49,29 +47,23 @@ all: $(TARGET)
$(TARGET): $(GENERATED_SOURCES) $(USER_SOURCES)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) -L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS)
#.ttcn.cc .ttcn.hh:
# $(TTCN3_COMPILER) $<
$(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
@if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
compile: $(TTCN3_MODULES) $(ASN1_MODULES)
$(filter-out -Nold -E, $(TTCN3_COMPILER)) $(COMPILER_FLAGS) $^
touch compile
$(TTCN3_COMPILER) $(COMPILER_FLAGS) $^
#???:
#compile: $(TTCN3_MODULES) $(ASN1_MODULES)
# $(filter-out -Nold -E, $(TTCN3_COMPILER)) $(COMPILER_FLAGS) $^
# touch compile
clean distclean:
-rm -rf $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
$(GENERATED_SOURCES) *.log Makefile.bak compile logs
$(RM) $(TARGET) $(GENERATED_HEADERS) $(GENERATED_SOURCES) $(OBJECTS) *.log Makefile.bak compile
dep: $(GENERATED_SOURCES)
makedepend $(CPPFLAGS) $(GENERATED_SOURCES)
run: $(TARGET) JSON.cfg
./$^
.NOTPARALLEL:
ifdef SRCDIR
$(foreach src, $(USER_SOURCES), $(eval vpath $(src) $(ABS_SRC)))
endif
run: $(TARGET)
./$(TARGET) JSON.cfg 2> result.txt
cat result.txt
grep "Overall verdict: pass" result.txt
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment