Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit ce6d7efff74ee19cb75d6ccd3af4b8f3bd63f3d6 1 parent 3fb4e06
@bnoordhuis bnoordhuis authored
Showing with 32 additions and 2 deletions.
  1. +32 −2 http_parser.gyp
View
34 http_parser.gyp
@@ -51,6 +51,7 @@
'type': 'static_library',
'include_dirs': [ '.' ],
'direct_dependent_settings': {
+ 'defines': [ 'HTTP_PARSER_STRICT=0' ],
'include_dirs': [ '.' ],
},
'defines': [ 'HTTP_PARSER_STRICT=0' ],
@@ -69,11 +70,40 @@
},
{
- 'target_name': 'test',
+ 'target_name': 'http_parser_strict',
+ 'type': 'static_library',
+ 'include_dirs': [ '.' ],
+ 'direct_dependent_settings': {
+ 'defines': [ 'HTTP_PARSER_STRICT=1' ],
+ 'include_dirs': [ '.' ],
+ },
+ 'defines': [ 'HTTP_PARSER_STRICT=1' ],
+ 'sources': [ './http_parser.c', ],
+ 'conditions': [
+ ['OS=="win"', {
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ # Compile as C++. http_parser.c is actually C99, but C++ is
+ # close enough in this case.
+ 'CompileAs': 2,
+ },
+ },
+ }]
+ ],
+ },
+
+ {
+ 'target_name': 'test-nonstrict',
'type': 'executable',
'dependencies': [ 'http_parser' ],
'sources': [ 'test.c' ]
+ },
+
+ {
+ 'target_name': 'test-strict',
+ 'type': 'executable',
+ 'dependencies': [ 'http_parser_strict' ],
+ 'sources': [ 'test.c' ]
}
]
}
-
Please sign in to comment.
Something went wrong with that request. Please try again.