Skip to content

Commit

Permalink
[Tests][Added][KiCad 9] Detection
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Jan 10, 2025
1 parent 2c0fe98 commit 9626288
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/utils/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
KICAD_VERSION_7_0_10 = 7000010
KICAD_VERSION_7_0_11 = 7000011
KICAD_VERSION_8_0_0 = 7099000
KICAD_VERSION_9_0_0 = 9000000
MODE_SCH = 1
MODE_PCB = 0
# Defined as True to collect real world queries
Expand All @@ -54,10 +55,12 @@
kicad_version = kicad_major*1000000+kicad_minor*1000+kicad_patch
if kicad_version >= KICAD_VERSION_5_99:
km = kicad_major+(0 if kicad_minor < 99 else 1)
if km > 8:
km = 8
if km > 9:
km = 9
BOARDS_DIR = '../board_samples/kicad_'+str(km)
if kicad_version >= KICAD_VERSION_8_0_0:
if kicad_version >= KICAD_VERSION_9_0_0:
REF_DIR = 'tests/reference/9_0_0'
elif kicad_version >= KICAD_VERSION_8_0_0:
REF_DIR = 'tests/reference/8_0_0'
elif kicad_version >= KICAD_VERSION_7_0_11 and 'rc' in build_version:
REF_DIR = 'tests/reference/stable_nightly'
Expand Down Expand Up @@ -102,6 +105,10 @@
logging.debug('Detected KiCad v{}.{}.{} ({})'.format(kicad_major, kicad_minor, kicad_patch, kicad_version))


def ki9():
return kicad_version >= KICAD_VERSION_9_0_0


def ki8():
return kicad_version >= KICAD_VERSION_8_0_0

Expand Down

0 comments on commit 9626288

Please sign in to comment.