diff options
| author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-04-26 16:52:13 +0300 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-04-26 23:39:15 +0100 |
| commit | e75e3976facda7de244fbb9a02eebf0d043ea1c8 (patch) | |
| tree | dab22f95b5c837a70b1b4164d97ff351a49ffd81 /test cases/common/71 ctarget dependency | |
| parent | 53fe7c2f0a51697cd57628753852dd3f8711becf (diff) | |
| download | meson-e75e3976facda7de244fbb9a02eebf0d043ea1c8.tar.gz | |
Condense test directory names.
Diffstat (limited to 'test cases/common/71 ctarget dependency')
| -rwxr-xr-x | test cases/common/71 ctarget dependency/gen1.py | 12 | ||||
| -rwxr-xr-x | test cases/common/71 ctarget dependency/gen2.py | 10 | ||||
| -rw-r--r-- | test cases/common/71 ctarget dependency/input.dat | 1 | ||||
| -rw-r--r-- | test cases/common/71 ctarget dependency/meson.build | 20 |
4 files changed, 43 insertions, 0 deletions
diff --git a/test cases/common/71 ctarget dependency/gen1.py b/test cases/common/71 ctarget dependency/gen1.py new file mode 100755 index 000000000..dbadb6d92 --- /dev/null +++ b/test cases/common/71 ctarget dependency/gen1.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +import time, sys + +# Make sure other script runs first if dependency +# is missing. +time.sleep(0.5) + +with open(sys.argv[1]) as f: + contents = f.read() +with open(sys.argv[2], 'w') as f: + f.write(contents) diff --git a/test cases/common/71 ctarget dependency/gen2.py b/test cases/common/71 ctarget dependency/gen2.py new file mode 100755 index 000000000..dc6525b9d --- /dev/null +++ b/test cases/common/71 ctarget dependency/gen2.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + +import sys, os +from glob import glob + +files = glob(os.path.join(sys.argv[1], '*.tmp')) +assert(len(files) == 1) + +with open(files[0]) as ifile, open(sys.argv[2], 'w') as ofile: + ofile.write(ifile.read()) diff --git a/test cases/common/71 ctarget dependency/input.dat b/test cases/common/71 ctarget dependency/input.dat new file mode 100644 index 000000000..7af91e29a --- /dev/null +++ b/test cases/common/71 ctarget dependency/input.dat @@ -0,0 +1 @@ +This is a piece of text. diff --git a/test cases/common/71 ctarget dependency/meson.build b/test cases/common/71 ctarget dependency/meson.build new file mode 100644 index 000000000..cd11951b2 --- /dev/null +++ b/test cases/common/71 ctarget dependency/meson.build @@ -0,0 +1,20 @@ +project('custom target dependency', 'c') + +# Sometimes custom targets do not take input files +# but instead do globbing or some similar wackiness. +# In this case we need to be able to specify a +# manual dependency between two custom targets, +# if one needs to be run before the other. + +g1 = find_program('gen1.py') +g2 = find_program('gen2.py') + +c1 = custom_target('medput', +input : 'input.dat', +output : 'medput.tmp', +command : [g1, '@INPUT@', '@OUTPUT@']) + +custom_target('output', +output : 'output.dat', +command : [g2, '@OUTDIR@', '@OUTPUT@'], +depends : c1) |
