Alle Praegefalle laufen gegen das Release-Binary. Wurde der Kern geaendert und nicht gebaut, pruefte die Kette stillschweigend die alte Fassung - eine Spezifikation war deshalb rot, ohne dass der Kern schuld war.
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""Der Kern, gegen den geprueft wird, muss zum Kern-Quelltext passen.
|
|
|
|
Die Pruefkette laeuft gegen das Release-Binary. Wird der Kern geaendert und nicht gebaut,
|
|
prueft alles stillschweigend die alte Fassung - genau das ist einmal passiert: eine
|
|
Spezifikation war rot, die Ursache lag nicht am Kern, sondern am Binary von zweieinhalb
|
|
Stunden vorher.
|
|
|
|
python3 tests/kern_frisch_spec.py
|
|
"""
|
|
import os
|
|
import sys
|
|
import unittest
|
|
|
|
_w = os.path.dirname(os.path.abspath(__file__))
|
|
while _w != "/" and not os.path.isdir(os.path.join(_w, "hand")):
|
|
_w = os.path.dirname(_w)
|
|
for _u in ("entscheiden", "hand"):
|
|
_q = os.path.join(_w, _u)
|
|
if os.path.isdir(_q):
|
|
sys.path.append(_q)
|
|
|
|
import decide
|
|
|
|
|
|
class Frisch(unittest.TestCase):
|
|
def test_binary_passt_zum_kern(self):
|
|
if not decide.bereit():
|
|
self.skipTest(f"Kern nicht gebaut: {decide.BINARY}")
|
|
self.assertTrue(decide.frisch(), f"{decide.BINARY} ist aelter als der Kern-Quelltext "
|
|
f"({decide.QUELLE}) - dort `cargo build --release` laufen lassen")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main(verbosity=2)
|