From 578c3b6b6afb353a803e96ed6f72e1cbf06cdcf9 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Wed, 5 Apr 2017 00:40:52 +0300 Subject: Renamed tests with the same number. --- test cases/common/139 compute int/config.h.in | 2 -- test cases/common/139 compute int/foobar.h | 6 ---- test cases/common/139 compute int/meson.build | 35 ---------------------- test cases/common/139 compute int/prog.c.in | 16 ---------- .../139 custom target object output/meson.build | 16 ---------- .../obj_generator.py | 18 ----------- .../objdir/meson.build | 5 ---- .../objdir/source.c | 3 -- .../progdir/meson.build | 1 - .../139 custom target object output/progdir/prog.c | 5 ---- test cases/common/142 compute int/config.h.in | 2 ++ test cases/common/142 compute int/foobar.h | 6 ++++ test cases/common/142 compute int/meson.build | 35 ++++++++++++++++++++++ test cases/common/142 compute int/prog.c.in | 16 ++++++++++ .../143 custom target object output/meson.build | 16 ++++++++++ .../obj_generator.py | 18 +++++++++++ .../objdir/meson.build | 5 ++++ .../objdir/source.c | 3 ++ .../progdir/meson.build | 1 + .../143 custom target object output/progdir/prog.c | 5 ++++ 20 files changed, 107 insertions(+), 107 deletions(-) delete mode 100644 test cases/common/139 compute int/config.h.in delete mode 100644 test cases/common/139 compute int/foobar.h delete mode 100644 test cases/common/139 compute int/meson.build delete mode 100644 test cases/common/139 compute int/prog.c.in delete mode 100644 test cases/common/139 custom target object output/meson.build delete mode 100644 test cases/common/139 custom target object output/obj_generator.py delete mode 100644 test cases/common/139 custom target object output/objdir/meson.build delete mode 100644 test cases/common/139 custom target object output/objdir/source.c delete mode 100644 test cases/common/139 custom target object output/progdir/meson.build delete mode 100644 test cases/common/139 custom target object output/progdir/prog.c create mode 100644 test cases/common/142 compute int/config.h.in create mode 100644 test cases/common/142 compute int/foobar.h create mode 100644 test cases/common/142 compute int/meson.build create mode 100644 test cases/common/142 compute int/prog.c.in create mode 100644 test cases/common/143 custom target object output/meson.build create mode 100644 test cases/common/143 custom target object output/obj_generator.py create mode 100644 test cases/common/143 custom target object output/objdir/meson.build create mode 100644 test cases/common/143 custom target object output/objdir/source.c create mode 100644 test cases/common/143 custom target object output/progdir/meson.build create mode 100644 test cases/common/143 custom target object output/progdir/prog.c diff --git a/test cases/common/139 compute int/config.h.in b/test cases/common/139 compute int/config.h.in deleted file mode 100644 index ad8d077..0000000 --- a/test cases/common/139 compute int/config.h.in +++ /dev/null @@ -1,2 +0,0 @@ -#define INTSIZE @INTSIZE@ -#define FOOBAR_IN_CONFIG_H @FOOBAR@ diff --git a/test cases/common/139 compute int/foobar.h b/test cases/common/139 compute int/foobar.h deleted file mode 100644 index fd3cb5e..0000000 --- a/test cases/common/139 compute int/foobar.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __FOOBAR_H__ -#define __FOOBAR_H__ - -#define FOOBAR_IN_FOOBAR_H 10 - -#endif /*__FOOBAR_H__*/ diff --git a/test cases/common/139 compute int/meson.build b/test cases/common/139 compute int/meson.build deleted file mode 100644 index 43553fe..0000000 --- a/test cases/common/139 compute int/meson.build +++ /dev/null @@ -1,35 +0,0 @@ -project('compute int', 'c', 'cpp') - -inc = include_directories('.') - -# Test with C -cc = meson.get_compiler('c') - -intsize = cc.compute_int('sizeof(int)', low : 1, high : 16, guess : 4) -foobar = cc.compute_int('FOOBAR_IN_FOOBAR_H', prefix : '#include "foobar.h"', include_directories : inc) - -cd = configuration_data() -cd.set('INTSIZE', intsize) -cd.set('FOOBAR', foobar) -cd.set('CONFIG', 'config.h') -configure_file(input : 'config.h.in', output : 'config.h', configuration : cd) -s = configure_file(input : 'prog.c.in', output : 'prog.c', configuration : cd) - -e = executable('prog', s) -test('compute int test', e) - -# Test with C++ -cpp = meson.get_compiler('cpp') - -intsize = cpp.compute_int('sizeof(int)') -foobar = cpp.compute_int('FOOBAR_IN_FOOBAR_H', prefix : '#include "foobar.h"', include_directories : inc) - -cdpp = configuration_data() -cdpp.set('INTSIZE', intsize) -cdpp.set('FOOBAR', foobar) -cdpp.set('CONFIG', 'config.hpp') -configure_file(input : 'config.h.in', output : 'config.hpp', configuration : cdpp) -spp = configure_file(input : 'prog.c.in', output : 'prog.cc', configuration : cdpp) - -epp = executable('progpp', spp) -test('compute int test c++', epp) diff --git a/test cases/common/139 compute int/prog.c.in b/test cases/common/139 compute int/prog.c.in deleted file mode 100644 index 3ff1463..0000000 --- a/test cases/common/139 compute int/prog.c.in +++ /dev/null @@ -1,16 +0,0 @@ -#include "@CONFIG@" -#include -#include -#include "foobar.h" - -int main(int argc, char **argv) { - if(INTSIZE != sizeof(int)) { - fprintf(stderr, "Mismatch: computed int size %d, actual size %d.\n", INTSIZE, (int)sizeof(int)); - return 1; - } - if(FOOBAR_IN_CONFIG_H != FOOBAR_IN_FOOBAR_H) { - fprintf(stderr, "Mismatch: computed int %d, should be %d.\n", FOOBAR_IN_CONFIG_H, FOOBAR_IN_FOOBAR_H); - return 1; - } - return 0; -} diff --git a/test cases/common/139 custom target object output/meson.build b/test cases/common/139 custom target object output/meson.build deleted file mode 100644 index ede165b..0000000 --- a/test cases/common/139 custom target object output/meson.build +++ /dev/null @@ -1,16 +0,0 @@ -project('custom target object output', 'c') - -comp = find_program('obj_generator.py') - -if host_machine.system() == 'windows' - outputname = '@BASENAME@.obj' -else - outputname = '@BASENAME@.o' -endif - -cc = meson.get_compiler('c').cmd_array().get(-1) - -subdir('objdir') -subdir('progdir') - -test('objgen', e) diff --git a/test cases/common/139 custom target object output/obj_generator.py b/test cases/common/139 custom target object output/obj_generator.py deleted file mode 100644 index a33872a..0000000 --- a/test cases/common/139 custom target object output/obj_generator.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python3 - -# Mimic a binary that generates an object file (e.g. windres). - -import sys, subprocess - -if __name__ == '__main__': - if len(sys.argv) != 4: - print(sys.argv[0], 'compiler input_file output_file') - sys.exit(1) - compiler = sys.argv[1] - ifile = sys.argv[2] - ofile = sys.argv[3] - if compiler.endswith('cl'): - cmd = [compiler, '/nologo', '/MDd', '/Fo' + ofile, '/c', ifile] - else: - cmd = [compiler, '-c', ifile, '-o', ofile] - sys.exit(subprocess.call(cmd)) diff --git a/test cases/common/139 custom target object output/objdir/meson.build b/test cases/common/139 custom target object output/objdir/meson.build deleted file mode 100644 index 0d7f6c2..0000000 --- a/test cases/common/139 custom target object output/objdir/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -# Generate an object file manually. -object = custom_target('object', - input : 'source.c', - output : outputname, - command : [comp, cc, '@INPUT@', '@OUTPUT@']) diff --git a/test cases/common/139 custom target object output/objdir/source.c b/test cases/common/139 custom target object output/objdir/source.c deleted file mode 100644 index 7779b33..0000000 --- a/test cases/common/139 custom target object output/objdir/source.c +++ /dev/null @@ -1,3 +0,0 @@ -int func1_in_obj() { - return 0; -} diff --git a/test cases/common/139 custom target object output/progdir/meson.build b/test cases/common/139 custom target object output/progdir/meson.build deleted file mode 100644 index 4216c24..0000000 --- a/test cases/common/139 custom target object output/progdir/meson.build +++ /dev/null @@ -1 +0,0 @@ -e = executable('prog', 'prog.c', object) diff --git a/test cases/common/139 custom target object output/progdir/prog.c b/test cases/common/139 custom target object output/progdir/prog.c deleted file mode 100644 index c1ece33..0000000 --- a/test cases/common/139 custom target object output/progdir/prog.c +++ /dev/null @@ -1,5 +0,0 @@ -int func1_in_obj(); - -int main(int argc, char **argv) { - return func1_in_obj(); -} diff --git a/test cases/common/142 compute int/config.h.in b/test cases/common/142 compute int/config.h.in new file mode 100644 index 0000000..ad8d077 --- /dev/null +++ b/test cases/common/142 compute int/config.h.in @@ -0,0 +1,2 @@ +#define INTSIZE @INTSIZE@ +#define FOOBAR_IN_CONFIG_H @FOOBAR@ diff --git a/test cases/common/142 compute int/foobar.h b/test cases/common/142 compute int/foobar.h new file mode 100644 index 0000000..fd3cb5e --- /dev/null +++ b/test cases/common/142 compute int/foobar.h @@ -0,0 +1,6 @@ +#ifndef __FOOBAR_H__ +#define __FOOBAR_H__ + +#define FOOBAR_IN_FOOBAR_H 10 + +#endif /*__FOOBAR_H__*/ diff --git a/test cases/common/142 compute int/meson.build b/test cases/common/142 compute int/meson.build new file mode 100644 index 0000000..43553fe --- /dev/null +++ b/test cases/common/142 compute int/meson.build @@ -0,0 +1,35 @@ +project('compute int', 'c', 'cpp') + +inc = include_directories('.') + +# Test with C +cc = meson.get_compiler('c') + +intsize = cc.compute_int('sizeof(int)', low : 1, high : 16, guess : 4) +foobar = cc.compute_int('FOOBAR_IN_FOOBAR_H', prefix : '#include "foobar.h"', include_directories : inc) + +cd = configuration_data() +cd.set('INTSIZE', intsize) +cd.set('FOOBAR', foobar) +cd.set('CONFIG', 'config.h') +configure_file(input : 'config.h.in', output : 'config.h', configuration : cd) +s = configure_file(input : 'prog.c.in', output : 'prog.c', configuration : cd) + +e = executable('prog', s) +test('compute int test', e) + +# Test with C++ +cpp = meson.get_compiler('cpp') + +intsize = cpp.compute_int('sizeof(int)') +foobar = cpp.compute_int('FOOBAR_IN_FOOBAR_H', prefix : '#include "foobar.h"', include_directories : inc) + +cdpp = configuration_data() +cdpp.set('INTSIZE', intsize) +cdpp.set('FOOBAR', foobar) +cdpp.set('CONFIG', 'config.hpp') +configure_file(input : 'config.h.in', output : 'config.hpp', configuration : cdpp) +spp = configure_file(input : 'prog.c.in', output : 'prog.cc', configuration : cdpp) + +epp = executable('progpp', spp) +test('compute int test c++', epp) diff --git a/test cases/common/142 compute int/prog.c.in b/test cases/common/142 compute int/prog.c.in new file mode 100644 index 0000000..3ff1463 --- /dev/null +++ b/test cases/common/142 compute int/prog.c.in @@ -0,0 +1,16 @@ +#include "@CONFIG@" +#include +#include +#include "foobar.h" + +int main(int argc, char **argv) { + if(INTSIZE != sizeof(int)) { + fprintf(stderr, "Mismatch: computed int size %d, actual size %d.\n", INTSIZE, (int)sizeof(int)); + return 1; + } + if(FOOBAR_IN_CONFIG_H != FOOBAR_IN_FOOBAR_H) { + fprintf(stderr, "Mismatch: computed int %d, should be %d.\n", FOOBAR_IN_CONFIG_H, FOOBAR_IN_FOOBAR_H); + return 1; + } + return 0; +} diff --git a/test cases/common/143 custom target object output/meson.build b/test cases/common/143 custom target object output/meson.build new file mode 100644 index 0000000..ede165b --- /dev/null +++ b/test cases/common/143 custom target object output/meson.build @@ -0,0 +1,16 @@ +project('custom target object output', 'c') + +comp = find_program('obj_generator.py') + +if host_machine.system() == 'windows' + outputname = '@BASENAME@.obj' +else + outputname = '@BASENAME@.o' +endif + +cc = meson.get_compiler('c').cmd_array().get(-1) + +subdir('objdir') +subdir('progdir') + +test('objgen', e) diff --git a/test cases/common/143 custom target object output/obj_generator.py b/test cases/common/143 custom target object output/obj_generator.py new file mode 100644 index 0000000..a33872a --- /dev/null +++ b/test cases/common/143 custom target object output/obj_generator.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# Mimic a binary that generates an object file (e.g. windres). + +import sys, subprocess + +if __name__ == '__main__': + if len(sys.argv) != 4: + print(sys.argv[0], 'compiler input_file output_file') + sys.exit(1) + compiler = sys.argv[1] + ifile = sys.argv[2] + ofile = sys.argv[3] + if compiler.endswith('cl'): + cmd = [compiler, '/nologo', '/MDd', '/Fo' + ofile, '/c', ifile] + else: + cmd = [compiler, '-c', ifile, '-o', ofile] + sys.exit(subprocess.call(cmd)) diff --git a/test cases/common/143 custom target object output/objdir/meson.build b/test cases/common/143 custom target object output/objdir/meson.build new file mode 100644 index 0000000..0d7f6c2 --- /dev/null +++ b/test cases/common/143 custom target object output/objdir/meson.build @@ -0,0 +1,5 @@ +# Generate an object file manually. +object = custom_target('object', + input : 'source.c', + output : outputname, + command : [comp, cc, '@INPUT@', '@OUTPUT@']) diff --git a/test cases/common/143 custom target object output/objdir/source.c b/test cases/common/143 custom target object output/objdir/source.c new file mode 100644 index 0000000..7779b33 --- /dev/null +++ b/test cases/common/143 custom target object output/objdir/source.c @@ -0,0 +1,3 @@ +int func1_in_obj() { + return 0; +} diff --git a/test cases/common/143 custom target object output/progdir/meson.build b/test cases/common/143 custom target object output/progdir/meson.build new file mode 100644 index 0000000..4216c24 --- /dev/null +++ b/test cases/common/143 custom target object output/progdir/meson.build @@ -0,0 +1 @@ +e = executable('prog', 'prog.c', object) diff --git a/test cases/common/143 custom target object output/progdir/prog.c b/test cases/common/143 custom target object output/progdir/prog.c new file mode 100644 index 0000000..c1ece33 --- /dev/null +++ b/test cases/common/143 custom target object output/progdir/prog.c @@ -0,0 +1,5 @@ +int func1_in_obj(); + +int main(int argc, char **argv) { + return func1_in_obj(); +} -- cgit v1.1