diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/common/48 file grabber/meson.build | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/common/48 file grabber/meson.build')
-rw-r--r-- | meson/test cases/common/48 file grabber/meson.build | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/meson/test cases/common/48 file grabber/meson.build b/meson/test cases/common/48 file grabber/meson.build new file mode 100644 index 000000000..e332c0b1e --- /dev/null +++ b/meson/test cases/common/48 file grabber/meson.build @@ -0,0 +1,35 @@ +project('grabber', 'c') + +# What this script does is NOT reliable. Simply adding a file in this directory +# will NOT make it automatically appear in the build. You have to manually +# re-invoke Meson (not just Ninja) for that to happen. The simplest way +# is to touch meson-private/coredata.dat. + +# This is not the recommended way to do things, but if the tradeoffs are +# acceptable to you, then we're certainly not going to stop you. Just don't +# file bugs when it fails. :) + +if build_machine.system() == 'windows' + c = run_command('grabber.bat') + grabber = find_program('grabber2.bat') +else + c = run_command('grabber.sh') + grabber = find_program('grabber.sh') +endif + + +# First test running command explicitly. +if c.returncode() != 0 + error('Executing script failed.') +endif + +newline = ''' +''' + +sources = c.stdout().strip().split(newline) + +e = executable('prog', sources) +test('grabtest', e) + +# Then test using program with find_program +subdir('subdir') |