build: Running sub-projects build/tests at root directory #396

Closed
opened 2022-07-08 14:42:03 +00:00 by alichraghi · 1 comment
alichraghi commented 2022-07-08 14:42:03 +00:00 (Migrated from github.com)

root build file must be able to build/test sub-projects. i think @slimsag mentioned this somewhere.

build.zig // zig build test
├── glfw/build.zig
├── freetype/build.zig
├── sysaudio/build.zig
├── esc/build.zig
├── gpu/build.zig
└── sysjs/build.zig

possible ways:

  • making tests a seperate step in /build.zig and calling sub-projects build function for only build step (preferred)
  • running zig build [test] in sub-directories
root build file must be able to build/test sub-projects. i think @slimsag mentioned this somewhere. ```c build.zig // zig build test ├── glfw/build.zig ├── freetype/build.zig ├── sysaudio/build.zig ├── esc/build.zig ├── gpu/build.zig └── sysjs/build.zig ``` possible ways: - making tests a seperate step in *<x>/build.zig* and calling sub-projects `build` function for only build step (preferred) - running `zig build [test]` in sub-directories
emidoots commented 2022-07-09 22:22:08 +00:00 (Migrated from github.com)

Agreed.

making tests a seperate step in /build.zig and calling sub-projects build function for only build step (preferred)

I think this is the right way.

Ideally I think that in the end, as a developer you can run the following to test each part of Mach:

  1. zig build test run all tests for every project
  2. zig build test-mach run tests for just src/ mach code.
  3. cd subproject/ && zig build test run tests for just a subproject
Agreed. > making tests a seperate step in /build.zig and calling sub-projects build function for only build step (preferred) I think this is the right way. Ideally I think that in the end, as a developer you can run the following to test each part of Mach: 1. `zig build test` run *all* tests for every project 2. `zig build test-mach` run tests for just `src/` mach code. 3. `cd subproject/ && zig build test` run tests for just a subproject
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach#396
No description provided.