Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create one testcase per error on JUnit format #28

Closed
wants to merge 1 commit into from

Conversation

linuxmaniac
Copy link
Contributor

Same file as mentioned on #27 but with this change

<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="Luacheck report" tests="22">
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:1" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W111" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:21:1: setting non-standard global variable 'NGCPAvp'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:2" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W111" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:24:1: setting non-standard global variable 'NGCPAvp_MT'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:3" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W113" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:25:15: accessing undefined variable 'NGCPAvp'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:4" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W112" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:28:14: mutating non-standard global variable 'NGCPAvp'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:5" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W212" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:28:21: unused argument 'self'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:6" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W112" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:30:9: mutating non-standard global variable 'NGCPAvp_MT'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:7" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W431" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:30:38: shadowing upvalue 't' on line 29"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:8" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W113" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:34:24: accessing undefined variable 'sr'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:9" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W211" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:36:23: unused variable 'i'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:10" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W211" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:36:26: unused variable 'v'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:11" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W421" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:37:21: shadowing definition of variable 'i' on line 36"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:12" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W113" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:41:17: accessing undefined variable 'sr'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:13" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W113" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:43:17: accessing undefined variable 'sr'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:14" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W113" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:49:20: accessing undefined variable 'sr'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:15" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W112" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:51:9: mutating non-standard global variable 'NGCPAvp_MT'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:16" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W431" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:51:42: shadowing upvalue 't' on line 29"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:17" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W113" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:52:27: accessing undefined variable 'sr'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:18" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W113" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:55:33: accessing undefined variable 'NGCPAvp_MT'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:19" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W112" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:58:14: mutating non-standard global variable 'NGCPAvp'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:20" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W113" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:62:9: accessing undefined variable 'sr'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:21" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W112" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:65:14: mutating non-standard global variable 'NGCPAvp'"/>
    </testcase>
    <testcase name="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:22" classname="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua">
        <failure type="W113" message="/home/vseva/Sipwise/git/lua-ngcp-kamailio/ngcp/avp.lua:69:9: accessing undefined variable 'sr'"/>
    </testcase>
</testsuite>

Not sure about the need of the num_test/num_tests


table.insert(buf, ([[<testsuite name="Luacheck report" tests="%d">]]):format(#report))
for _, file_report in ipairs(report) do
if file_report.error or file_report ~= 0 then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file_report ~= 0 must be #file_report ~= 0?

@mpeterv
Copy link
Owner

mpeterv commented Jun 20, 2015

Is it necessary to put index of each testcase into its name? I think it'd be better to only do that for failures, where name is not unique otherwise, and reset the count for each file.

mpeterv added a commit that referenced this pull request Jun 20, 2015
@linuxmaniac
Copy link
Contributor Author

Is it necessary to put index of each testcase into its name?

I would say that name should be unique for a testsuite. Any other idea?

I think it'd be better to only do that for failures, where name is not unique otherwise, and reset the count for each file.

Sure, you're right.I will push another version tomorrow.

Thanks!

@mpeterv
Copy link
Owner

mpeterv commented Jun 20, 2015

@linuxmaniac I've just pushed my version (#29), can you try it?

@linuxmaniac
Copy link
Contributor Author

implemented in a better way at #29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants