Skip to content

Commit 2abe232

Browse files
authored
Merge branch 'master' into 4242
2 parents 1c2f8d4 + 853b72b commit 2abe232

321 files changed

Lines changed: 26475 additions & 12361 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.CI/Jenkinsfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,14 @@ def allAutotools() {
197197
def autotools(CC, CPPFLAGS, config, nostatic, dotest) {
198198
sh label: "Build $CC $CPPFLAGS", script: """
199199
export CC=$CC
200-
export CPPFLAGS="$CPPFLAGS -I${WORKSPACE}/.CI/Test"
200+
export CPPFLAGS=$CPPFLAGS
201201
export CFLAGS="-Os -fPIC"
202202
rm -rf Modelica/Resources/Library/*
203203
mkdir -p Modelica/Resources/Library/\$LIBDIR
204204
cd Modelica/Resources/BuildProjects/autotools
205205
git clean -fdx .
206206
./autogen.sh
207-
./configure --libdir="${WORKSPACE}/Modelica/Resources/Library/\$LIBDIR" $config
207+
./configure --libdir="\$PWD/../../Library/\$LIBDIR" $config
208208
make --output-sync -j${numPhysicalCPU()}
209209
make install
210210
"""
@@ -223,7 +223,7 @@ def makefile(CC, dotest) {
223223
rm -rf Modelica/Resources/Library/*
224224
mkdir -p "Modelica/Resources/Library/$LIBDIR"
225225
cd Modelica/Resources/BuildProjects/gcc
226-
make --output-sync -j${numPhysicalCPU()} TARGETDIR="$LIBDIR" CPPFLAGS="-I${WORKSPACE}/.CI/Test"
226+
make --output-sync -j${numPhysicalCPU()} TARGETDIR="$LIBDIR"
227227
"""
228228
sh label: "Test $CC", script: """
229229
export CC=$CC

.CI/Test/Common.c

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
1-
#include "ModelicaUtilities.h"
1+
#include "../../Modelica/Resources/C-Sources/ModelicaUtilities.h"
22
#include <assert.h>
33
#include <stdlib.h>
44
#include <stdio.h>
5+
#include <string.h>
56

67
char* ModelicaAllocateString(size_t len) {
78
void *data = malloc(len + 1); /* Never free'd in the test programs */
8-
assert(data);
9+
if (NULL == data) {
10+
ModelicaError("Failed to allocate string");
11+
}
912
return data;
1013
}
1114

1215
char* ModelicaAllocateStringWithErrorReturn(size_t len) {
1316
return malloc(len + 1); /* Never free'd in the test programs */
1417
}
1518

19+
char* ModelicaDuplicateString(const char* str) {
20+
void *data = malloc(strlen(str) + 1); /* Never free'd in the test programs */
21+
if (NULL == data) {
22+
ModelicaError("Failed to duplicate string");
23+
}
24+
strcpy(data, str);
25+
return data;
26+
}
27+
28+
char* ModelicaDuplicateStringWithErrorReturn(const char* str) {
29+
void *data = malloc(strlen(str) + 1); /* Never free'd in the test programs */
30+
if (NULL != data) {
31+
strcpy(data, str);
32+
}
33+
return data;
34+
}
35+
1636
void ModelicaMessage(const char *string) {
1737
printf("%s\n", string);
1838
}
@@ -24,7 +44,7 @@ void ModelicaWarning(const char *string) {
2444
void ModelicaError(const char *string) {
2545
fputs(string, stderr);
2646
fputc('\n', stderr);
27-
assert(0);
47+
abort();
2848
}
2949

3050
void ModelicaFormatMessage(const char *string, ...) {
@@ -58,5 +78,5 @@ void ModelicaVFormatWarning(const char *string, va_list args) {
5878

5979
void ModelicaVFormatError(const char *string, va_list args) {
6080
vfprintf(stderr, string, args);
61-
assert(0);
81+
abort();
6282
}

.CI/checkHTMLDoc/checkLinks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
'''
5-
Copyright (C) 2020, Modelica Association and contributors
5+
Copyright (C) 2020-2025, Modelica Association and contributors
66
All rights reserved.
77
88
Check Modelica HTML documentation for link validity

.CI/checkHTMLDoc/checkTags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
'''
5-
Copyright (C) 2020, Modelica Association and contributors
5+
Copyright (C) 2020-2025, Modelica Association and contributors
66
All rights reserved.
77
88
Check Modelica HTML documentation for tag validity

.CI/checkHTMLDoc/tidyHTML.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
'''
5-
Copyright (C) 2020, Modelica Association and contributors
5+
Copyright (C) 2020-2025, Modelica Association and contributors
66
All rights reserved.
77
88
Check Modelica HTML documentation with HTML Tidy

.CI/check_deprecated_line_color.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
'''
5-
Copyright (C) 2021-2023, Modelica Association and contributors
5+
Copyright (C) 2021-2025, Modelica Association and contributors
66
All rights reserved.
77
88
Check for deprecated Text.lineColor annotation

.CI/check_html.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
'''
5-
Copyright (C) 2020, Modelica Association and contributors
5+
Copyright (C) 2020-2025, Modelica Association and contributors
66
All rights reserved.
77
88
Check Modelica HTML documentation for validity

.CI/classCoverage/CountClasses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
'''
5-
Copyright (C) 2020, Modelica Association and contributors
5+
Copyright (C) 2020-2025, Modelica Association and contributors
66
All rights reserved.
77
88
Print class coverage for all classes, sorted by reference count

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Explicitly declare text files we want to always be normalized and converted
55
# to native line endings on checkout.
66
*.c text
7+
*.cmake text
78
*.csv text
89
*.h text
910
*.htm* text
@@ -46,3 +47,5 @@ Modelica/Resources/Images/Magnetic/FluxTubes/Shapes/HollowCylinder.vsdx export-i
4647
Modelica/Resources/Images/Magnetic/FluxTubes/Shapes/Toroid.vsdx export-ignore
4748
Modelica/Resources/Reference export-ignore
4849
ModelicaTest/Resources/Reference export-ignore
50+
51+
*.mo linguist-language=Modelica

.github/workflows/checkCI.yml

Lines changed: 121 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,37 @@
11
name: CI
22

3-
on: [pull_request]
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
defaults:
9+
run:
10+
shell: bash
411

512
jobs:
613
external_c_checks:
714
timeout-minutes: 5
815
runs-on: ubuntu-latest
916
steps:
10-
- uses: actions/checkout@v3
17+
- name: Checkout code
18+
uses: actions/checkout@v4
1119
with:
1220
fetch-depth: 5
13-
- name: Build libraries
21+
- name: Configure
1422
run: |
1523
rm -rf Modelica/Resources/Library/*
1624
mkdir -p Modelica/Resources/Library/$LIBDIR
1725
pushd Modelica/Resources/BuildProjects/autotools
1826
git clean -fdx .
1927
./autogen.sh
20-
./configure --libdir="$PWD/../../Library/$LIBDIR" --enable-static --disable-shared --enable-static-zlib --disable-hdf5 CPPFLAGS="-I${GITHUB_WORKSPACE}/.CI/Test"
28+
./configure --libdir="$PWD/../../Library/$LIBDIR" --enable-static --disable-shared --enable-static-zlib --disable-hdf5
29+
popd
30+
env:
31+
LIBDIR: linux64
32+
- name: Build
33+
run: |
34+
pushd Modelica/Resources/BuildProjects/autotools
2135
make --output-sync
2236
sudo make install
2337
popd
@@ -30,15 +44,107 @@ jobs:
3044
env:
3145
LIBDIR: linux64
3246
CC: gcc
47+
48+
external_c_checks_cmake:
49+
name: external_c_checks_cmake_${{ matrix.toolchain }}
50+
runs-on: ${{ matrix.os }}
51+
timeout-minutes: 5
52+
strategy:
53+
matrix:
54+
toolchain:
55+
- linux-gcc
56+
- macos-clang
57+
- windows-msvc
58+
- windows-mingw
59+
configuration:
60+
- Debug
61+
include:
62+
- toolchain: linux-gcc
63+
os: ubuntu-latest
64+
compiler: gcc
65+
- toolchain: macos-clang
66+
os: macos-latest
67+
compiler: clang
68+
- toolchain: windows-msvc
69+
os: windows-latest
70+
compiler: msvc
71+
- toolchain: windows-mingw
72+
os: windows-latest
73+
compiler: mingw
74+
steps:
75+
- name: Checkout code
76+
uses: actions/checkout@v4
77+
with:
78+
fetch-depth: 5
79+
- name: Configure
80+
run: |
81+
if [ "${{ matrix.compiler }}" == "msvc" ]; then
82+
cmake -S "$SRCDIR" -B build -DMODELICA_DEBUG_TIME_EVENTS=ON
83+
elif [ "${{ matrix.compiler }}" == "mingw" ]; then
84+
cmake -S "$SRCDIR" -B build -DMODELICA_DEBUG_TIME_EVENTS=ON -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -G "MinGW Makefiles"
85+
else
86+
cmake -S "$SRCDIR" -B build -DMODELICA_DEBUG_TIME_EVENTS=ON -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_C_FLAGS="-std=c89 -Wall -Wextra"
87+
fi
88+
env:
89+
SRCDIR: ${{ github.workspace }}/Modelica/Resources
90+
- name: Build with ${{ matrix.compiler }}
91+
run: |
92+
if [ "${{ matrix.compiler }}" == "msvc" ]; then
93+
cmake --build build --config ${{ matrix.configuration }}
94+
else
95+
cmake --build build -- -j8
96+
fi
97+
- name: Run tests
98+
run: ctest --no-tests=error --test-dir build --build-config ${{ matrix.configuration }} --verbose
99+
100+
external_c_checks_cmake_cygwin:
101+
name: external_c_checks_cmake_windows-cygwin
102+
runs-on: windows-latest
103+
timeout-minutes: 5
104+
steps:
105+
- name: Set git to use LF
106+
run: git config --global core.autocrlf input
107+
- name: Checkout code
108+
uses: actions/checkout@v4
109+
with:
110+
fetch-depth: 5
111+
- name: Setup cygwin
112+
uses: cygwin/cygwin-install-action@master
113+
with:
114+
packages: >-
115+
cmake
116+
gcc-core
117+
make
118+
ninja
119+
- name: Configure
120+
run: |
121+
export PATH=/usr/bin:$PATH
122+
cmake -S "$(cygpath ${SRCDIR})" -B build -DMODELICA_DEBUG_TIME_EVENTS=ON -DCMAKE_BUILD_TYPE=Debug -G Ninja
123+
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'
124+
env:
125+
CYGWIN_NOWINPATH: 1
126+
SRCDIR: ${{ github.workspace }}/Modelica/Resources
127+
- name: Build with gcc
128+
run: |
129+
export PATH=/usr/bin:$PATH
130+
cmake --build build -- -j8
131+
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'
132+
- name: Run tests
133+
run: |
134+
export PATH=/usr/bin:$PATH
135+
ctest --no-tests=error --test-dir build --build-config Debug --verbose
136+
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'
137+
33138
html_documentation_checks:
34139
timeout-minutes: 5
35140
runs-on: ubuntu-latest
36141
steps:
37-
- uses: actions/checkout@v3
142+
- name: Checkout code
143+
uses: actions/checkout@v4
38144
with:
39145
fetch-depth: 5
40146
- name: Setup python environment
41-
uses: actions/setup-python@v4
147+
uses: actions/setup-python@v5
42148
with:
43149
python-version: 3.8
44150
- name: Install python packages
@@ -49,7 +155,7 @@ jobs:
49155
run: |
50156
git clone --branch 5.8.0 --depth=1 https://github.com/htacg/tidy-html5.git
51157
pushd tidy-html5
52-
cmake .
158+
cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 .
53159
make
54160
sudo make install
55161
popd
@@ -64,11 +170,13 @@ jobs:
64170
echo "::add-matcher::./.github/checkTags.json"
65171
python ./.CI/check_html.py checkTags ./
66172
echo "::remove-matcher owner=checkTags::"
173+
67174
syntax_checks:
68175
timeout-minutes: 5
69176
runs-on: ubuntu-latest
70177
steps:
71-
- uses: actions/checkout@v3
178+
- name: Checkout code
179+
uses: actions/checkout@v4
72180
with:
73181
fetch-depth: 5
74182
- name: Get moparser
@@ -80,17 +188,19 @@ jobs:
80188
- name: Check syntax
81189
run: |
82190
echo "::add-matcher::./.github/moparser.json"
83-
ModelicaSyntaxChecker/Linux64/moparser -v 3.4 -r Complex.mo Modelica ModelicaReference ModelicaServices ModelicaTest ModelicaTestConversion4.mo ModelicaTestOverdetermined.mo ObsoleteModelica4.mo
191+
ModelicaSyntaxChecker/Linux64/moparser -v 3.6 -r Complex.mo Modelica ModelicaReference ModelicaServices ModelicaTest ModelicaTestConversion4.mo ModelicaTestOverdetermined.mo ObsoleteModelica4.mo
84192
echo "::remove-matcher owner=moparser::"
193+
85194
deprecation_checks:
86195
timeout-minutes: 5
87196
runs-on: ubuntu-latest
88197
steps:
89-
- uses: actions/checkout@v3
198+
- name: Checkout code
199+
uses: actions/checkout@v4
90200
with:
91201
fetch-depth: 5
92202
- name: Setup python environment
93-
uses: actions/setup-python@v4
203+
uses: actions/setup-python@v5
94204
with:
95205
python-version: 3.8
96206
- name: Check deprecated Text.lineColor annotation

0 commit comments

Comments
 (0)