[lld] r193982 - [PECOFF] Add a test for the resource file.
Sean Silva
silvas at purdue.edu
Mon Nov 4 09:20:07 PST 2013
+# Check if the binary contains UTF-16 string "Hello" copied from
resource.res.
+# cat %t.exe | grep 'H.e.l.l.o'
I would specifically say UTF-16LE, since this code assumes that.
Also, we're trying to get away from using grep in the test suite (yes,
there are still a lot of uses). That will, among other things, make it
easier to extend this test later (or is this all the resource file
functionality we intend to implement?).
-- Sean Silva
On Mon, Nov 4, 2013 at 12:17 AM, Rui Ueyama <ruiu at google.com> wrote:
> Author: ruiu
> Date: Sun Nov 3 23:17:54 2013
> New Revision: 193982
>
> URL: http://llvm.org/viewvc/llvm-project?rev=193982&view=rev
> Log:
> [PECOFF] Add a test for the resource file.
>
> Added:
> lld/trunk/test/pecoff/Inputs/resource.rc
> lld/trunk/test/pecoff/Inputs/resource.res (with props)
> lld/trunk/test/pecoff/resource.test
> Modified:
> lld/trunk/test/lit.cfg
>
> Modified: lld/trunk/test/lit.cfg
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/test/lit.cfg?rev=193982&r1=193981&r2=193982&view=diff
>
> ==============================================================================
> --- lld/trunk/test/lit.cfg (original)
> +++ lld/trunk/test/lit.cfg Sun Nov 3 23:17:54 2013
> @@ -134,3 +134,9 @@ if re.search(r'DEBUG', llc_cmd.stdout.re
> if re.search(r'with assertions', llc_cmd.stdout.read()):
> config.available_features.add('asserts')
> llc_cmd.wait()
> +
> +# Check if Windows resource file compiler exists.
> +cvtres = lit.util.which('cvtres', config.environment['PATH'])
> +rc = lit.util.which('rc', config.environment['PATH'])
> +if cvtres and rc:
> + config.available_features.add('winres')
>
> Added: lld/trunk/test/pecoff/Inputs/resource.rc
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/Inputs/resource.rc?rev=193982&view=auto
>
> ==============================================================================
> --- lld/trunk/test/pecoff/Inputs/resource.rc (added)
> +++ lld/trunk/test/pecoff/Inputs/resource.rc Sun Nov 3 23:17:54 2013
> @@ -0,0 +1,4 @@
> +STRINGTABLE
> +{
> + 1, "Hello"
> +}
>
> Added: lld/trunk/test/pecoff/Inputs/resource.res
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/Inputs/resource.res?rev=193982&view=auto
>
> ==============================================================================
> Binary files lld/trunk/test/pecoff/Inputs/resource.res (added) and
> lld/trunk/test/pecoff/Inputs/resource.res Sun Nov 3 23:17:54 2013 differ
>
> Propchange: lld/trunk/test/pecoff/Inputs/resource.res
>
> ------------------------------------------------------------------------------
> svn:executable = *
>
> Added: lld/trunk/test/pecoff/resource.test
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/resource.test?rev=193982&view=auto
>
> ==============================================================================
> --- lld/trunk/test/pecoff/resource.test (added)
> +++ lld/trunk/test/pecoff/resource.test Sun Nov 3 23:17:54 2013
> @@ -0,0 +1,9 @@
> +# REQUIRES: winres
> +
> +# RUN: yaml2obj %p/Inputs/nop.obj.yaml > %t.obj
> +#
> +# RUN: lld -flavor link /out:%t.exe /subsystem:console /entry:start
> /opt:noref \
> +# RUN: -- %t.obj %p/Inputs/resource.res
> +
> +# Check if the binary contains UTF-16 string "Hello" copied from
> resource.res.
> +# cat %t.exe | grep 'H.e.l.l.o'
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131104/919da1de/attachment.html>
More information about the llvm-commits
mailing list