Re: Reusing test scripts

Bill Deegan <bill-cJFiu+DHMVC5azolltMz9laTQe2KTcn/@public.gmane.org>
Newsgroups gmane.comp.programming.tools.scons.devel
Message-ID <CAEyG4CFL5T_Ew7oOhfCp-BF90t7ErMPMbxS8Huotq+b+EL9+4A@mail.gmail.com>
Sounds reasonable.
When ready make a pull request and I'll give feedback as usual ;)

On Fri, Sep 30, 2016 at 8:02 PM, William Blevins <[email protected]>
wrote:

> Bill,
>
> Does that sound reasonable? Any preference on the string change? I'd
> prefer to keep it simple.
>
> V/R,
> William
>
> On Fri, Sep 30, 2016 at 7:22 PM, William Blevins <[email protected]>
> wrote:
>
>> Bill,
>>
>> Yes. I moved a few to directories like "test/CC/shared-fixture" but I
>> intend to remove those if I can make this script generic. I think this is
>> reasonable. Copy-pasta is bad, mkay :)
>>
>> The idea would be to make as few scripts as possible by removing the
>> "test specific" strings and replacing it with something reusable. I can
>> still make the string unique (IE. like the file name with path) if we are
>> concerned about keeping it unique to the test. This would make it unique
>> even to the test execution instance; otherwise, I was just going to set it
>> to something reasonable.
>>
>> V/R,
>> William
>>
>>
>> On Fri, Sep 30, 2016 at 6:43 PM, Bill Deegan <bill-cJFiu+DHMVC5azolltMz9laTQe2KTcn/@public.gmane.org>
>> wrote:
>>
>>> You're thinking about putting all these in the test/fixture/ directory
>>> right?
>>>
>>> -Bill
>>>
>>> On Fri, Sep 30, 2016 at 5:54 PM, William Blevins <[email protected]>
>>> wrote:
>>>
>>>> Team,
>>>>
>>>> Many of the integration tests have scripts named something like
>>>> "my<xxx>.py" which are identical except for a custom hard-coded string. I
>>>> would like to make these scripts common and shared (when possible); this
>>>> should not invalidate or weaken any tests. They all run in different
>>>> directories. For example, in the snippet below of "mycc.py", the "/*cc*/"
>>>> would become something generic so that all the tests could use the same
>>>> script. This would reduce a lot of redundancy and reduce the amount of work
>>>> of future test maintenance plus porting to Python 2/3 support.
>>>>
>>>>> import sys
>>>>> outfile = open(sys.argv[1], 'wb')
>>>>> infile = open(sys.argv[2], 'rb')
>>>>> for l in [l for l in infile.readlines() if l[:6] != b'/*cc*/']:
>>>>>     outfile.write(l)
>>>>> sys.exit(0)
>>>>>
>>>>> Is this acceptable?
>>>>
>>>> V/R,
>>>> William
>>>>
>>>> _______________________________________________
>>>> Scons-dev mailing list
>>>> [email protected]
>>>> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Scons-dev mailing list
>>> [email protected]
>>> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>>>
>>>
>>
>
> _______________________________________________
> Scons-dev mailing list
> [email protected]
> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>
>

_______________________________________________
Scons-dev mailing list
[email protected]
https://pairlist2.pair.net/mailman/listinfo/scons-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.