Re: Testing source code program with 0install
Ilja Honkonen <[email protected]>
| Newsgroups | gmane.comp.file-systems.zero-install.devel |
|---|---|
| Message-ID | <[email protected]> |
>> I have a program, for example:
>> int main() {}
>> , that I'd like to test by compiling it using several compilers and
>> compiler flags. Can I use 0install to automatically compile and run the
>> program using all permutations of e.g. "CC = gcc4 gcc5 clang35 clang36
>> icc14 icc15" and "CFLAGS = -Os -O0 -O1 -O2 -O3"? The program would also
>> have dependencies that I'd like to be compiled with same CC as the program.
> - Ensure that 0compile writes to a temporary directory, rather than
> caching the results (currently, after compiling with gcc4, it would
> assume the resulting binary was still valid when you asked to compile
> with gcc5). Setting $XDG_DATA_HOME and $XDG_CONFIG_HOME to point at
> temporary directories should do that.
> - Provide a way to request different compilers (gcc vs clang), not
> just different versions.
>> Should I make each CC into a separate interface required by the program
>> (and its dependencies) that only injects some value for CC into the
>> environment and similarly for CFLAGS? I could also create separate
>> executables from the same source with different compiler flags but the
>> same would have to be done for each dependency also which would
>> duplicate a lot of interface code. Are there any other options for doing
>> this?
> If your programs use $CC rather than specifying a 0install dependency
> then it's actually easier. You could use 0test to run your build
> command with each possible environment, e.g.
> 0test -t 'run-my-test-builds' http://example.org/gcc 4.0 5.0
Thanks but is there a difference between $CC/0test and
0install/0compile/etc? I'm not sure if your answers about XDG_DATA_HOME
and 0test are different things or different ways to do the same thing or
something else...
If my program has a local feed a.xml and I run 0test gcc.xml 4.9 5.0
a.xml how would I tell 0test to use given gcc version(s) for compiling
everything else given to 0test? Would something like this work: install
all compilers manually or using package manager(s) and have gcc.xml only
contain values for CC, PATH, LD_LIBRARY_PATH, etc., and make all
dependencies of a.xml also source-only.
------------------------------------------------------------------------------