OpenVMS Pascal - testing tools?
-
Topic author - Active Contributor
- Posts: 38
- Joined: Thu Nov 19, 2020 7:15 am
- Reputation: 0
- Location: Basingstoke, UK
- Status: Offline
- Contact:
OpenVMS Pascal - testing tools?
Hi,
Anyone know of any unit test tools for OpenVMS Pascal?
I'm looking for something a la Java JUNIT or Python Pytest etc. I'd like to write a suite of tests for our application and using a tool would be handy. Perhaps DTM has something I could use?
Thanks
Gary
Anyone know of any unit test tools for OpenVMS Pascal?
I'm looking for something a la Java JUNIT or Python Pytest etc. I'd like to write a suite of tests for our application and using a tool would be handy. Perhaps DTM has something I could use?
Thanks
Gary
-
- Master
- Posts: 385
- Joined: Fri Apr 17, 2020 7:31 pm
- Reputation: 0
- Location: Rhode Island, USA
- Status: Offline
- Contact:
Re: OpenVMS Pascal - testing tools?
I am not aware of anything.
Delphi DUnit2 and Lazarus FPTest will not work with VMS Pascal.
I think it will have to be DIY.
But it is not so hard to do.
I started and got:
$ typ testdemo.pas
[inherit('demo', 'vpunit')]
program testdemo(input, output);
procedure test_add2;
var
a, b, c : integer;
begin
a := 123;
b := 456;
c := add2(a, b);
vpunit_check_integer_equals(579, c, 'add2(123, 456)');
end;
procedure test_sub2;
var
a, b, c : integer;
begin
a := 579;
b := 123;
c := sub2(a, b);
vpunit_check_integer_equals(456, c, 'sub2(579, 123)');
end;
procedure test_mul2;
var
a, b, c : integer;
begin
a := 11;
b := 12;
c := mul2(a, b);
vpunit_check_integer_equals(131, c, 'mul2(11, 12)');
end;
procedure test_div2;
var
a, b, c : integer;
begin
a := 50;
b := 3;
c := div2(a, b);
vpunit_check_integer_equals(16, c, 'div2(50, 3)');
end;
procedure test_alwaystrue;
var
b : boolean;
begin
b := alwaystrue;
vpunit_check_true(b, 'alwaystrue');
end;
procedure test_dup;
var
s, s2 : varstr;
begin
s := 'ABC';
s2 := dup(s);
vpunit_check_fixstring_equals('ABCABC', s, 'dup(''ABC'')');
end;
begin
vpunit_test(test_add2);
vpunit_test(test_sub2);
vpunit_test(test_mul2);
vpunit_test(test_div2);
vpunit_stats;
end.
$ r testdemo
Failure: expected 131 actual 23 for mul2(11, 12)
4 test run: 1 failed
Added in 5 minutes 7 seconds:
If there is interest then I could zip this stuff up and make it available for download.
But it is pretty trivial.
Delphi DUnit2 and Lazarus FPTest will not work with VMS Pascal.
I think it will have to be DIY.
But it is not so hard to do.
I started and got:
$ typ testdemo.pas
[inherit('demo', 'vpunit')]
program testdemo(input, output);
procedure test_add2;
var
a, b, c : integer;
begin
a := 123;
b := 456;
c := add2(a, b);
vpunit_check_integer_equals(579, c, 'add2(123, 456)');
end;
procedure test_sub2;
var
a, b, c : integer;
begin
a := 579;
b := 123;
c := sub2(a, b);
vpunit_check_integer_equals(456, c, 'sub2(579, 123)');
end;
procedure test_mul2;
var
a, b, c : integer;
begin
a := 11;
b := 12;
c := mul2(a, b);
vpunit_check_integer_equals(131, c, 'mul2(11, 12)');
end;
procedure test_div2;
var
a, b, c : integer;
begin
a := 50;
b := 3;
c := div2(a, b);
vpunit_check_integer_equals(16, c, 'div2(50, 3)');
end;
procedure test_alwaystrue;
var
b : boolean;
begin
b := alwaystrue;
vpunit_check_true(b, 'alwaystrue');
end;
procedure test_dup;
var
s, s2 : varstr;
begin
s := 'ABC';
s2 := dup(s);
vpunit_check_fixstring_equals('ABCABC', s, 'dup(''ABC'')');
end;
begin
vpunit_test(test_add2);
vpunit_test(test_sub2);
vpunit_test(test_mul2);
vpunit_test(test_div2);
vpunit_stats;
end.
$ r testdemo
Failure: expected 131 actual 23 for mul2(11, 12)
4 test run: 1 failed
Added in 5 minutes 7 seconds:
If there is interest then I could zip this stuff up and make it available for download.
But it is pretty trivial.
-
- Master
- Posts: 157
- Joined: Fri Jun 28, 2019 8:45 am
- Reputation: 0
- Location: South Tyneside, UK
- Status: Offline
- Contact:
Re: OpenVMS Pascal - testing tools?
DTM would work if you have a license for it or DECset. Have a look at the latest DTM Guide https://vmssoftware.com/docs/VSI_DTM_GD.PDF
Ian Miller
[ personal opinion only. usual disclaimers apply. Do not taunt happy fun ball ].
[ personal opinion only. usual disclaimers apply. Do not taunt happy fun ball ].
-
Topic author - Active Contributor
- Posts: 38
- Joined: Thu Nov 19, 2020 7:15 am
- Reputation: 0
- Location: Basingstoke, UK
- Status: Offline
- Contact:
Re: OpenVMS Pascal - testing tools?
arne_v wrote: ↑Tue Nov 24, 2020 1:55 pmI am not aware of anything.
Delphi DUnit2 and Lazarus FPTest will not work with VMS Pascal.
I think it will have to be DIY.
But it is not so hard to do.
I started and got:
(snip...)
Added in 5 minutes 7 seconds:
If there is interest then I could zip this stuff up and make it available for download.
But it is pretty trivial.
Thanks very much for this, unfortunately I fell at the first hurdle when trying it :
I'm a newbie to Pascal so not sure where the demo & vpunit files are/should be.$ pas testdemo
[inherit('demo', 'vpunit')]
..........^
%PASCAL-F-FNF, file not found
at line number 1 in file MYROOT:[dev.pascal]testdemo.pas;1
%PASCAL-F-SRCERRORS, Source errors inhibit continued compilation - correct and recompile
%PASCAL-F-ENDDIAGS, PASCAL completed with 2 diagnostics
But I do like the look of the vpunit_ procedures but didn't see any documentation about them.
Thanks!
Added in 3 minutes 37 seconds:
Thanks, we've got DTM and will have a more serious look at the documentation.imiller wrote: ↑Wed Nov 25, 2020 5:53 amDTM would work if you have a license for it or DECset. Have a look at the latest DTM Guide https://vmssoftware.com/docs/VSI_DTM_GD.PDF
Last edited by marty.stu on Wed Nov 25, 2020 8:21 am, edited 1 time in total.
Reason: Overquoting
Reason: Overquoting
-
- Master
- Posts: 385
- Joined: Fri Apr 17, 2020 7:31 pm
- Reputation: 0
- Location: Rhode Island, USA
- Status: Offline
- Contact:
Re: OpenVMS Pascal - testing tools?
The vpunit stuff is something I wrote for this.
Module demo is the module I want to unit test.
Module vpunit is the vpunit_ routines.
So right now it only exist on my system.
I can ZIP it up and make it available for download if anybody want.
Module demo is the module I want to unit test.
Module vpunit is the vpunit_ routines.
So right now it only exist on my system.
I can ZIP it up and make it available for download if anybody want.
-
Topic author - Active Contributor
- Posts: 38
- Joined: Thu Nov 19, 2020 7:15 am
- Reputation: 0
- Location: Basingstoke, UK
- Status: Offline
- Contact:
Re: OpenVMS Pascal - testing tools?
...I can ZIP it up and make it available for download if anybody want...
Thanks Arne, that'd be great! Look forward to getting hold of the sources, will you post a link or will they be attached to a post?
I was going to try writing my own test harness using ASSERT and catching thrown exceptions etc and then realised VMS Pascal doesn't have try/except blocks.
Best regards
Gary
-
- Master
- Posts: 385
- Joined: Fri Apr 17, 2020 7:31 pm
- Reputation: 0
- Location: Rhode Island, USA
- Status: Offline
- Contact:
Re: OpenVMS Pascal - testing tools?
https://www.vajhoej.dk/arne/opensource/ ... c-v0_1.zip
And it is not really much.
But if you have some suggestions for improvement please tell me.
And it is not really much.
But if you have some suggestions for improvement please tell me.
-
Topic author - Active Contributor
- Posts: 38
- Joined: Thu Nov 19, 2020 7:15 am
- Reputation: 0
- Location: Basingstoke, UK
- Status: Offline
- Contact:
Re: OpenVMS Pascal - testing tools?
Thanks a lot Arne, I'll give it a go later today. It's certainly a good approach and perhaps I can build on it too.arne_v wrote: ↑Wed Nov 25, 2020 7:00 pmhttps://www.vajhoej.dk/arne/opensource/ ... c-v0_1.zip
And it is not really much.
But if you have some suggestions for improvement please tell me.
Best regards
Gary