mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 01:46:15 +01:00
More tests for the Waf preprocessor
This commit is contained in:
parent
67a5bb5c73
commit
e048bed13d
@ -1,4 +1,4 @@
|
||||
NEW IN WAF 1.8.3
|
||||
NEW IN WAF 1.8.4
|
||||
----------------
|
||||
* Various improvements in stale.py
|
||||
* More robust file scanning in Qt processing #1502
|
||||
|
6
tests/preproc/recursion/a.c
Normal file
6
tests/preproc/recursion/a.c
Normal file
@ -0,0 +1,6 @@
|
||||
#include "a.h"
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
|
8
tests/preproc/recursion/a.h
Normal file
8
tests/preproc/recursion/a.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifdef FOO
|
||||
#include "c.h"
|
||||
#endif
|
||||
|
||||
#ifdef BAR
|
||||
#include "b.h"
|
||||
#endif
|
||||
|
1
tests/preproc/recursion/b.h
Normal file
1
tests/preproc/recursion/b.h
Normal file
@ -0,0 +1 @@
|
||||
#include "c.h"
|
3
tests/preproc/recursion/c.h
Normal file
3
tests/preproc/recursion/c.h
Normal file
@ -0,0 +1,3 @@
|
||||
#undef FOO
|
||||
#undef BAR
|
||||
#include "a.h"
|
@ -171,6 +171,23 @@ def build(bld):
|
||||
test('a&&b&&c&&d', 0)
|
||||
test('e', 1)
|
||||
|
||||
def test_rec(defines, expected):
|
||||
main = bld.path.find_resource('recursion/a.c')
|
||||
bld.env.DEFINES = defines.split()
|
||||
gruik = c_preproc.c_parser([main.parent])
|
||||
gruik.start(main, bld.env)
|
||||
result = "".join([x.name[0] for x in gruik.nodes])
|
||||
if result == expected:
|
||||
color = "GREEN"
|
||||
else:
|
||||
color = "RED"
|
||||
pprint(color, "%s\t\t%r" % (expected, gruik.nodes))
|
||||
|
||||
test_rec("", "a")
|
||||
test_rec("FOO=1", "aca")
|
||||
test_rec("BAR=1", "abca")
|
||||
test_rec("FOO=1 BAR=1", "aca")
|
||||
|
||||
|
||||
return
|
||||
test("1?1,(0?5:9):3,4", 0) # <- invalid expression
|
||||
|
@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import os, sys, inspect
|
||||
|
||||
VERSION="1.8.3"
|
||||
VERSION="1.8.4"
|
||||
REVISION="x"
|
||||
INSTALL="x"
|
||||
C1='x'
|
||||
|
@ -11,13 +11,13 @@ from waflib import Utils, Errors, Logs
|
||||
import waflib.Node
|
||||
|
||||
# the following 3 constants are updated on each new release (do not touch)
|
||||
HEXVERSION=0x1080300
|
||||
HEXVERSION=0x1080400
|
||||
"""Constant updated on new releases"""
|
||||
|
||||
WAFVERSION="1.8.3"
|
||||
WAFVERSION="1.8.4"
|
||||
"""Constant updated on new releases"""
|
||||
|
||||
WAFREVISION="2fa4078c47451df99ba831a98ab6c28a7ee36ae2"
|
||||
WAFREVISION="67a5bb5c730ba3abebccdbe64a4f509d92f33b9e"
|
||||
"""Constant updated on new releases"""
|
||||
|
||||
ABI = 98
|
||||
|
Loading…
Reference in New Issue
Block a user