Skip to content

Commit a54b5d9

Browse files
projectgusdpgeorge
authored andcommitted
unix/variants: Add a 'longlong' variant to test 64-bit bigints in CI.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 parent 6d93b15 commit a54b5d9

File tree

4 files changed

+67
-0
lines changed

4 files changed

+67
-0
lines changed

.github/workflows/ports_unix.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,20 @@ jobs:
134134
if: failure()
135135
run: tests/run-tests.py --print-failures
136136

137+
longlong:
138+
runs-on: ubuntu-22.04 # use 22.04 to get python2, and libffi-dev:i386
139+
steps:
140+
- uses: actions/checkout@v4
141+
- name: Install packages
142+
run: source tools/ci.sh && ci_unix_32bit_setup
143+
- name: Build
144+
run: source tools/ci.sh && ci_unix_longlong_build
145+
- name: Run main test suite
146+
run: source tools/ci.sh && ci_unix_longlong_run_tests
147+
- name: Print failures
148+
if: failure()
149+
run: tests/run-tests.py --print-failures
150+
137151
float:
138152
runs-on: ubuntu-latest
139153
steps:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2016 Damien P. George
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
// This config exists to test that the MICROPY_LONGINT_IMPL_LONGLONG variant
28+
// (i.e. minimal form of "big integer" that's backed by 64-bit int only) builds
29+
// and passes tests.
30+
31+
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_LONGLONG)
32+
33+
// Set base feature level.
34+
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES)
35+
36+
// Enable extra Unix features.
37+
#include "../mpconfigvariant_common.h"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# build interpreter with "bigints" implemented as "longlong"
2+
3+
# otherwise, small int is essentially 64-bit
4+
MICROPY_FORCE_32BIT := 1
5+
6+
MICROPY_PY_FFI := 0
7+
8+
MPY_TOOL_FLAGS = -mlongint-impl longlong

tools/ci.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,14 @@ function ci_unix_nanbox_run_tests {
695695
ci_unix_run_tests_full_no_native_helper nanbox PYTHON=python2.7
696696
}
697697

698+
function ci_unix_longlong_build {
699+
ci_unix_build_helper VARIANT=longlong
700+
}
701+
702+
function ci_unix_longlong_run_tests {
703+
ci_unix_run_tests_full_helper longlong
704+
}
705+
698706
function ci_unix_float_build {
699707
ci_unix_build_helper VARIANT=standard CFLAGS_EXTRA="-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT"
700708
ci_unix_build_ffi_lib_helper gcc

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy