SConscript (12866:99ec3860ae84) SConscript (12869:1ad10753e8c3)
1# Copyright 2018 Google, Inc.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions are
5# met: redistributions of source code must retain the above copyright
6# notice, this list of conditions and the following disclaimer;
7# redistributions in binary form must reproduce the above copyright
8# notice, this list of conditions and the following disclaimer in the

--- 48 unchanged lines hidden (view full) ---

57 def properties(self):
58 return {
59 'name' : self.name,
60 'path' : self.reldir,
61 'compile_only' : self.compile_only
62 }
63
64 ext_dir = Dir('..').Dir('ext')
1# Copyright 2018 Google, Inc.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions are
5# met: redistributions of source code must retain the above copyright
6# notice, this list of conditions and the following disclaimer;
7# redistributions in binary form must reproduce the above copyright
8# notice, this list of conditions and the following disclaimer in the

--- 48 unchanged lines hidden (view full) ---

57 def properties(self):
58 return {
59 'name' : self.name,
60 'path' : self.reldir,
61 'compile_only' : self.compile_only
62 }
63
64 ext_dir = Dir('..').Dir('ext')
65 class SystemCTestBin(UnitTest):
65 class SystemCTestBin(Executable):
66 def __init__(self, test):
66 def __init__(self, test):
67 super(SystemCTestBin, self).__init__(
68 test.target, *test.sources, main=True)
67 super(SystemCTestBin, self).__init__(test.target, *test.sources)
69
70 @classmethod
71 def declare_all(cls, env):
72 env = env.Clone()
73
74 # Turn off extra warnings and Werror for the tests.
75 to_remove = ['-Wall', '-Wundef', '-Wextra', '-Werror']
76 env['CCFLAGS'] = \
77 filter(lambda f: f not in to_remove, env['CCFLAGS'])
78
79 env.Append(CPPPATH=ext_dir)
80
81 super(SystemCTestBin, cls).declare_all(env)
82
68
69 @classmethod
70 def declare_all(cls, env):
71 env = env.Clone()
72
73 # Turn off extra warnings and Werror for the tests.
74 to_remove = ['-Wall', '-Wundef', '-Wextra', '-Werror']
75 env['CCFLAGS'] = \
76 filter(lambda f: f not in to_remove, env['CCFLAGS'])
77
78 env.Append(CPPPATH=ext_dir)
79
80 super(SystemCTestBin, cls).declare_all(env)
81
82 def declare(self, env):
83 sources = list(self.sources)
84 for f in self.filters:
85 sources = Source.all.apply_filter(f)
86 objs = self.srcs_to_objs(env, sources)
87 objs = objs + env['SHARED_LIB'] + env['MAIN_OBJS']
88 return super(SystemCTestBin, self).declare(env, objs)
89
83 tests = []
84 def new_test(dirname, name):
85 test = SystemCTest(dirname, name)
86 tests.append(test)
87 return test
88
89
90 def scan_dir_for_tests(subdir):

--- 64 unchanged lines hidden ---
90 tests = []
91 def new_test(dirname, name):
92 test = SystemCTest(dirname, name)
93 tests.append(test)
94 return test
95
96
97 def scan_dir_for_tests(subdir):

--- 64 unchanged lines hidden ---