Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/fused_src_compress' into…
Browse files Browse the repository at this point in the history
… circleci/vcperf
  • Loading branch information
srz-zumix committed May 30, 2020
2 parents d6e6a20 + c44bfd1 commit c9b1f26
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 35 deletions.
2 changes: 1 addition & 1 deletion include/internal/iutest_compiler.hpp
Expand Up @@ -382,7 +382,7 @@
// private destractor = default is not works in gcc 4.5 - 4.6
# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 4)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
# define IUTEST_HAS_DEFAULT_FUNCTIONS 1
# if (_MSV_VER <= 1800) && !defined(IUTEST_HAS_MOVE_ASSIGNMENT_DEFAULT_FUNCTION)
# if !defined(IUTEST_HAS_MOVE_ASSIGNMENT_DEFAULT_FUNCTION)
# define IUTEST_HAS_MOVE_ASSIGNMENT_DEFAULT_FUNCTION 0
# endif
# elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
Expand Down
33 changes: 26 additions & 7 deletions tools/fused/iutest_pp_strip.py
Expand Up @@ -23,6 +23,7 @@
RE_PPELIF = re.compile('#\s*elif\s*(.*)$')
RE_PPELSE = re.compile('#\s*else\s*$')
RE_PPENDIF = re.compile('#\s*endif')
RE_AND = re.compile('and')
RE_CPP_COMMENT = re.compile('^//.*')
RE_SYSTEM_INCLUDE_REGEX = re.compile(r'^\s*#\s*include\s*<(.*)>')

Expand Down Expand Up @@ -245,15 +246,33 @@ def eval_x(d, x):
return r0
return -1

def __eval_ppif(self, expr):
expand = self.__expand_ppif_macro(expr)
expand_expr = re.sub(r'([0-9])+L', r'\1', expand)
def __eval_expanded_expr(self, expand_expr):
error = None
try:
r = eval(expand_expr)
if r:
return (1, '1')
else:
return (0, '0')
except Exception as e:
error = e

expand = expand_expr
if 'or' not in expand:
for expr in RE_AND.split(expand):
try:
r = eval(expr)
if not r:
return (0, '0')
except Exception as e:
error = e
raise error

def __eval_ppif(self, expr):
expand = self.__expand_ppif_macro(expr)
expand_expr = re.sub(r'([0-9])+L', r'\1', expand)
try:
return self.__eval_expanded_expr(expand_expr)
except Exception as e:
r = -1
if len(expand.split()) > 1:
Expand Down Expand Up @@ -375,10 +394,10 @@ def __check_include(self, line):
m = RE_SYSTEM_INCLUDE_REGEX.match(line)
if m:
path = m.group(1)
if path in self.included_path[-1]:
return False
else:
self.included_path[-1].append(path)
for include_paths in self.included_path:
if path in include_paths:
return False
self.included_path[-1].append(path)
return True

def __reduction(self, line):
Expand Down
10 changes: 10 additions & 0 deletions tools/fused/iuwandbox_pp.py
Expand Up @@ -42,12 +42,16 @@
'COMPILER_ICC': None,
'_MSC_VER': None,
'_MSC_FULL_VER': None,
'_MSVC_LANG': None,
'_WIN32': None,
'WIN32': None,
'__WIN32__': None,
'WINAPI_FAMILY': None,
'__AFX_H__': None,
'__MWERKS__': None,
'__FreeBSD__': None,
'sun': None,
'__sun': None,
'IUTEST_OS_WINDOWS': None,
'IUTEST_OS_WINDOWS_MINGW': None,
'IUTEST_OS_WINDOWS_MOBILE': None,
Expand Down Expand Up @@ -94,6 +98,12 @@
'IUTEST_HAS_MINIDUMP': '0',
'IUTEST_HAS_STRSTREAM': '0',
'IUTEST_HAS_STRINGSTREAM': '1',
'IUTEST_HAS_IOMANIP': '1',
'IUTEST_HAS_CTIME': '1',
'IUTEST_HAS_GETTIMEOFDAY': '1',
'IUTEST_HAS_HDR_SYSTIME': '1',
'IUTEST_HAS_FOPEN': '1',
'IUTEST_HAS_FILE_STAT': '1',
'IUTEST_HAS_CLASS_MEMBER_TEMPLATE_SPECIALIZATION': '0',
'IUTEST_HAS_GENERIC': '0',
'IUTEST_HAS_MEMORY_SANITIZER': '0',
Expand Down
53 changes: 26 additions & 27 deletions wercker.yml
Expand Up @@ -26,7 +26,7 @@ build:
# http://devcenter.wercker.com/docs/steps/index.html
steps:
# A step that executes `pip install` command.
- pip-install:
- pip-install: &pip-install
requirements_file: ""
packages_list: "requests"

Expand All @@ -50,63 +50,62 @@ build:
wandbox:
steps:
- pip-install:
requirements_file: ""
packages_list: "requests"

- script:
- pip-install: *pip-install
- script: &make-fused
name: make fused
code: |
make -C tools/fused
- script:
- script: &setup
name: setup
code: |
export PYTHONDONTWRITEBYTECODE=1
export IUWANDBOX_COMMANDLINE_OPTION="../../test/syntax_tests.cpp -f"-DIUTEST_USE_MAIN=1" -f"-Werror" --encoding utf-8-sig --expand-include --verbose --check-config --retry-wait 180"
- script:
- script: &experimental
name: experimental setup
code: |
export IUWANDBOX_EXPERIMENTAL_OPTION="--iutest-use-wandbox-min"
- script: &cpp
name: c++
code: |
cd tools/wandbox
for compiler in ${IUWANDBOX_COMPILER}
do
python ./iuwandbox.py --iutest-use-wandbox-min ${IUWANDBOX_COMMANDLINE_OPTION} -c $compiler --std "c++${IUWANDBOX_CPPVER}" ${IUWANDBOX_ADD_OPTION} ${IUWANDBOX_STDC_ADD_OPTION};
python ./iuwandbox.py ${IUWANDBOX_EXPERIMENTAL_OPTION} ${IUWANDBOX_COMMANDLINE_OPTION} -c $compiler --std "c++${IUWANDBOX_CPPVER}" ${IUWANDBOX_ADD_OPTION} ${IUWANDBOX_STDC_ADD_OPTION};
done
- script:
- script: &gnucpp
name: gnuc++
code: |
cd tools/wandbox
for compiler in ${IUWANDBOX_COMPILER}
do
python ./iuwandbox.py --iutest-use-wandbox-min ${IUWANDBOX_COMMANDLINE_OPTION} -c $compiler --std "gnu++${IUWANDBOX_CPPVER}" ${IUWANDBOX_ADD_OPTION} ${IUWANDBOX_STDC_ADD_OPTION};
python ./iuwandbox.py ${IUWANDBOX_EXPERIMENTAL_OPTION} ${IUWANDBOX_COMMANDLINE_OPTION} -c $compiler --std "gnu++${IUWANDBOX_CPPVER}" ${IUWANDBOX_ADD_OPTION} ${IUWANDBOX_STDC_ADD_OPTION};
done
wandbox-all-compiler:
wandbox-no-experimental:
steps:
- pip-install:
requirements_file: ""
packages_list: "requests"

- script:
name: make fused
code: |
make -C tools/fused
- script:
name: setup
code: |
export PYTHONDONTWRITEBYTECODE=1
export IUWANDBOX_COMMANDLINE_OPTION="../../test/syntax_tests.cpp -f"-DIUTEST_USE_MAIN=1" -f"-Werror" --encoding utf-8-sig --expand-include --verbose --check-config --retry-wait 180"
- pip-install: *pip-install
- script: *make-fused
- script: *setup
- script: *cpp
- script: *gnucpp

wandbox-all-compiler:
steps:
- pip-install: *pip-install
- script: *make-fused
- script: *setup
- script: *experimental
- script:
name: all-compiler
code: |
cd tools/wandbox
for compiler in $(shell python iuwandbox.py --list-compiler)
do
python ./iuwandbox.py ${IUWANDBOX_COMMANDLINE_OPTION} -c $compiler ${IUWANDBOX_ADD_OPTION} ${IUWANDBOX_STDC_ADD_OPTION};
python ./iuwandbox.py ${IUWANDBOX_EXPERIMENTAL_OPTION} ${IUWANDBOX_COMMANDLINE_OPTION} -c $compiler ${IUWANDBOX_ADD_OPTION} ${IUWANDBOX_STDC_ADD_OPTION};
done
nothing:
Expand Down

0 comments on commit c9b1f26

Please sign in to comment.