Skip to content

Commit 10ea9f5

Browse files
committed
Merge branch 'mr/boris/ci' into 'master'
Update CI to use improved anod spec See merge request eng/toolchain/gnatcoll-bindings!15
2 parents 49e7c4f + fde2b3e commit 10ea9f5

File tree

7 files changed

+122
-189
lines changed

7 files changed

+122
-189
lines changed

.gitlab-ci.yml

Lines changed: 10 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -45,70 +45,24 @@ default:
4545
echo "sourcing the generic CI environment"
4646
. /tmp/ci_env.sh
4747
48-
# generic_anod_ci modifies the rebuild strategy of anod.
49-
# Set it back to full, so we do not rebuild the packages depending
50-
# on gnatcoll-core and contained in GNAT.
51-
exec anod tune --full
5248
exec anod vcs --list
5349
5450
########
5551
# JOBS #
5652
########
5753

58-
build_and_test_py39:
54+
build_and_test:
5955
services:
6056
- image:e3
6157
- cpu:2
6258
stage: build
59+
interruptible: true
60+
parallel:
61+
matrix:
62+
- PYTHON: ["3.9", "3.10", "3.11", "3.12"]
6363
script:
64-
- anod vcs --add-repo gnatcoll-bindings $CI_PROJECT_DIR
65-
- anod build --latest gnatcoll-bindings -Qpython=3.9
66-
- BS=`anod info build gnatcoll-bindings -Qpython=3.9 --show build_space`
67-
- eval `anod printenv gnatcoll-bindings -Qpython=3.9 --build-env`
68-
- export GPR_PROJECT_PATH=/tmp/it/wave/x86_64-linux/$BS/install/share/gpr:$GPR_PROJECT_PATH
69-
- export ADA_PYTHON_HOME=/tmp/it/wave/x86_64-linux/tp-python_3.9/install
70-
- ls /tmp/it/wave/x86_64-linux/$BS/install/share/gpr || ls -R /tmp/it/wave/x86_64-linux/
71-
- cd $CI_PROJECT_DIR/python3/tests && /it/e3/bin/python ./testsuite.py -v
72-
73-
build_and_test_py310:
74-
services:
75-
- image:e3
76-
- cpu:2
77-
stage: build
78-
script:
79-
- anod vcs --add-repo gnatcoll-bindings $CI_PROJECT_DIR
80-
- anod build --latest gnatcoll-bindings -Qpython=3.10
81-
- BS=`anod info build gnatcoll-bindings -Qpython=3.10 --show build_space`
82-
- eval `anod printenv gnatcoll-bindings -Qpython=3.10 --build-env`
83-
- export GPR_PROJECT_PATH=/tmp/it/wave/x86_64-linux/$BS/install/share/gpr:$GPR_PROJECT_PATH
84-
- export ADA_PYTHON_HOME=/tmp/it/wave/x86_64-linux/tp-python_3.10/install
85-
- cd $CI_PROJECT_DIR/python3/tests && /it/e3/bin/python ./testsuite.py -v
86-
87-
build_and_test_py311:
88-
services:
89-
- image:e3
90-
- cpu:2
91-
stage: build
92-
script:
93-
- anod vcs --add-repo gnatcoll-bindings $CI_PROJECT_DIR
94-
- anod build --latest gnatcoll-bindings -Qpython=3.11
95-
- BS=`anod info build gnatcoll-bindings -Qpython=3.11 --show build_space`
96-
- eval `anod printenv gnatcoll-bindings -Qpython=3.11 --build-env`
97-
- export GPR_PROJECT_PATH=/tmp/it/wave/x86_64-linux/$BS/install/share/gpr:$GPR_PROJECT_PATH
98-
- export ADA_PYTHON_HOME=/tmp/it/wave/x86_64-linux/tp-python/install
99-
- cd $CI_PROJECT_DIR/python3/tests && /it/e3/bin/python ./testsuite.py -v
100-
101-
build_and_test_py312:
102-
services:
103-
- image:e3
104-
- cpu:2
105-
stage: build
106-
script:
107-
- anod vcs --add-repo gnatcoll-bindings $CI_PROJECT_DIR
108-
- anod build --latest gnatcoll-bindings -Qpython=3.12
109-
- BS=`anod info build gnatcoll-bindings -Qpython=3.12 --show build_space`
110-
- eval `anod printenv gnatcoll-bindings -Qpython=3.12 --build-env`
111-
- export GPR_PROJECT_PATH=/tmp/it/wave/x86_64-linux/$BS/install/share/gpr:$GPR_PROJECT_PATH
112-
- export ADA_PYTHON_HOME=/tmp/it/wave/x86_64-linux/tp-python_3.12/install
113-
- cd $CI_PROJECT_DIR/python3/tests && /it/e3/bin/python ./testsuite.py -v
114-
64+
- anod test --latest gnatcoll-bindings -Qpython=$PYTHON
65+
- testsuite_reports
66+
artifacts:
67+
reports:
68+
junit: xunit-*.xml

testsuite/support/test.gpr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
-- The scenario variable TEST_SOURCES is automatically set by the
44
-- driver to point to the test sources.
55
with "gnatcoll_core";
6-
with "gnatcoll_iconv";
76

87
project Test is
98
Test_Sources := External("TEST_SOURCES");

testsuite/support/test_assert.adb

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@
2121
-- --
2222
------------------------------------------------------------------------------
2323

24-
with Ada.Exceptions;
25-
with Ada.Strings.Unbounded;
2624
with Ada.Text_IO;
27-
with GNATCOLL.Iconv;
2825

2926
package body Test_Assert is
3027
package IO renames Ada.Text_IO;
31-
package Iconv renames GNATCOLL.Iconv;
3228

3329
------------
3430
-- Assert --
@@ -81,100 +77,6 @@ package body Test_Assert is
8177
end if;
8278
end Assert;
8379

84-
------------
85-
-- Assert --
86-
------------
87-
88-
function Bytes_Image (Input : String) return String;
89-
function Bytes_Image (Input : String) return String
90-
is
91-
Result : Ada.Strings.Unbounded.Unbounded_String;
92-
begin
93-
for C in Input'Range loop
94-
Ada.Strings.Unbounded.Append (Result, Character'Pos (Input (C))'Img);
95-
end loop;
96-
return Ada.Strings.Unbounded.To_String (Result);
97-
end Bytes_Image;
98-
99-
procedure Assert_Iconv
100-
(Input : String;
101-
Expected : String;
102-
From_Code : String;
103-
To_Code : String;
104-
Transliteration : Boolean := False;
105-
Ignore : Boolean := False;
106-
Msg : String := "";
107-
Location : String := SI.Source_Location)
108-
is
109-
begin
110-
declare
111-
Result : constant String := Iconv.Iconv
112-
(Input => Input,
113-
To_Code => To_Code,
114-
From_Code => From_Code,
115-
Transliteration => Transliteration,
116-
Ignore => Ignore);
117-
Success : constant Boolean := Result = Expected;
118-
begin
119-
Assert (Success, Msg, Location);
120-
if not Success then
121-
IO.Put_Line ("iconv(" & Bytes_Image (Input) &
122-
", to_code => " & To_Code &
123-
", from_code => " & From_code &
124-
", transliteration => " & Transliteration'Img &
125-
", ignore => " & Ignore'Img);
126-
IO.Put_Line ("- expect: " & Bytes_Image (Expected));
127-
128-
IO.Put_Line ("- got: " & Bytes_Image (Result));
129-
end if;
130-
end;
131-
exception
132-
when E : others =>
133-
Assert (False, Msg, Location);
134-
IO.Put_Line ("got exception: " & ASCII.LF &
135-
Ada.Exceptions.Exception_Information (E));
136-
end Assert_Iconv;
137-
138-
procedure Assert_Invalid_Sequence
139-
(Input : String;
140-
From_Code : String;
141-
To_Code : String;
142-
Transliteration : Boolean := False;
143-
Ignore : Boolean := False;
144-
Msg : String := "";
145-
Location : String := SI.Source_Location)
146-
is
147-
begin
148-
declare
149-
Result : constant String := Iconv.Iconv
150-
(Input => Input,
151-
To_Code => To_Code,
152-
From_Code => From_Code,
153-
Transliteration => Transliteration,
154-
Ignore => Ignore);
155-
begin
156-
Assert (False, Msg, Location);
157-
IO.Put_Line ("iconv(" & Input &
158-
", to_code => " & To_Code &
159-
", from_code => " & From_code &
160-
", transliteration => " & Transliteration'Img &
161-
", ignore => " & Ignore'Img);
162-
IO.Put_Line ("- expect: Invalid_Sequence_Error ");
163-
IO.Put ("- got: ");
164-
for C in Result'Range loop
165-
IO.Put (Character'Pos (Result (C))'Img);
166-
end loop;
167-
IO.New_Line;
168-
end;
169-
exception
170-
when Iconv.Invalid_Sequence_Error =>
171-
Assert (True, Msg, Location);
172-
when E : others =>
173-
Assert (False, Msg, Location);
174-
IO.Put_Line ("got exception: " & ASCII.LF &
175-
Ada.Exceptions.Exception_Information (E));
176-
end Assert_Invalid_Sequence;
177-
17880
------------
17981
-- Report --
18082
------------

testsuite/support/test_assert.ads

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,6 @@ package Test_Assert is
4646
-- If Left = Right then test case is considered PASSED, otherwise
4747
-- the test status is FAILED and Final_Status set to 1.
4848

49-
procedure Assert_Iconv
50-
(Input : String;
51-
Expected : String;
52-
From_Code : String;
53-
To_Code : String;
54-
Transliteration : Boolean := False;
55-
Ignore : Boolean := False;
56-
Msg : String := "";
57-
Location : String := SI.Source_Location);
58-
-- Transform Input using Iconv and expect Expected as a result
59-
-- The other parameters are for GNATCOLL.Iconv.Iconv
60-
61-
procedure Assert_Invalid_Sequence
62-
(Input : String;
63-
From_Code : String;
64-
To_Code : String;
65-
Transliteration : Boolean := False;
66-
Ignore : Boolean := False;
67-
Msg : String := "";
68-
Location : String := SI.Source_Location);
69-
-- Assert that input sequence will be considered by Iconv as an invalid
70-
-- sequence.
71-
7249
function Report return Natural;
7350
-- Report should be called the following way at the end of a test
7451
-- program main function:

testsuite/tests/coders/test.gpr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
with "gnatcoll_core";
2-
with "gnatcoll_iconv";
32
with "gnatcoll_lzma";
43
with "gnatcoll_zlib";
54

0 commit comments

Comments
 (0)