Changeset 2276


Ignore:
Timestamp:
Aug 30, 2017, 5:07:59 PM (3 months ago)
Author:
bruno
Message:

Adapt Conf test so that we handle YAML formats as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/t/Conf.t

    r2275 r2276  
    3636pb_temp_init();
    3737
     38my ($projectbuilderver,$projectbuilderrev,$projectbuilderconfver) = pb_version_init();
     39
    3840pb_conf_init("test");
    3941open(FILE,"> $ENV{'TMPDIR'}/conf.pb") || die "Unable to create $ENV{'TMPDIR'}/conf.pb";
    40 # should be in alphabetic order
    41 print FILE "truc mageia-4-x86_64 = la tete a toto\n";
    42 print FILE "yorro mageia-3-x86_64 = tartampion\n";
    43 print FILE "zz mageia-3-x86_64 = yy\n";
     42if ($projectbuilderconfver < 1) {
     43    # Old conf file format
     44    # should be in alphabetic order
     45    print FILE "truc mageia-4-x86_64 = la tete a toto\n";
     46    print FILE "yorro mageia-3-x86_64 = tartampion\n";
     47    print FILE "zz mageia-3-x86_64 = yy\n";
     48} else {
     49    print FILE "---\n";
     50    print FILE "truc:\n";
     51    print FILE "  mageia-4-x86_64: la tete a toto\n";
     52    print FILE "yorro:\n";
     53    print FILE "  mageia-3-x86_64: tartampion\n";
     54    print FILE "zz:\n";
     55    print FILE "  mageia-3-x86_64: !!str ''\n";
     56}
    4457close(FILE);
    4558my $cnt = pb_get_content("$ENV{'TMPDIR'}/conf.pb");
Note: See TracChangeset for help on using the changeset viewer.