rscada / libmbus

Meter-bus library and utility programs
http://www.rscada.se/libmbus
BSD 3-Clause "New" or "Revised" License
217 stars 137 forks source link

Make tests stop build on error #165

Closed fredrik-sk closed 4 years ago

fredrik-sk commented 4 years ago

Update script to make the automatic tests catch when testfiles should be updated. (It just happend again.)

lategoodbye commented 4 years ago

I like this change, but i want to add normalized output into test before merging this.

fredrik-sk commented 4 years ago

I'm not sure what normalized outputs means. I would like this to be merged ASAP so noone can issue a pull request and forgot to update tests.

If you modify the output, you will have to touch all "golden files".

lategoodbye commented 4 years ago

I'm not sure what normalized outputs means.

mbus_parse_hex supports a option -n. This supports parsing the M-Bus frame the new (normalized value) way found in mbus-protocol-aux. The normalized output is better for machine processing, while the default output (mbus-protocol) is more intended for humans.

I would like this to be merged ASAP so noone can issue a pull request and forgot to update tests.

I understand but your check would only handle half of the truth.

If you modify the output, you will have to touch all "golden files".

No, we need to add all the normalized output files.

lategoodbye commented 4 years ago

Here as an example for allmess_cf50.hex

default output:

    <DataRecord id="4">
        <Function>Instantaneous value</Function>
        <StorageNumber>0</StorageNumber>
        <Unit>Flow temperature (1e-1 deg C)</Unit>
        <Value>1288</Value>
    </DataRecord>

normalized output:

    <DataRecord id="4">
        <Function>Instantaneous value</Function>
        <StorageNumber>0</StorageNumber>
        <Unit>°C</Unit>
        <Quantity>Flow temperature</Quantity>
        <Value>128.800000</Value>
    </DataRecord>
lategoodbye commented 4 years ago

The necessary changes for generate-xml.sh are available in #168

fredrik-sk commented 4 years ago

Updated/rebased onto rscada/generate-norm-xml. Found one or two things that have bothered me. Please review!

fredrik-sk commented 4 years ago

Pushed a new version

fredrik-sk commented 4 years ago

@lategoodbye : Can you review this PR please?

fredrik-sk commented 4 years ago

@lategoodbye , could you have another look?

fredrik-sk commented 4 years ago

@lategoodbye : New version, where I no longer check the count of errors, and instead accept that the two other directories does not exit with code zero.

lategoodbye commented 4 years ago

Thanks