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

Physical test refactor #33

Merged
merged 6 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ IF (${BIDIB_USE_TESTS})

# Physical test

ADD_EXECUTABLE(swtbahn-standard-testsuite test test/physical/swtbahn-standard/main.c test/physical/swtbahn-standard/testsuite.c)
ADD_EXECUTABLE(swtbahn-standard-testsuite test test/physical/swtbahn-standard/main.c test/physical/swtbahn-standard/testsuite.c test/physical/test_common.c)
TARGET_LINK_LIBRARIES(swtbahn-standard-testsuite glib-2.0 pthread yaml bidib_static)

ADD_EXECUTABLE(swtbahn-full-testsuite test test/physical/swtbahn-full/main.c test/physical/swtbahn-full/testsuite.c)
ADD_EXECUTABLE(swtbahn-full-testsuite test test/physical/swtbahn-full/main.c test/physical/swtbahn-full/testsuite.c test/physical/test_common.c)
TARGET_LINK_LIBRARIES(swtbahn-full-testsuite glib-2.0 pthread yaml bidib_static)

ENDIF(${BIDIB_USE_TESTS})
Expand Down
6 changes: 4 additions & 2 deletions test/physical/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ physical
| |-- main.c
| |-- testsuite.c
| '-- testsuite.h
'-- Readme.md
|-- Readme.md
|-- test_common.c
'-- test_common.h
```

## Test Cases
Expand Down Expand Up @@ -45,7 +47,7 @@ physical
Drives two user-defined trains along the track segments.

For the SWTbahn Full, the first train must be facing clockwise on track segment `T58`,
and the second train must be facing clockwise on track segment `T46`.
and the second train must be facing clockwise on track segment `T78a`.


For a given SWTbahn platform, its points and signals are retrieved using the
Expand Down
8 changes: 4 additions & 4 deletions test/physical/swtbahn-full/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ int main(int argc, char **argv) {
return 0;
}

// if (bidib_start_serial("/dev/tty.usbserial-AK06U8H7", "../../swtbahn-cli/configurations/swtbahn-full/", 0)) {
//if (bidib_start_serial("/dev/tty.usbserial-AK06U8H7", "../../swtbahn-cli/configurations/swtbahn-full/", 0)) {
if (bidib_start_serial("/dev/ttyUSB0", "../../swtbahn-cli/configurations/swtbahn-full", 0)) {
printf("testsuite: libbidib failed to start\n");
return 0;
} else {
printf("Started Serial");
printf("testsuite: libbidib started\n");
}
sleep(2); // Wait for the points to finish switching to their default positions.

Expand All @@ -74,7 +74,7 @@ int main(int argc, char **argv) {
const int repetitions = atoi(argv[2]);
switch (atoi(argv[1])) {
case 1:
//bidib_set_track_output_state_all(BIDIB_CS_OFF);
bidib_set_track_output_state_all(BIDIB_CS_OFF);
for (int i = 0; i < repetitions; i++) {
testsuite_case_pointParallel(result);
}
Expand Down Expand Up @@ -168,7 +168,7 @@ void printWelcome() {
"* SWTbahn-testsuite *",
"* *",
"************************",
"* UniBa-SWT-2022 *",
"* UniBa-SWT-2023 *",
"************************",
""
};
Expand Down
Loading