Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temp pytest #4

Open
wants to merge 93 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
836dfbc
fix test_body
bongbui321 Sep 26, 2024
2d57e32
fix test_chrysler
bongbui321 Sep 26, 2024
b019cad
fix test_defaults
bongbui321 Sep 26, 2024
b359317
fix test_elm327
bongbui321 Sep 26, 2024
7be1fb5
fix test_ford
bongbui321 Sep 26, 2024
1e3bb0b
fix test_gm
bongbui321 Sep 26, 2024
00bce0b
fix test_honda
bongbui321 Sep 26, 2024
e14caad
fix test_hyundai_canfd
bongbui321 Sep 26, 2024
369bacd
fix test_hyundai
bongbui321 Sep 26, 2024
15588d1
fix test_mazda
bongbui321 Sep 26, 2024
e92296a
fix test_nissan
bongbui321 Sep 26, 2024
291c1c0
fix test_subaru
bongbui321 Sep 26, 2024
b23e169
fix test_tesla
bongbui321 Sep 26, 2024
f765988
fix test_toyota
bongbui321 Sep 26, 2024
c67a7cc
fix test_volkswagen_mqb
bongbui321 Sep 26, 2024
75bd683
fix test_volkwagen_pq
bongbui321 Sep 26, 2024
80d84cc
fix hyundai_common
bongbui321 Sep 26, 2024
3ffd1e6
fix common.py
bongbui321 Sep 26, 2024
40b9082
PandaSafetyTestBase
bongbui321 Sep 26, 2024
e571716
try fix
bongbui321 Sep 26, 2024
01627bd
pytest.skip()
bongbui321 Sep 26, 2024
e13c98d
minor fixes
bongbui321 Sep 26, 2024
25f62ec
super() setUp() and setUpClass()
bongbui321 Sep 26, 2024
5545704
fix pytest.skip()
bongbui321 Sep 26, 2024
ba4c66b
test
bongbui321 Sep 26, 2024
af9442e
fix long asserts
bongbui321 Sep 26, 2024
a060694
fix weird long asserts and typo
bongbui321 Sep 26, 2024
c9ef7a4
subtests
bongbui321 Sep 26, 2024
e95117d
self._frange_round
bongbui321 Sep 26, 2024
6ace055
cleanup frange
bongbui321 Sep 27, 2024
59b007f
start usbprotocol
bongbui321 Sep 27, 2024
9c7cb3d
fix test_comms
bongbui321 Sep 27, 2024
a374fb0
fix test_pandalib
bongbui321 Sep 27, 2024
4c133c4
subtest usbprotocol
bongbui321 Sep 27, 2024
7f2098f
fix reset_tx test
bongbui321 Sep 27, 2024
7a38a9a
cleanup
bongbui321 Sep 27, 2024
beb9963
no executable
bongbui321 Sep 27, 2024
ed27deb
no unittest
bongbui321 Sep 27, 2024
a0fd079
Revert "no unittest"
bongbui321 Sep 27, 2024
b31f5bf
Revert "no executable"
bongbui321 Sep 27, 2024
bcf1c5c
Revert "cleanup"
bongbui321 Sep 27, 2024
5b96ffd
fix that
bongbui321 Sep 27, 2024
f2bd951
use pytest-order
bongbui321 Sep 28, 2024
29b28c7
no executable usbprotocol
bongbui321 Sep 28, 2024
514322f
update pyproject
bongbui321 Sep 28, 2024
09667af
Merge branch 'master' of https://github.com/commaai/panda into unitte…
bongbui321 Sep 28, 2024
89d8396
no executable for tests/safety
bongbui321 Sep 28, 2024
479c201
fix mutation.sh
bongbui321 Sep 28, 2024
f78f42e
fix that
bongbui321 Oct 1, 2024
636f113
test this
bongbui321 Oct 9, 2024
21f2d6a
merge master
bongbui321 Oct 9, 2024
66cb530
fix that
bongbui321 Oct 9, 2024
8f30b94
fix safety_toyota.py
bongbui321 Oct 9, 2024
c0c927b
their own instance
bongbui321 Oct 9, 2024
d8d66b1
our own libpanda
bongbui321 Oct 9, 2024
223a251
test
bongbui321 Oct 9, 2024
a34cc71
fix that
bongbui321 Oct 9, 2024
ba8054f
test
bongbui321 Oct 9, 2024
57346c1
test
bongbui321 Oct 9, 2024
dbcac60
generate new ffi
bongbui321 Oct 9, 2024
93bca52
fix that in generating that
bongbui321 Oct 9, 2024
42c5603
no more make market
bongbui321 Oct 9, 2024
e6380b8
readd that
bongbui321 Oct 9, 2024
dbca540
remove that
bongbui321 Oct 9, 2024
64a7a7f
ffi in make packet
bongbui321 Oct 9, 2024
7874f52
remove that
bongbui321 Oct 9, 2024
c0dac14
empty
bongbui321 Oct 10, 2024
3bfca65
test this
bongbui321 Oct 10, 2024
372b49c
test that
bongbui321 Oct 10, 2024
17892e3
test
bongbui321 Oct 10, 2024
bfbaa5e
test
bongbui321 Oct 10, 2024
156e6f2
test id
bongbui321 Oct 10, 2024
e1b94e2
test
bongbui321 Oct 10, 2024
7ae6582
test
bongbui321 Oct 10, 2024
9337bfc
test
bongbui321 Oct 10, 2024
3712b85
test
bongbui321 Oct 10, 2024
bae5634
test
bongbui321 Oct 10, 2024
1816674
test that
bongbui321 Oct 10, 2024
8769b42
test fail
bongbui321 Oct 10, 2024
45612b3
test that
bongbui321 Oct 10, 2024
21485c6
test that
bongbui321 Oct 10, 2024
1444914
test two shared library
bongbui321 Oct 10, 2024
939b1d3
test that
bongbui321 Oct 10, 2024
9924a47
readd that
bongbui321 Oct 10, 2024
a8ac697
readd that
bongbui321 Oct 10, 2024
6f922c9
lpp2
bongbui321 Oct 10, 2024
2f0ddb4
test this
bongbui321 Oct 11, 2024
a6806be
test taht
bongbui321 Oct 11, 2024
6fb8662
test
bongbui321 Oct 11, 2024
2ed1f7b
test
bongbui321 Oct 11, 2024
2a64a0c
test
bongbui321 Oct 11, 2024
425876e
test that
bongbui321 Oct 11, 2024
6cbef15
all
bongbui321 Oct 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions board/drivers/can_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ bool can_loopback = false;

// ********************* instantiate queues *********************
#define can_buffer(x, size) \
static CANPacket_t elems_##x[size]; \
extern can_ring can_##x; \
can_ring can_##x = { .w_ptr = 0, .r_ptr = 0, .fifo_size = (size), .elems = (CANPacket_t *)&(elems_##x) };
can_ring can_##x = { .w_ptr = 0, .r_ptr = 0};

#define CAN_RX_BUFFER_SIZE 4096U
#define CAN_TX_BUFFER_SIZE 416U
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ flake8-implicit-str-concat.allow-multiline=false

[tool.ruff.lint.flake8-tidy-imports.banned-api]
"pytest.main".msg = "pytest.main requires special handling that is easy to mess up!"
"unittest".msg = "Use pytest"

[tool.pytest.ini_options]
addopts = "-n auto --ignore-glob='*.sh'"
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def find_version(*file_paths):
"pytest-xdist",
"pytest-timeout",
"pytest-randomly",
"pytest-subtests",
"parameterized",
"pre-commit",
"numpy",
Expand Down
1 change: 1 addition & 0 deletions tests/libpanda/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ if GetOption('ubsan'):

panda = env.SharedObject("panda.os", "panda.c")
libpanda = env.SharedLibrary("libpanda.so", [panda])
libpanda2 = env.SharedLibrary("libpanda2.so", [panda])

if GetOption('coverage'):
env.Append(
Expand Down
36 changes: 19 additions & 17 deletions tests/libpanda/libpanda_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@

libpanda_dir = os.path.dirname(os.path.abspath(__file__))
libpanda_fn = os.path.join(libpanda_dir, "libpanda.so")
libpanda_fn2 = os.path.join(libpanda_dir, "libpanda2.so")

ffi = FFI()

ffi.cdef("""
typedef struct {
unsigned char reserved : 1;
unsigned char bus : 3;
unsigned char data_len_code : 4;
unsigned char rejected : 1;
unsigned char returned : 1;
unsigned char extended : 1;
unsigned int addr : 29;
unsigned char checksum;
unsigned char data[64];
unsigned char reserved : 1;
unsigned char bus : 3;
unsigned char data_len_code : 4;
unsigned char rejected : 1;
unsigned char returned : 1;
unsigned char extended : 1;
unsigned int addr : 29;
unsigned char checksum;
unsigned char data[64];
} CANPacket_t;
""", packed=True)

Expand All @@ -33,16 +34,16 @@

ffi.cdef("""
typedef struct {
volatile uint32_t w_ptr;
volatile uint32_t r_ptr;
uint32_t fifo_size;
CANPacket_t *elems;
volatile uint32_t w_ptr;
volatile uint32_t r_ptr;
uint32_t fifo_size;
CANPacket_t *elems;
} can_ring;

extern can_ring *rx_q;
extern can_ring *tx1_q;
extern can_ring *tx2_q;
extern can_ring *tx3_q;
extern can_ring rx_q;
extern can_ring tx1_q;
extern can_ring tx2_q;
extern can_ring tx3_q;

bool can_pop(can_ring *q, CANPacket_t *elem);
bool can_push(can_ring *q, CANPacket_t *elem);
Expand Down Expand Up @@ -80,6 +81,7 @@ def set_safety_hooks(self, mode: int, param: int) -> int: ...


libpanda: Panda = ffi.dlopen(libpanda_fn)
libpanda2: Panda = ffi.dlopen(libpanda_fn2)


# helpers
Expand Down
13 changes: 9 additions & 4 deletions tests/libpanda/panda.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ void can_tx_comms_resume_spi(void) { };
#include "main_definitions.h"
#include "drivers/can_common.h"

can_ring *rx_q = &can_rx_q;
can_ring *tx1_q = &can_tx1_q;
can_ring *tx2_q = &can_tx2_q;
can_ring *tx3_q = &can_tx3_q;
const can_ring rx_q_copy = can_rx_q;
const can_ring tx1_q_copy = can_tx1_q;
const can_ring tx2_q_copy = can_tx2_q;
const can_ring tx3_q_copy = can_tx3_q;

can_ring *rx_q = &rx_q_copy;
can_ring *tx1_q = &tx1_q_copy;
can_ring *tx2_q = &tx2_q_copy;
can_ring *tx3_q = &tx3_q_copy;

#include "comms_definitions.h"
#include "can_comms.h"
Expand Down
Loading
Loading