Failing test for -D dedupping.

pull/1951/head
Jussi Pakkanen 8 years ago
parent f75d394683
commit 85a263a670
  1. 8
      run_unittests.py
  2. 6
      test cases/unit/10 d dedup/meson.build
  3. 14
      test cases/unit/10 d dedup/prog.c

@ -1221,6 +1221,14 @@ int main(int argc, char **argv) {
for path in rpath.split(':'): for path in rpath.split(':'):
self.assertTrue(path.startswith('$ORIGIN'), msg=(each, path)) self.assertTrue(path.startswith('$ORIGIN'), msg=(each, path))
def test_dash_d_dedup(self):
testdir = os.path.join(self.unit_test_dir, '10 d dedup')
self.init(testdir)
cmd = self.get_compdb()[0]['command']
self.assertTrue('-D FOO -D BAR' in cmd or \
'/D FOO /D BAR' in cmd)
class FailureTests(BasePlatformTests): class FailureTests(BasePlatformTests):
''' '''

@ -0,0 +1,6 @@
project('d dedup', 'c')
add_project_arguments('-D', 'FOO', '-D', 'BAR', language : 'c')
executable('prog', 'prog.c')

@ -0,0 +1,14 @@
#include<stdio.h>
#ifndef FOO
#error FOO is not defined.
#endif
#ifndef BAR
#error BAR is not defined.
#endif
int main(int argc, char **argv) {
printf("All is well.\n");
return 0;
}
Loading…
Cancel
Save