Skip to content

Commit 077de25

Browse files
fjtrujyclaude
andcommitted
Fix include path resolution in stress test
The stress test was failing because masp couldn't find the include files when processing fast_pp1.vcl and general_nospec_tri_pp1.vcl. The files use relative .include directives like: .include "include/db_in_db_out.i" But masp was running from the build directory and couldn't resolve these paths. Solution: - Pass -I flag with path to SRC_DIR/test/include to masp - This tells masp where to search for include files - Now all three test files (vu1Triangle.vcl, fast_pp1.vcl, general_nospec_tri_pp1.vcl) can be processed successfully This matches how ps2gl invokes masp with appropriate -I flags for its include directories. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e4e3fc7 commit 077de25

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

test/unit/test_stress_parallel.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
// Test masp stability under repeated execution
1818
// This reproduces the crash observed in ps2gl builds
1919

20-
static int run_masp_once(const char *masp_path, const char *input, const char *output) {
20+
static int run_masp_once(const char *masp_path, const char *input, const char *output, const char *include_path) {
2121
pid_t pid = fork();
2222
if (pid == 0) {
2323
// Child process
24-
const char *argv[] = { masp_path, "-p", "-s", "-c", ";", "-o", output, "--", input, NULL };
24+
// Add -I flag to include directory for .include directives
25+
const char *argv[] = { masp_path, "-p", "-s", "-c", ";", "-I", include_path, "-o", output, "--", input, NULL };
2526
execv(masp_path, (char* const*)argv);
2627
_exit(127);
2728
} else if (pid > 0) {
@@ -50,8 +51,10 @@ static int run_masp_once(const char *masp_path, const char *input, const char *o
5051
int main(void) {
5152
char masp_path[1024];
5253
char output_path[1024];
54+
char include_path[1024];
5355

5456
snprintf(masp_path, sizeof(masp_path), "%s/src/masp", BUILD_DIR);
57+
snprintf(include_path, sizeof(include_path), "%s/test/include", SRC_DIR);
5558

5659
// Check if masp exists
5760
struct stat st;
@@ -99,7 +102,7 @@ int main(void) {
99102
snprintf(output_path, sizeof(output_path), "%s/test_outputs/stress_%s_%d.out",
100103
BUILD_DIR, test_files[file_idx], i);
101104

102-
int rc = run_masp_once(masp_path, input_path, output_path);
105+
int rc = run_masp_once(masp_path, input_path, output_path, include_path);
103106

104107
if (rc != 0) {
105108
if (rc >= 128) {

0 commit comments

Comments
 (0)