Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gcarreno/teststar

A directory of all my Object Pascal Test repositories
https://github.com/gcarreno/teststar

demo demos fpc free-pascal freepascal lazarus

Last synced: 2 months ago
JSON representation

A directory of all my Object Pascal Test repositories

Awesome Lists containing this project

README

        

I hope this will help someone with my captured knowledge on the below subjects.

## ✨ Test Application Demo

> [GitHub Repository](https://github.com/gcarreno/TestApplicationDemo)

A boiler plate on how to do Application config the "Lazarus Way (tm)".

It includes:

- Setting up what properties to save on `TForm.SessionProperties`
- `TINIPropStorage` for `TForm.SessionProperties` property storage
- `TFileExit` action with different shortcuts for Windows and Linux
- The use of `GetAppConfigFile()` to get the app's default file customised for Linux/Windows
- A way to have different short cuts for exit in Linux(CTRL+Q) and Windows(ALT+X)

## ✨ Test Download with Progress Bar

> [GitHub Repository](https://github.com/gcarreno/TestDownloadProgressBar)

Example of `fphttpclient` with a progress bar.

## ✨ Test GNU DB Manager

> [GitHub Repository](https://github.com/gcarreno/TestGNUDBM)

[![Build Status](https://github.com/gcarreno/TestGNUDBM/workflows/build/badge.svg?branch=main)](https://github.com/gcarreno/TestGNUDBM/actions)
[![Supprts Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/TestGNUDBM/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/TestGNUDBM)](https://github.com/gcarreno/TestGNUDBM/blob/master/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/gcarreno/TestGNUDBM?label=latest%20release)](https://github.com/gcarreno/TestGNUDBM/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/gcarreno/TestGNUDBM/total)](https://github.com/gcarreno/TestGNUDBM/releases)

A simple test using the `libgdbm` library.

### To do

- [ ] Report the error generated when `gdbm_netkey` gets the last key
- [ ] Compile `libgdbm` statically

## ✨ Test Google Translate

> [GitHub Repository](https://github.com/gcarreno/TestGoogleTranslate)

[![Build Status](https://github.com/gcarreno/TestGoogleTranslate/workflows/build/badge.svg?branch=main)](https://github.com/gcarreno/TestGoogleTranslate/actions)
[![Supports Windows](https://img.shields.io/badge/support-Windows-blue?logo=Windows)](https://github.com/gcarreno/TestGoogleTranslate/releases/latest)
[![Supprts Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/TestGoogleTranslate/releases/latest)
[![Supports macOS](https://img.shields.io/badge/support-macOS-black?logo=macOS)](https://github.com/gcarreno/TestGoogleTranslate/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/TestGoogleTranslate)](https://github.com/gcarreno/TestGoogleTranslate/blob/master/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/gcarreno/TestGoogleTranslate?label=latest%20release)](https://github.com/gcarreno/TestGoogleTranslate/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/gcarreno/TestGoogleTranslate/total)](https://github.com/gcarreno/TestGoogleTranslate/releases)

Testing Google Translate with Lazarus/FPC.

## ✨ Test HTML Viewers

> [GitHub Repository](https://github.com/gcarreno/TestHTML)

[![Supports Windows](https://img.shields.io/badge/support-Windows-blue?logo=Windows)](https://github.com/gcarreno/TestHTML/releases/latest)
[![Supprts Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/TestHTML/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/TestHTML)](https://github.com/gcarreno/TestHTML/blob/master/LICENSE)

Program to test HTML Viewers.

I'm using the latest version available on the GitHub repository of [Bernd Gabriel](https://github.com/BerndGabriel/HtmlViewer) and have it included in this repository.

But you can install the needed components from the Online Package Manager(OPM).

## ✨ Test IP Scanner

> [GitHub Repository](https://github.com/gcarreno/TestIPScanner)

[![Build Status](https://github.com/gcarreno/TestIPScanner/actions/workflows/main.lazarus.yml/badge.svg?branch=main)](https://github.com/gcarreno/TestIPScanner/actions)
[![Supports Windows](https://img.shields.io/badge/support-Windows-blue?logo=Windows)](https://github.com/gcarreno/TestIPScanner/releases/latest)
[![Supports Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/TestIPScanner/releases/latest)
[![Supports macOS](https://img.shields.io/badge/support-macOS-black?logo=macOS)](https://github.com/gcarreno/TestIPScanner/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/TestIPScanner)](https://github.com/gcarreno/TestIPScanner/blob/master/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/gcarreno/TestIPScanner?label=latest%20release)](https://github.com/gcarreno/TestIPScanner/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/gcarreno/TestIPScanner/total)](https://github.com/gcarreno/TestIPScanner/releases)

An attempt to do a graphical application to scan a range of IPs and some other tools.

This entry on the [Test 🌟](https://github.com/gcarreno/TestStar) list is inspired by this repository: [IPAvailabilityScanner](https://github.com/vrwallace/IPAvailabilityScanner).

It implements:
1. Retrieving the machine's Public IP address from one of these providers:
- http://ifconfig.me
- http://ifconfig.co
- http://ipecho.net/plain
- http://checkip.amazonaws.com
2. Performing an IP scan on a range of IPs ( Not Implemented yet ).
3. Performing a Ping ( Not Implemented yet ).
4. Performing a Trace Route ( Not Implemented yet ).

This application is also using the Property Storage on an `INI` file. It stores the size of the Window and some values like the last selected tab and the last inputs on several edits.

### Important Details

#### Linux

In order to perform a Ping the packet needs to be in raw mode. This implies it needs super user permissions.

If you want Ping and TraceRoute to work you must run the program with `sudo`:

```console
$ sudo bin/TestIPScanner
```

#### Windows

This has been tested under Windows 11 and it is working on both non and "Run as User".

Many thanks to [ikel](https://github.com/ikelaiah) for doing the tests.

#### macOS

I'm unable to test under macOS so I'll need some help here.

### Known bugs

- The IP Edit component needs to be focused in order to refresh internal fields right after starting up the application.
For some reason, when the `TINIPropStorage` fills in the `TIPEdit.Text` property, the component does not refresh the internal fields.

## ✨ Test Lazarus Logging

> [GitHub Repository](https://github.com/gcarreno/TestLazarusLogging)

Repository to test and learn how to use the many logging choices in Lazarus

### List of options

Tested:
- LazLogger: https://wiki.freepascal.org/LazLogger (Comes with Lazarus)
- TEventLogger: https://wiki.lazarus.freepascal.org/TEventLog (Comes with `fcl-base` package)

Work in Progress:
- MultiLog: https://wiki.freepascal.org/MultiLog (OPM)
- GitHub: https://github.com/blikblum/multilog

Next:
- QuickLogger: https://github.com/exilon/QuickLogger
- Depends on QuickLib: https://github.com/exilon/QuickLib

Maybe:
- ExceptionLogger: https://github.com/r3code/lazarus-exception-logger (OPM)
- Log4Delphi: https://wiki.freepascal.org/Log4Delphi
- Author: http://log4delphi.sourceforge.net/index.html
- Port for `FPC`: http://sourceforge.net/projects/lazarus-ccr/files/Log4Delphi
- Log4L: https://github.com/CynicRus/Log4L
- Renegade Logger: https://github.com/hiraethbbs/Renegade.Logger
- ooLog: https://github.com/VencejoSoftware/ooLog
- datalogger: https://github.com/dliocode/datalogger

### LazLogger

pros:
- Part of the FCL
- Command line params
- User defined log groups

cons:
- Does not have multiple log providers

For more information on this option: [LazLogger README](LazLogger/README.md)

### TEventLog

pros:
- Part of the LCL
- Windows: Uses the system log

cons:
- Does not have multiple log providers

todo:
- Linux: Need to see if there is some difference geared towards a Linux system log

For more information on this option: [TEventLog README](TEventLog/README.md)

## ✨ Test Linux Distribution Information

> [GitHub Repository](https://github.com/gcarreno/TestLinuxDistInfo)

[![Build Status](https://github.com/gcarreno/TestLinuxDistInfo/workflows/build/badge.svg?branch=main)](https://github.com/gcarreno/TestLinuxDistInfo/actions)
[![Supports Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/TestLinuxDistInfo/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/TestLinuxDistInfo)](https://github.com/gcarreno/TestLinuxDistInfo/blob/master/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/gcarreno/TestLinuxDistInfo?label=latest%20release)](https://github.com/gcarreno/TestLinuxDistInfo/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/gcarreno/TestLinuxDistInfo/total)](https://github.com/gcarreno/TestLinuxDistInfo/releases)

Searches for the various methods to obtain information about the current installed distro.

Presents the options found and allows to query each one individually.

### Screenshot

![Linux Dark Theme v0.1.1](https://github.com/gcarreno/TestLinuxDistInfo/raw/main/img/LinuxDarkTheme-v0.1.1.png)

## ✨ Test Markdown

> [GitHub Repository](https://github.com/gcarreno/TestMarkdown)

[![Build Status](https://github.com/gcarreno/TestMarkdown/workflows/build/badge.svg?branch=main)](https://github.com/gcarreno/TestMarkdown/actions)
[![Supports Windows](https://img.shields.io/badge/support-Windows-blue?logo=Windows)](https://github.com/gcarreno/TestMarkdown/releases/latest)
[![Supprts Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/TestMarkdown/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/TestMarkdown)](https://github.com/gcarreno/TestMarkdown/blob/master/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/gcarreno/TestMarkdown?label=latest%20release)](https://github.com/gcarreno/TestMarkdown/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/gcarreno/TestMarkdown/total)](https://github.com/gcarreno/TestMarkdown/releases)

Program to test 2 Markdown libraries:

- [pasHTMLdown](https://github.com/BeRo1985/pashtmldown)
- [delphi-markdown](https://github.com/grahamegrieve/delphi-markdown)

## ✨ Test Memory Dataset

> [GitHub Repository](https://github.com/gcarreno/TestMemoryDataset)

[![Build Status](https://github.com/gcarreno/TestMemoryDataset/actions/workflows/main.lazarus.yml/badge.svg?branch=main)](https://github.com/gcarreno/TestMemoryDataset/actions)
[![Supports Windows](https://img.shields.io/badge/support-Windows-blue?logo=Windows)](https://github.com/gcarreno/TestMemoryDataset/releases/latest)
[![Supprts Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/TestMemoryDataset/releases/latest)
[![Supports macOS](https://img.shields.io/badge/support-macOS-black?logo=macOS)](https://github.com/gcarreno/TestMemoryDataset/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/TestMemoryDataset)](https://github.com/gcarreno/TestMemoryDataset/blob/main/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/gcarreno/TestMemoryDataset?label=latest%20release)](https://github.com/gcarreno/TestMemoryDataset/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/gcarreno/TestMemoryDataset/total)](https://github.com/gcarreno/TestMemoryDataset/releases)

An application to demonstrate how to use `TMemDataset`.

This particular component does not have a feature to sort the data.

It does, however, have a feature to filter the data.

## ✨ Test Peer-to-Peer

> [GitHub Repository](https://github.com/gcarreno/TestPeer-to-Peer)

> **Disclaimer**
>
> In the spirit of full disclosure and due to my utter laziness in coming up with the bulk of the boilerplate code, I turned to `ChatGPT`.\
> You can see the series of prompts and answers I've got in the [research](research) folder.

This is an attempt at a very basic peer class that can participate on a Peer-to-Peer( `P2P` ) network.

It will not have peer discovery via `UDP` broadcast, nor will it have any `DHT` features.

Just a simple message exchange protocol in a `P2P` context.

### Todo

- Hook up event for data received from connection thread to the internal peer method
- Add a property to allow hooking to data received from outside of the peer
- Hook up event for connection removal from connection thread to peer
- Understand if a connection needs to be disconnected when being removed

## ✨ Test QR Code

> [GitHub Repository](https://github.com/gcarreno/TestQRCode)

Program to test two Lazarus QR Code generation libs, available on OPM:

* LazBarcodes
* QRCodeGenLib

## ✨ Test Random Generation

> [GitHub Repository](https://github.com/gcarreno/TestRandomGeneration)

[![Build Status](https://github.com/gcarreno/TestRandomGeneration/actions/workflows/main.lazarus.yml/badge.svg?branch=main)](https://github.com/gcarreno/TestRandomGeneration/actions)
[![Supports Windows](https://img.shields.io/badge/support-Windows-blue?logo=Windows)](https://github.com/gcarreno/TestRandomGeneration/releases/latest)
[![Supports Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/TestRandomGeneration/releases/latest)
[![Supports macOS](https://img.shields.io/badge/support-macOS-black?logo=macOS)](https://github.com/gcarreno/TestRandomGeneration/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/TestRandomGeneration)](https://github.com/gcarreno/TestRandomGeneration/blob/master/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/gcarreno/TestRandomGeneration?label=latest%20release)](https://github.com/gcarreno/TestRandomGeneration/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/gcarreno/TestRandomGeneration/total)](https://github.com/gcarreno/TestRandomGeneration/releases)

The objective of this repository is to have a personal copy of the Random Generation functions from Prof. Marsaglia.

The code is taken from Thaddy de Koning's entry on the [Free Pascal Wiki](https://wiki.freepascal.org/Marsaglia%27s_pseudo_random_number_generators).

I'm using an MIT License for the time being. Need to have a talk with Thaddy to sort that out.

## ✨ Test Resource Loading

> [GitHub Repository](https://github.com/gcarreno/TestResourceLoading)

[![Build Status](https://github.com/gcarreno/TestResourceLoading/workflows/build/badge.svg?branch=main)](https://github.com/gcarreno/TestResourceLoading/actions)
[![Supports Windows](https://img.shields.io/badge/support-Windows-blue?logo=Windows)](https://github.com/gcarreno/TestResourceLoading/releases/latest)
[![Supprts Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/TestResourceLoading/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/TestResourceLoading)](https://github.com/gcarreno/TestResourceLoading/blob/master/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/gcarreno/TestResourceLoading?label=latest%20release)](https://github.com/gcarreno/TestResourceLoading/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/gcarreno/TestResourceLoading/total)](https://github.com/gcarreno/TestResourceLoading/releases)

A simple example on how to load a file from the binary resources onto a `TMemo`

## ✨ Test Restart Application

> [GitHub Repository](https://github.com/gcarreno/TestRestartApplication)

[![Build Status](https://github.com/gcarreno/TestRestartApplication/workflows/build/badge.svg?branch=main)](https://github.com/gcarreno/TestRestartApplication/actions)
[![Supports Windows](https://img.shields.io/badge/support-Windows-blue?logo=Windows)](https://github.com/gcarreno/TestRestartApplication/releases/latest)
[![Supprts Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/TestRestartApplication/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/TestRestartApplication)](https://github.com/gcarreno/TestRestartApplication/blob/master/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/gcarreno/TestRestartApplication?label=latest%20release)](https://github.com/gcarreno/TestRestartApplication/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/gcarreno/TestRestartApplication/total)](https://github.com/gcarreno/TestRestartApplication/releases)

Program to test a cross platform way of doing application restarting itself.

## ✨ Test RxMemoryData

> [GitHub Repository](https://github.com/gcarreno/TestRxMemoryData)

[![Build Status](https://github.com/gcarreno/TestRXMemoryDataset/actions/workflows/main.lazarus.yml/badge.svg?branch=main)](https://github.com/gcarreno/TestRXMemoryDataset/actions)
[![Supports Windows](https://img.shields.io/badge/support-Windows-blue?logo=Windows)](https://github.com/gcarreno/TestRXMemoryDataset/releases/latest)
[![Supprts Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/TestRXMemoryDataset/releases/latest)
[![Supports macOS](https://img.shields.io/badge/support-macOS-black?logo=macOS)](https://github.com/gcarreno/TestRXMemoryDataset/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/TestRXMemoryDataset)](https://github.com/gcarreno/TestRXMemoryDataset/blob/main/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/gcarreno/TestRXMemoryDataset?label=latest%20release)](https://github.com/gcarreno/TestRXMemoryDataset/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/gcarreno/TestRXMemoryDataset/total)](https://github.com/gcarreno/TestRXMemoryDataset/releases)

An application to demonstrate how to use `TRxMemoryData`.

This particular component does not have a feature to sort the data.

It does, however, have a feature to filter the data.

Also using the `TRxDBGrid` for the visualization of the data, since I'm already using the RX package.

## ✨ Test Thread Pool

> [GitHub Repository](https://github.com/gcarreno/TestThreadPool)

[![Supports Windows](https://img.shields.io/badge/support-Windows-blue?logo=Windows)](https://github.com/gcarreno/TestThreadPool/releases/latest)
[![Supports Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/TestThreadPool/releases/latest)
[![Supports macOS](https://img.shields.io/badge/support-macOS-black?logo=macOS)](https://github.com/gcarreno/TestThreadPool/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/TestThreadPool)](https://github.com/gcarreno/TestThreadPool/blob/master/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/gcarreno/TestThreadPool?label=latest%20release)](https://github.com/gcarreno/TestThreadPool/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/gcarreno/TestThreadPool/total)](https://github.com/gcarreno/TestThreadPool/releases)

Example of how to use the Class `TThread` with a pool manager.

### Credits

Original Code: Andrew Thomas Brunner (http://www.aurawin.com)

Correcting Critical Section Lock: paweld (https://github.com/paweld)

## ✨ Test Threading

> [GitHub Repository](https://github.com/gcarreno/TestThreading)

[![Build Status](https://github.com/gcarreno/TestThreading/actions/workflows/main.lazarus.yml/badge.svg?branch=main)](https://github.com/gcarreno/TestThreading/actions)
[![Supports Windows](https://img.shields.io/badge/support-Windows-blue?logo=Windows)](https://github.com/gcarreno/TestThreading/releases/latest)
[![Supports Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/TestThreading/releases/latest)
[![Supports macOS](https://img.shields.io/badge/support-macOS-black?logo=macOS)](https://github.com/gcarreno/TestThreading/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/TestThreading)](https://github.com/gcarreno/TestThreading/blob/master/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/gcarreno/TestThreading?label=latest%20release)](https://github.com/gcarreno/TestThreading/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/gcarreno/TestThreading/total)](https://github.com/gcarreno/TestThreading/releases)

Example of how to use the Class `TThread` and all of the threading tools available with Free Pascal.

### Single Thread, Single Instance

This exemplifies the most basic use of a thread.

It declares an event to hook into the main form.

This is a single shot use because we set the thread's `FreeOnTerminate` property to True.

### Single Thread, Many Instances

The example above isn't of much use if we just run a single instance.

In this example we create multiple instances of the same thread and we start them concurrently.

This is, **also**, a single shot use because we set the thread's `FreeOnTerminate` property to True.