PureUnit 1.3, clean install of PB 6.01 x86 03/07/2023. Fails to work

Just starting out? Need help? Post your questions and find answers here.
destiny
User
User
Posts: 29
Joined: Wed Jul 15, 2015 12:58 pm
Location: CCCP

PureUnit 1.3, clean install of PB 6.01 x86 03/07/2023. Fails to work

Post by destiny »

Hi guys.

Trying to understand how to use PureUnit 1.3 and stuck.

Added to instruments:
"1. PureUnit on compile/run", path\PureUnitGui.exe, "%FILE" --gui --verbose, "Before compilation/run", no checkboxes or "use for main code";
"2. PureUnit on save", path\PureUnitGui.exe, "%FILE" --gui --verbose, "When saving source", no checkboxes or "use for main code".

New project started with two files - main file and include file.
Main file has one XInclude that includes include file.
Main file has one ProcedureUnit with one Assert(#True = #True) and one Debug line.
Include file has the same - one ProcedureUnit with one Assert and one Debug lines.

Now (clean 6.01 Free): removed everything except original files then tried again:
Compiled: (no parameters)
Error: Compiler Error
On line: 359
Error: Constant not found: #GENERIC_WRITE.
when trying to Ctrl-S include or main file or F5/Run/Compile project.

Before (not clean 6.00):
"1. PureUnit test..." disabled in instruments.
I'm pressing Ctrl-S when include file tab selected - PureUnit window opened and it says that it tested include file successfully. Test 1 of 1 is ok.
Now I'm selecting main file and pressing Ctrl-S - PureUnit window opened and says that it tested main file and include files successfully. Tests 2 of 2 is ok.

Now I try to run (F5) code when include file tab or main file tab selected and I've got a "Syntax error" and line with "ProcedureUnit" highlighed and selected. Changing checkboxes in instruments "1/2. PureUnit test" and enabling checkbox in project compilation destination (Start instrument... "1/2. PureUnit..") changes nothing - I can't run/compile code when ProcedureUnit lines are here.


What I'm doing wrong?..
Or it is a limitation of pbcompiler in Free version?

PS: something wrong with readme:

Code: Select all

-v
--verbose
-v
--version
Last edited by destiny on Wed Mar 08, 2023 8:12 am, edited 3 times in total.
destiny
User
User
Posts: 29
Joined: Wed Jul 15, 2015 12:58 pm
Location: CCCP

Re: PureUnit 1.3, clean install of PB 6.01 x86 03/07/2023. Fails to work

Post by destiny »

PureUnit_Main_File.pb:

Code: Select all

EnableExplicit
XIncludeFile "PureUnit_Include.pbi"
PureUnitOptions(Thread)
ProcedureUnit My_Library()
  Assert(#True = #True, "This should pass.")
EndProcedureUnit

OpenConsole()
PrintN("PrintN 0: Test. Press Any Key to Exit")
Debug("Debug 0: Test. Press Any Key to Exit")
While Inkey() = "" : Wend
CloseConsole()
PureUnit_Include.pbi:

Code: Select all

EnableExplicit
ProcedureUnit PureUnit_Include()
  Assert(#True = #True)
EndProcedureUnit
Project.pbp:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://www.purebasic.com/namespace" version="1.0" creator="PureBasic 6.01 LTS (Windows - x86)">
  <section name="config">
    <options closefiles="1" openmode="0" name="PureUnit_Project"/>
  </section>
  <section name="data">
    <explorer view="C:\ProgramData\PureBasic\Examples\" pattern="0"/>
    <log show="1"/>
  </section>
  <section name="files">
    <file name="PureUnit_Include.pbi">
      <config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="1" panelstate="+"/>
      <fingerprint md5="ec0b2e114d32fd24b298b109861a6ac4"/>
    </file>
    <file name="PureUnit_Main_File.pb">
      <config load="0" scan="1" panel="1" warn="1" lastopen="1" sortindex="2" panelstate="+"/>
      <fingerprint md5="ea9bdf550d8ea0438e98303872eb1f95"/>
    </file>
  </section>
  <section name="targets">
    <target name="Default Target" enabled="1" default="1">
      <inputfile value="PureUnit_Main_File.pb"/>
      <outputfile value=""/>
      <compiler version="PureBasic 6.01 LTS (Windows - x86)"/>
      <options xpskin="1" dpiaware="1" debug="1" optimizer="0"/>
      <tools>PUREUNIT_ON_COMPILE/RUN</tools>
    </target>
  </section>
</project>
Tools.prefs:

Code: Select all

;  PureBasic IDE ToolsMenu Configuration
; 
[ToolsInfo]
ToolCount = 2
; 
; 
[Tool_0]
Command = Z:\PB\SDK\PureUnit\PureUnit.exe
Arguments = "%FILE" --gui --verbose
WorkingDir = 
MenuItemName = PureUnit on compile/run
Shortcut = 0
ConfigLine = 
Trigger = 3
Flags = 0
ReloadSource = 0
HideEditor = 0
HideFromMenu = 0
SourceSpecific = 1
Deactivate = 0
; 
; 
[Tool_1]
Command = Z:\PB\SDK\PureUnit\PureUnit.exe
Arguments = "%FILE" --gui --verbose
WorkingDir = 
MenuItemName = PureUnit on save
Shortcut = 0
ConfigLine = 
Trigger = 9
Flags = 0
ReloadSource = 0
HideEditor = 0
HideFromMenu = 0
SourceSpecific = 0
Deactivate = 0
About:
PureBasic 6.01 LTS (Windows - x86)
IDE build on 03/07/2023 [11:35] by Fred
Branch: v6.01 Revision: aa1dbc85256c

Code: Select all

PureUnit.res 2524 bytes from SDK\PureUnit placed to the Residents\, SHA-1: 902848BAD9DE6F1AC45A605FAD7C2AF8BAEAA339
SDK\PureUnit\PureUnit.exe 230400 bytes, SHA-1: 1DCFDE1FAE36EDB7E17839D175E5304AE0D910F3
SDK\PureUnit\PureUnitGui.exe 230400 bytes, SHA-1: 70A4CE2BAE3C03251BA357CE5B4D6F560694FFFA
destiny
User
User
Posts: 29
Joined: Wed Jul 15, 2015 12:58 pm
Location: CCCP

Re: PureUnit 1.3, clean install of PB 6.01 x86 03/07/2023. Fails to work

Post by destiny »

Z:\PB\SDK\PureUnit\PureUnitGui.exe --compiler Z:\PB\Compilers\pbcompiler.exe --gui Z:\PB\_Projects\PureUnit_Main_File.pb throws the same error:
Using compiler: PureBasic 6.01 LTS (Windows - x86)

Preparing file: ..\..\_Projects\PureUnit_Main_File.pb
Compiling with: (no parameters)

File : ..\..\_Projects\PureUnit_Main_File.pb
Compiled: (no parameters)
Error: Compiler Error
On line: 359
Error: Constant not found: #GENERIC_WRITE.

Stats: Failure after 0 successful tests in 1 files. (0 min, 1 sec)
User avatar
jacdelad
Addict
Addict
Posts: 1993
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: PureUnit 1.3, clean install of PB 6.01 x86 03/07/2023. Fails to work

Post by jacdelad »

I'm sorry for hijacking this thread, but where can I download the most recent version of PureUnit? I only found http://forums.purebasic.com/english/vie ... hp?t=28693, which is rather old.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
destiny
User
User
Posts: 29
Joined: Wed Jul 15, 2015 12:58 pm
Location: CCCP

Re: PureUnit 1.3, clean install of PB 6.01 x86 03/07/2023. Fails to work

Post by destiny »

jacdelad wrote: Wed Mar 08, 2023 8:37 am where can I download the most recent version of PureUnit?
I'm trying to "ride a horse" for the n'th time and downloaded Free PB from purebasic site. Installation includes PureUnit, as I understand - latest version. Now it is 1.3. (Look at SDK\PureUnit)
User avatar
jacdelad
Addict
Addict
Posts: 1993
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: PureUnit 1.3, clean install of PB 6.01 x86 03/07/2023. Fails to work

Post by jacdelad »

destiny wrote: Wed Mar 08, 2023 8:41 am
jacdelad wrote: Wed Mar 08, 2023 8:37 am where can I download the most recent version of PureUnit?
I'm trying to "ride a horse" for the n'th time and downloaded Free PB from purebasic site. Installation includes PureUnit, as I understand - latest version. Now it is 1.3. (Look at SDK\PureUnit)
Ah, so it's built-in. Thanks, I didn't know that.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
destiny
User
User
Posts: 29
Joined: Wed Jul 15, 2015 12:58 pm
Location: CCCP

Re: PureUnit 1.3, clean install of PB 6.01 x86 03/07/2023. Fails to work

Post by destiny »

"Constant not found: #GENERIC_WRITE" error is because there are no residents with that constant in free version. So PureUnit will not work there.
Post Reply