From 61a76bb8347bfd52043232323745e7940e91d552 Mon Sep 17 00:00:00 2001 From: Matteo Cardinaletti Date: Tue, 12 Nov 2024 14:58:33 +0100 Subject: [PATCH] Init command will now add `test-sources` to `project.json` #1520 --- releasenotes.md | 1 + src/build/project.c | 3 +++ src/build/project_creation.c | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/releasenotes.md b/releasenotes.md index 4ae8d685b..6057f519f 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -4,6 +4,7 @@ ### Changes / improvements - Allow splat in initializers. +- Init command will now add `test-sources` to `project.json` #1520 ### Fixes - Fix bug where `a > 0 ? f() : g()` could cause a compiler crash if both returned `void!`. diff --git a/src/build/project.c b/src/build/project.c index 4579ae324..ceacbedb6 100644 --- a/src/build/project.c +++ b/src/build/project.c @@ -44,6 +44,7 @@ const char *project_default_keys[][2] = { {"single-module", "Compile all modules together, enables more inlining."}, {"soft-float", "Output soft-float functions."}, {"sources", "Paths to project sources for all targets."}, + {"test-sources", "Paths to project test sources for all targets."}, {"strip-unused", "Strip unused code and globals from the output. (default: true)"}, {"symtab", "Sets the preferred symtab size."}, {"target", "Compile for a particular architecture + OS target."}, @@ -116,6 +117,8 @@ const char* project_target_keys[][2] = { {"soft-float", "Output soft-float functions."}, {"sources", "Additional paths to project sources for the target."}, {"sources-override", "Paths to project sources for this target, overriding global settings."}, + {"test-sources", "Additional paths to project test sources for the target."}, + {"test-sources-override", "Paths to project test sources for this target, overriding global settings."}, {"strip-unused", "Strip unused code and globals from the output. (default: true)"}, {"symtab", "Sets the preferred symtab size."}, {"target", "Compile for a particular architecture + OS target."}, diff --git a/src/build/project_creation.c b/src/build/project_creation.c index ff37d8997..7374d3b99 100644 --- a/src/build/project_creation.c +++ b/src/build/project_creation.c @@ -20,6 +20,8 @@ const char* JSON_EXE = " \"version\": \"0.1.0\",\n" " // Sources compiled for all targets.\n" " \"sources\": [ \"src/**\" ],\n" + " // Test sources compiled for all targets.\n" + " \"test-sources\": [ \"test/**\" ],\n" " // C sources if the project also compiles C sources\n" " // relative to the project file.\n" " // \"c-sources\": [ \"csource/**\" ],\n" @@ -63,6 +65,8 @@ const char* JSON_STATIC = " \"version\": \"0.1.0\",\n" " // Sources compiled for all targets.\n" " \"sources\": [ \"src/**\" ],\n" + " // Test sources compiled for all targets.\n" + " \"test-sources\": [ \"test/**\" ],\n" " // C sources if the project also compiles C sources\n" " // relative to the project file.\n" " // \"c-sources\": [ \"csource/**\" ],\n" @@ -104,6 +108,8 @@ const char* JSON_DYNAMIC = " \"version\": \"0.1.0\",\n" " // Sources compiled for all targets.\n" " \"sources\": [ \"src/**\" ],\n" + " // Test sources compiled for all targets.\n" + " \"test-sources\": [ \"test/**\" ],\n" " // C sources if the project also compiles C sources\n" " // relative to the project file.\n" " // \"c-sources\": [ \"csource/**\" ],\n"