Skip to content

Commit 97378f5

Browse files
committed
Merge branch 'master' into tearing
2 parents 738aa2c + befd014 commit 97378f5

File tree

4 files changed

+48
-79
lines changed

4 files changed

+48
-79
lines changed

openmodelica/fmi/ModelExchange/1.0/Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ TanksConnectedPI.mos \
1818
CoupledClutches.mos \
1919
BooleanNetwork1.mos \
2020
IntegerNetwork1.mos \
21+
StringParameters.mos
2122

22-
# test that currently fail. Move up when fixed.
23+
# test that currently fail. Move up when fixed.
2324
# Run make testfailing
2425
FAILINGTESTFILES= \
2526

@@ -42,8 +43,8 @@ test:
4243
@echo
4344
@echo OPENMODELICAHOME=" $(OPENMODELICAHOME) "
4445
@$(TEST) $(TESTFILES)
45-
46-
# Cleans all files that are not listed as dependencies
46+
47+
# Cleans all files that are not listed as dependencies
4748
clean :
4849
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp
4950
@rm -f $(CLEAN)
@@ -52,11 +53,11 @@ clean :
5253
# do it after cleaning and updating the folder
5354
# then you can get a list of file names (which must be dependencies
5455
# since you got them from repository + your own new files)
55-
# then add them to the DEPENDENCIES. You can find the
56-
# list in deps.txt
57-
getdeps:
56+
# then add them to the DEPENDENCIES. You can find the
57+
# list in deps.txt
58+
getdeps:
5859
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp
59-
@echo $(CLEAN) | sed -r 's/deps.txt|deps.tmp//g' | sed 's/ / \\\n/g' > deps.txt
60+
@echo $(CLEAN) | sed -r 's/deps.txt|deps.tmp//g' | sed 's/ / \\\n/g' > deps.txt
6061
@echo Dependency list saved in deps.txt.
6162
@echo Copy the list from deps.txt and add it to the Makefile @DEPENDENCIES
6263

openmodelica/fmi/ModelExchange/1.0/StringParameters.mos

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ loadFile("StringParameters.mo"); getErrorString();
99
translateModelFMU(StringParameters); getErrorString();
1010
importFMU("StringParameters.fmu"); getErrorString();
1111
loadFile("StringParameters_me_FMU.mo"); getErrorString();
12-
simulate(StringParameters_me_FMU, stopTime=3.0); getErrorString();
13-
val(ball,0);
14-
val(ball,1);
15-
val(ball,3);
12+
simulate(StringParameters_me_FMU, stopTime=3.0, simflags="-output=sball,eball"); getErrorString();
1613

1714
// Result:
1815
// true
@@ -28,11 +25,11 @@ val(ball,3);
2825
// ""
2926
// record SimulationResult
3027
// resultFile = "StringParameters_me_FMU_res.mat",
31-
// simulationOptions = "startTime = 0.0, stopTime = 3.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'StringParameters_me_FMU', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
32-
// messages = ""
28+
// simulationOptions = "startTime = 0.0, stopTime = 3.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'StringParameters_me_FMU', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-output=sball,eball'",
29+
// messages = "time=3,sball=\"RedBall\",eball=\"BlueBall\"
30+
// "
3331
// end SimulationResult;
34-
// ""
35-
// 1.0
36-
// 0.2250205572103477
37-
// -0.9555203906613871
32+
// "[openmodelica/fmi/ModelExchange/1.0/StringParameters_me_FMU.mo:14:3-14:55:writable] Warning: Parameter eball has no value, and is fixed during initialization (fixed=true), using available start value (start="BlueBall") as default value.
33+
// [openmodelica/fmi/ModelExchange/1.0/StringParameters_me_FMU.mo:15:3-15:54:writable] Warning: Parameter sball has no value, and is fixed during initialization (fixed=true), using available start value (start="RedBall") as default value.
34+
// "
3835
// endResult

partest/runtests.pl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
my $check_proc_cpu = 1;
6060
my $withxml = 0;
6161
my $withxmlcmd = 0;
62+
my $withtxt = 0;
6263
my $have_dwdiff = "";
6364

6465
{
@@ -90,6 +91,7 @@
9091
print(" -nocolour Don't use colours in output.\n");
9192
print(" -counttests Don't run the test; only count them.\n");
9293
print(" -with-xml Output XML log.\n");
94+
print(" -with-txt Output TXT log.\n");
9395
print(" -failing Run failing tests instead of working.\n");
9496
print(" -veryfew Run only a very small number of tests to see if runtests.pl is working.\n");
9597
print(" -gitlibs If you have installed omc using GITLIBRARIES=Yes, you can test some of those libraries.\n");
@@ -127,6 +129,9 @@
127129
$withxml = 1;
128130
$withxmlcmd = '-with-xml';
129131
}
132+
elsif(/^-with-txt$/) {
133+
$withtxt = 1;
134+
}
130135
elsif(/^-failing$/) {
131136
$run_failing = 1;
132137
}
@@ -357,6 +362,20 @@ sub run_tests {
357362
foreach my $failed_test (@sorted) {
358363
print "\t" . $failed_test . "\n";
359364
}
365+
366+
if($withtxt) {
367+
unlink("$testsuite_root/failed.log");
368+
open my $TXTOUT, '>', "$testsuite_root/failed.log" or die "Couldn't open failed.log: $!";
369+
binmode $TXTOUT, ":encoding(UTF-8)";
370+
371+
print $TXTOUT "Failed tests:\n";
372+
foreach my $failed_test (@sorted) {
373+
print $TXTOUT $failed_test . "\n";
374+
}
375+
376+
print $TXTOUT "\n$tests_failed of $test_count failed\n";
377+
close $TXTOUT;
378+
}
360379
}
361380

362381
if ($slowest) {
Lines changed: 14 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,38 @@
11
// name: complexFun1
22
// status: correct
33

4-
loadFile("ComplexFun.mo");
5-
getErrorString();
4+
loadFile("ComplexFun.mo"); getErrorString();
65

7-
simulate(problem1);
8-
getErrorString();
6+
simulate(problem1); getErrorString();
97

108
val(x,{0.0,0.1,0.2,0.7,1.0});
11-
getErrorString();
129

13-
simulate(problem2);
14-
getErrorString();
10+
simulate(problem2); getErrorString();
1511

1612
val(y,{0.0,0.1,0.2,0.7,1.0});
17-
val(z,{0.0,0.1,0.2,0.7,1.0});
18-
getErrorString();
13+
val(z,{0.0,0.1,0.2,0.7,1.0});
1914

2015
setCommandLineOptions("+cseEachCall"); getErrorString();
21-
simulate(problem1);
22-
getErrorString();
16+
simulate(problem1); getErrorString();
2317

24-
val(x,{0.0,0.1,0.2,0.7,1.0});
25-
getErrorString();
18+
val(x,{0.0,0.1,0.2,0.7,1.0}); getErrorString();
2619

27-
simulate(problem2);
28-
getErrorString();
20+
simulate(problem2); getErrorString();
2921

3022
val(y,{0.0,0.1,0.2,0.7,1.0});
3123
val(z,{0.0,0.1,0.2,0.7,1.0});
32-
getErrorString();
3324

3425
setCommandLineOptions("+d=disableSimplifyComplexFunction +cseEachCall=false"); getErrorString();
35-
simulate(problem1);
36-
getErrorString();
26+
simulate(problem1); getErrorString();
3727

3828
val(x,{0.0,0.1,0.2,0.7,1.0});
39-
getErrorString();
4029

41-
simulate(problem2);
42-
getErrorString();
43-
44-
val(y,{0.0,0.1,0.2,0.7,1.0});
45-
getErrorString();
30+
simulate(problem2); getErrorString() == "";
4631

4732
setCommandLineOptions("+d=disableSimplifyComplexFunction +cseEachCall"); getErrorString();
48-
simulate(problem1);
49-
getErrorString();
50-
51-
val(x,{0.0,0.1,0.2,0.7,1.0});
52-
getErrorString();
53-
54-
simulate(problem2);
55-
getErrorString();
56-
57-
val(y,{0.0,0.1,0.2,0.7,1.0});
58-
getErrorString();
33+
simulate(problem1); getErrorString() == "";
5934

35+
simulate(problem2); getErrorString() == "";
6036

6137
// Result:
6238
// true
@@ -68,7 +44,6 @@ getErrorString();
6844
// end SimulationResult;
6945
// ""
7046
// {0.0,0.2720759220056126,0.4824045318333194,1.445553342178025,2.0}
71-
// ""
7247
// record SimulationResult
7348
// resultFile = "problem2_res.mat",
7449
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'problem2', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
@@ -77,7 +52,6 @@ getErrorString();
7752
// ""
7853
// {-1.0,-1.216227766016838,-1.247213595499958,-1.136660026534076,-1.0}
7954
// {1.0,1.216227766016838,1.247213595499958,1.136660026534076,1.0}
80-
// ""
8155
// true
8256
// ""
8357
// record SimulationResult
@@ -96,7 +70,6 @@ getErrorString();
9670
// ""
9771
// {-1.0,-1.216227766016838,-1.247213595499958,-1.136660026534076,-1.0}
9872
// {1.0,1.216227766016838,1.247213595499958,1.136660026534076,1.0}
99-
// ""
10073
// true
10174
// ""
10275
// record SimulationResult
@@ -106,45 +79,24 @@ getErrorString();
10679
// end SimulationResult;
10780
// ""
10881
// {0.0,0.2720759220056126,0.4824045318333193,1.445553342178025,2.0}
109-
// ""
11082
// record SimulationResult
11183
// resultFile = "",
11284
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'problem2', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
11385
// messages = "Failed to build model: problem2"
11486
// end SimulationResult;
115-
// "[CodegenCFunctions.tpl:2747:11-2747:11:writable] Error: Template error: tupleReturnVariableUpdates: Unhandled expression. -$TMP_problem2_f1.z
116-
// [CodegenCFunctions.tpl:2747:11-2747:11:writable] Error: Template error: tupleReturnVariableUpdates: Unhandled expression. -$TMP_problem2_f5.z
117-
// [CodegenCFunctions.tpl:2747:11-2747:11:writable] Error: Template error: tupleReturnVariableUpdates: Unhandled expression. -$TMP_problem2_f1.z
118-
// [CodegenCFunctions.tpl:2747:11-2747:11:writable] Error: Template error: tupleReturnVariableUpdates: Unhandled expression. -$TMP_problem2_f5.z
119-
// "
120-
// {0.0,-0.07207592200561265,-0.08240453183331929,-0.04555334217802521,8.980666631940483e-19}
121-
// ""
87+
// false
12288
// true
12389
// ""
12490
// record SimulationResult
12591
// resultFile = "",
12692
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'problem1', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
12793
// messages = "Failed to build model: problem1"
12894
// end SimulationResult;
129-
// "Warning: There are iteration variables with default zero start attribute. Use +d=initialization for more information.
130-
// [SimCode/SimCodeUtil.mo:2364:7-2364:46:writable] Error: Internal error function createNonlinearResidualEquationsComplex failed for: (x, y) = ($cse1, $cse2)
131-
// [simulation/modelica/others/ComplexFun.mo:14:5-14:41:writable] Error: Internal error function createNonlinearResidualEquations failed for equation: (x, y) = ($cse1, $cse2)
132-
// [SimCode/SimCodeUtil.mo:2866:9-2866:50:writable] Error: Internal error function createOdeSystem failed for component torn nonlinear Equationsystem{{{2:4, 5}},
133-
// {3:2, 1} Size: 2
134-
// [SimCode/SimCodeUtil.mo:474:5-474:146:writable] Error: Internal error function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]
135-
// "
136-
// {0.0,0.2720759220056126,0.4824045318333193,1.445553342178025,2.0}
137-
// ""
95+
// false
13896
// record SimulationResult
13997
// resultFile = "",
14098
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'problem2', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
14199
// messages = "Failed to build model: problem2"
142100
// end SimulationResult;
143-
// "[SimCode/SimCodeUtil.mo:2364:7-2364:46:writable] Error: Internal error function createNonlinearResidualEquationsComplex failed for: (x, -z) = ($cse1, $cse2)
144-
// [simulation/modelica/others/ComplexFun.mo:31:5-31:37:writable] Error: Internal error function createNonlinearResidualEquations failed for equation: (x, -z) = ($cse1, $cse2)
145-
// [SimCode/SimCodeUtil.mo:4754:7-4754:46:writable] Error: Internal error complex equations currently only supported on form v = functioncall(...). Equation: (x, -z) = ($cse1, $cse2) solve for {z,x}
146-
// [SimCode/SimCodeUtil.mo:474:5-474:146:writable] Error: Internal error function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]
147-
// "
148-
// {0.0,-0.07207592200561265,-0.08240453183331929,-0.04555334217802521,8.980666631940483e-19}
149-
// ""
101+
// false
150102
// endResult

0 commit comments

Comments
 (0)