use P4::test; use P4::TM { DATA_DIR => 'self' }; use Data::Dumper; use File::Copy; use Text::Diff; use File::Copy::Recursive 'dircopy'; `p4 configure set server.extensions.allow.unsigned=1`; dircopy $script_abspath =~ s/\.t$//r . '/*', 'ValidateFieldSize'; cp 'foo/manifest.lua', 'ValidateFieldSize'; `p4 extension --package ValidateFieldSize`; `p4 extension --install ValidateFieldSize.p4-extension -y`; tm `p4 extension --configure ExampleInc::validate-fieldsize -o | p4 extension --configure ExampleInc::validate-fieldsize -i`; $stdin = `p4 extension --configure ExampleInc::validate-fieldsize --name=nm1 -o`; $stdin =~ s/formField:.*\n.*/formField: Description/g; $stdin =~ s/formType:.*\n.*/formType: change/g; $stdin =~ s/minSize:.*\n.*/minSize: 10/g; tm `p4 extension --configure ExampleInc::validate-fieldsize --name=nm1 -i`; `p4 client -o | p4 client -i`; write_file 'somefile1.txt', 'some content for file1'; `p4 add ./somefile1.txt`; $stdin = `p4 change -o`; $stdin =~ s/Description:.*\n.*/Description: short des/g; tm `p4 change -i`; `p4 info`; # for a consistent grep result tm grep { /Perforce server error:/ ... /Perforce server info/ } read_file "$server->{serverRoot}/track.log"; __DATA__ [[15,21,28,31], [ 'p4 extension --configure ExampleInc::validate-fieldsize -o | p4 extension --configure ExampleInc::validate-fieldsize -i', ' Extension config validate-fieldsize saved. User sampleExtensionsUser doesn\'t exist (Extension owner:user). ', 0, 'p4 extension --configure ExampleInc::validate-fieldsize --name=nm1 -i', 'Extension config nm1 saved. ', 0, 'p4 change -i', ' Error in change specification. \'nm1\' validation failed: Field \'Description\' minimum size is 10, \'short des\' is too short. ', 1, 'grep { /Perforce server error:/ ... /Perforce server info/ } read_file "SERVER_ROOT_MASK/track.log"', ' Perforce server error: \'nm1\' validation failed: Field \'Description\' minimum size is 10, \'short des\' is too short.: Field \'Description\' minimum size is 10, \'short des\' is too short. Perforce server info: ', 0 ] ]
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 30809 | C. Thomas Tyler |
Code drop with newer versions of Extensions. Thanks to @jason_gibon. #review-30810 @jabson_gibson |
||
#1 | 30808 | C. Thomas Tyler |
Promoted from 2019.1/... to main/... |
||
//guest/perforce_software/extensions/2019.1/validate_field_size.t | |||||
#1 | 25601 | Jason Gibson |
Import example Extensions. p19.1@1797741 |