Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

Commit ce6d7ef

Browse files
committed
build: compile strict and non-strict tests
Make gyp compile the library and the test suite in both strict and non-strict mode. Fixes a failing test where the test was strict but the library was not. Fixes #129.
1 parent 3fb4e06 commit ce6d7ef

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

http_parser.gyp

+32-2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
'type': 'static_library',
5252
'include_dirs': [ '.' ],
5353
'direct_dependent_settings': {
54+
'defines': [ 'HTTP_PARSER_STRICT=0' ],
5455
'include_dirs': [ '.' ],
5556
},
5657
'defines': [ 'HTTP_PARSER_STRICT=0' ],
@@ -69,11 +70,40 @@
6970
},
7071

7172
{
72-
'target_name': 'test',
73+
'target_name': 'http_parser_strict',
74+
'type': 'static_library',
75+
'include_dirs': [ '.' ],
76+
'direct_dependent_settings': {
77+
'defines': [ 'HTTP_PARSER_STRICT=1' ],
78+
'include_dirs': [ '.' ],
79+
},
80+
'defines': [ 'HTTP_PARSER_STRICT=1' ],
81+
'sources': [ './http_parser.c', ],
82+
'conditions': [
83+
['OS=="win"', {
84+
'msvs_settings': {
85+
'VCCLCompilerTool': {
86+
# Compile as C++. http_parser.c is actually C99, but C++ is
87+
# close enough in this case.
88+
'CompileAs': 2,
89+
},
90+
},
91+
}]
92+
],
93+
},
94+
95+
{
96+
'target_name': 'test-nonstrict',
7397
'type': 'executable',
7498
'dependencies': [ 'http_parser' ],
7599
'sources': [ 'test.c' ]
100+
},
101+
102+
{
103+
'target_name': 'test-strict',
104+
'type': 'executable',
105+
'dependencies': [ 'http_parser_strict' ],
106+
'sources': [ 'test.c' ]
76107
}
77108
]
78109
}
79-

0 commit comments

Comments
 (0)