Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,4 @@ addons:

# Build steps
script:
- ./build_simple.sh
- cd ./tests/
- ./run_package_installation.sh
- cd ..
- cd unit-tests.wsjcpp
- ./build_simple.sh
- ./unit-tests
- ./ci/travis/run.sh
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to wsjcpp project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [v0.2.2] - 2021-08-28 (2021 Aug 28)

### Added

- Added new 'wsjcpp unit-tests run' or short 'wsjcpp ut r'

### Security

- Updated wsjcpp-hashes to v0.1.4

## [v0.2.1] - 2021-04-11 (2021 Apr 11)

### Added
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ list (APPEND WSJCPP_SOURCES "./src/ArgumentsProcessors/argument_processor_prepar
list (APPEND WSJCPP_SOURCES "./src/ArgumentsProcessors/argument_processor_resources.h")
list (APPEND WSJCPP_SOURCES "./src/ArgumentsProcessors/argument_processor_resources.cpp")
list (APPEND WSJCPP_SOURCES "./src/ArgumentsProcessors/argument_processor_authors.cpp")
list (APPEND WSJCPP_SOURCES "src/ArgumentsProcessors/argument_processor_lint.cpp")


include_directories(${WSJCPP_INCLUDE_DIRS})
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# wsjcpp

[![Build Status](https://api.travis-ci.com/wsjcpp/wsjcpp.svg?branch=master)](https://travis-ci.com/wsjcpp/wsjcpp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Docker Pulls](https://img.shields.io/docker/pulls/sea5kg/wsjcpp.svg)](https://hub.docker.com/r/sea5kg/wsjcpp/) [![Github Stars](https://img.shields.io/github/stars/wsjcpp/wsjcpp.svg?label=github%20%E2%98%85)](https://github.com/wsjcpp/wsjcpp) [![Github Stars](https://img.shields.io/github/contributors/wsjcpp/wsjcpp.svg)](https://github.com/wsjcpp/wsjcpp) [![Github Forks](https://img.shields.io/github/forks/wsjcpp/wsjcpp.svg?label=github%20forks)](https://github.com/wsjcpp/wsjcpp/network/members) [![Total alerts](https://img.shields.io/lgtm/alerts/g/wsjcpp/wsjcpp.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/wsjcpp/wsjcpp/alerts/) [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/wsjcpp/wsjcpp.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/wsjcpp/wsjcpp/context:cpp)
[![Build Status](https://api.travis-ci.com/wsjcpp/wsjcpp.svg?branch=master)](https://travis-ci.com/wsjcpp/wsjcpp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Docker Pulls](https://img.shields.io/docker/pulls/sea5kg/wsjcpp.svg)](https://hub.docker.com/r/sea5kg/wsjcpp/) [![Github Stars](https://img.shields.io/github/stars/wsjcpp/wsjcpp.svg?label=github%20%E2%98%85)](https://github.com/wsjcpp/wsjcpp) [![Github Stars](https://img.shields.io/github/contributors/wsjcpp/wsjcpp.svg)](https://github.com/wsjcpp/wsjcpp) [![Github Forks](https://img.shields.io/github/forks/wsjcpp/wsjcpp.svg?label=github%20forks)](https://github.com/wsjcpp/wsjcpp/network/members) [![Total alerts](https://img.shields.io/lgtm/alerts/g/wsjcpp/wsjcpp.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/wsjcpp/wsjcpp/alerts/) [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/wsjcpp/wsjcpp.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/wsjcpp/wsjcpp/context:cpp) [![deepcode](https://www.deepcode.ai/api/gh/badge?key=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwbGF0Zm9ybTEiOiJnaCIsIm93bmVyMSI6IndzamNwcCIsInJlcG8xIjoid3NqY3BwIiwiaW5jbHVkZUxpbnQiOmZhbHNlLCJhdXRob3JJZCI6MTU2NDEsImlhdCI6MTYxODcxNzM1M30.tYld0fGXb1L2UDJt5oJwodBlzDOsfGNSk_121jug4Vg)](https://www.deepcode.ai/app/gh/wsjcpp/wsjcpp/_/dashboard?utm_content=gh%2Fwsjcpp%2Fwsjcpp)

Yet another... C++ Source Package Manager

Official site: [http://wsjcpp.org/](http://wsjcpp.org/)
Official site: [https://wsjcpp.org/](https://wsjcpp.org/)

## Get for work

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.2.1
0.2.2
84 changes: 84 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
version: '{build}'

environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
configuration: Debug
platform: x86
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 14 2015

#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# configuration: Release
# platform: x86
# CXX_FLAGS: ""
# LINKER_FLAGS: ""
# CMAKE_OPTIONS: ""
# GENERATOR: Visual Studio 14 2015
#
#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# configuration: Release
# platform: x86
# name: with_win_header
# CXX_FLAGS: ""
# LINKER_FLAGS: ""
# CMAKE_OPTIONS: ""
# GENERATOR: Visual Studio 14 2015
#
#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# configuration: Release
# platform: x86
# CXX_FLAGS: "/permissive- /std:c++latest /utf-8"
# LINKER_FLAGS: ""
# CMAKE_OPTIONS: ""
# GENERATOR: Visual Studio 15 2017
#
#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# configuration: Release
# platform: x86
# CXX_FLAGS: ""
# LINKER_FLAGS: ""
# CMAKE_OPTIONS: "-DJSON_ImplicitConversions=OFF"
# GENERATOR: Visual Studio 16 2019
#
#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# configuration: Release
# platform: x64
# CXX_FLAGS: ""
# LINKER_FLAGS: ""
# CMAKE_OPTIONS: ""
# GENERATOR: Visual Studio 14 2015
#
#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# configuration: Release
# platform: x64
# CXX_FLAGS: "/permissive- /std:c++latest /Zc:__cplusplus /utf-8 /F4000000"
# LINKER_FLAGS: "/STACK:4000000"
# CMAKE_OPTIONS: ""
# GENERATOR: Visual Studio 15 2017

init:
- cmake --version
- msbuild /version

install:
- if "%platform%"=="x86" set GENERATOR_PLATFORM=Win32

# before_build:
# # for with_win_header build, inject the inclusion of Windows.h to the single-header library
# - ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" }
# - ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path }
# - cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On "%CMAKE_OPTIONS%"

build_script:
- ./build_simple_msvc2015.bat

#test_script:
# - if "%configuration%"=="Release" ctest -C "%configuration%" -V -j
# # On Debug builds, skip test-unicode_all
# # as it is extremely slow to run and cause
# # occasional timeouts on AppVeyor.
# # More info: https://github.com/nlohmann/json/pull/1570
# - if "%configuration%"=="Debug" ctest --exclude-regex "test-unicode" -C "%configuration%" -V -j
23 changes: 23 additions & 0 deletions build_simple_msvc2015.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@echo off

endlocal
setlocal

set CURREN_DIR=%cd%
echo %CURREN_DIR%

call "%VS140COMNTOOLS%..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat"

echo Prepare configuration
cmake -H. -Bwin-tmp -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release
if %ERRORLEVEL% GEQ 1 (
echo "Problem cmake"
EXIT /B 1
)

echo Build
cmake --build win-tmp --config Release
if %ERRORLEVEL% GEQ 1 (
echo "Problem cmake build"
EXIT /B 1
)
29 changes: 29 additions & 0 deletions ci/travis/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

check_ret() {
if [ $1 -ne 0 ]; then
echo ""
echo "!!! FAIL: $2"
echo "********************************************************************************"
echo ""
exit $1
else
echo ""
echo "*** SUCCESS: $2"
echo "********************************************************************************"
echo ""
fi
}

./build_simple.sh
check_ret $? "build"
cd ./tests/
check_ret $? "cd tests"
./run_package_installation.sh
check_ret $? "run_package_installation"
cd ../unit-tests.wsjcpp
check_ret $? "cd tests"
./build_simple.sh
check_ret $? "build tests"
./unit-tests
check_ret $? "unit-tests"
8 changes: 4 additions & 4 deletions contrib/ppa/build_source_pkg_for_ppa.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
})

dists.append({
"name": "Ubuntu 20.10 (groovy)",
"dist_name": "groovy",
"ppa_name_suffix": "ppa-ubuntu-20-10-groovy-1",
"end": "July 2021",
"name": "Ubuntu 21.04 (Hirsute Hippo)",
"dist_name": "hirsute",
"ppa_name_suffix": "ppa-ubuntu-21-04-hirsute-1",
"end": "January 2022",
"version": "20.10"
})

Expand Down
26 changes: 26 additions & 0 deletions contrib/ppa/launchpad_stats.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from launchpadlib.launchpad import Launchpad
import os

PPA_OWNER='sea5kg'
PPA='wsjcpp'
PACKAGE='wsjcpp'

cachedir = os.environ['HOME'] + '/.launchpadlib/cache/'
launchpad = Launchpad.login_anonymously('just testing', 'production', cachedir)

ppa = launchpad.people[PPA_OWNER].getPPAByName(name=PPA)
bins = ppa.getPublishedBinaries(binary_name=PACKAGE)
builds = []
total = 0
for bin in bins:
count = bin.getDownloadCount()
total += count
if (count > 0):
builds.append([count,'%s %s' % (bin.binary_package_name,bin.binary_package_version)])

builds_sorted = sorted(builds,key=lambda count: count[0],reverse=True)
for build in builds_sorted:
print(str(build[0]) + ":" + str(build[1]))
6 changes: 3 additions & 3 deletions src.wsjcpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Automaticly generated by [email protected].1
# Automaticly generated by [email protected].2
cmake_minimum_required(VERSION 3.0)

add_definitions(-DWSJCPP_APP_VERSION="v0.2.1")
add_definitions(-DWSJCPP_APP_VERSION="v0.2.2")
add_definitions(-DWSJCPP_APP_NAME="wsjcpp")

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
Expand All @@ -27,7 +27,7 @@ list (APPEND WSJCPP_INCLUDE_DIRS "./src.wsjcpp/wsjcpp_yaml/")
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_yaml/wsjcpp_yaml.cpp")
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_yaml/wsjcpp_yaml.h")

# wsjcpp-hashes:v0.1.0
# wsjcpp-hashes:v0.1.4
list (APPEND WSJCPP_INCLUDE_DIRS "./src.wsjcpp/wsjcpp_hashes/")
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_hashes/md5.cpp")
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_hashes/md5.h")
Expand Down
2 changes: 1 addition & 1 deletion src.wsjcpp/wsjcpp_arguments/wsjcpp.hold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ distribution:
- source-file: "scripts.wsjcpp/generate.WsjcppArgumentProcessor.wsjcpp-script"
target-file: "generate.WsjcppArgumentProcessor.wsjcpp-script"
type: "safe-scripting-generate"

sha1: "0575fd1da103baa29c7394c73a5bb1ffed8621f8"

unit-tests:
cases:
- name: "ArgumentsWithParams"
Expand Down
14 changes: 8 additions & 6 deletions src.wsjcpp/wsjcpp_hashes/md5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,20 +334,22 @@ MD5& MD5::finalize()
// return hex representation of digest as string
std::string MD5::hexdigest() const
{
if (!finalized)
if (!finalized) {
return "";

}
const std::string sHex = "0123456789abcdef";
char buf[33];
for (int i=0; i<16; i++)
sprintf(buf+i*2, "%02x", digest[i]);
for (int i = 0; i < 16; i++) {
buf[i*2] = sHex[digest[i] >> 4 & 0x0F];
buf[i*2+1] = sHex[digest[i] & 0x0F];
}
buf[32]=0;

return std::string(buf);
}

//////////////////////////////

std::ostream& operator<<(std::ostream& out, MD5 md5)
std::ostream& operator<<(std::ostream& out, const MD5 &md5)
{
return out << md5.hexdigest();
}
Expand Down
2 changes: 1 addition & 1 deletion src.wsjcpp/wsjcpp_hashes/smallsha1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace sha1
namespace // local
{
// Rotate an integer value to left.
inline const unsigned int rol(const unsigned int value,
inline unsigned int rol(const unsigned int value,
const unsigned int steps)
{
return ((value << steps) | (value >> (32 - steps)));
Expand Down
22 changes: 16 additions & 6 deletions src.wsjcpp/wsjcpp_hashes/wsjcpp.hold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ cmake_cxx_standard: 11
cmake_minimum_required: 3.0

name: wsjcpp-hashes
version: v0.1.0
version: v0.1.4
description: Small Collection of hashes
issues: https://github.com/wsjcpp/wsjcpp-hashes/issues

repositories:
- type: main
url: "https://github.com/wsjcpp/wsjcpp-hashes"

keywords:
- c++
- wsjcpp
Expand All @@ -28,37 +27,48 @@ authors:
# wrapper
- name: Evgenii Sopov
email: [email protected]

dependencies:
- name: "wsjcpp-core"
version: "v0.1.0"
version: "v0.2.1"
url: "https://github.com/wsjcpp/wsjcpp-core:master"
origin: "https://github.com/"
installation-dir: "./src.wsjcpp/wsjcpp_core"

distribution:
- source-file: src/md5.cpp
target-file: md5.cpp
type: "source-code"
sha1: "7464f9b0845cd15ef7fbc7b906c93823dd731571"
- source-file: src/md5.h
target-file: md5.h
type: "source-code"
sha1: "6792979b9334d1853d3562fa17ca1db7de7d4ee3"
- source-file: src/smallsha1.h
target-file: smallsha1.h
type: "source-code"
sha1: "44d204561dc64fdc0a603b02872f10cb6387e7c6"
- source-file: src/smallsha1.cpp
target-file: smallsha1.cpp
type: "source-code"
sha1: "86e0e4e57eec68be433458d2bc208b1cce4858c3"
- source-file: src/wsjcpp_hashes.cpp
target-file: wsjcpp_hashes.cpp
type: "source-code"
sha1: "1ea15831ca3f838ea19d6680e2d5cdb3c86926f4"
- source-file: src/wsjcpp_hashes.h
target-file: wsjcpp_hashes.h
type: "source-code"

sha1: "a0bd2bc1cd352ad3283943e62362bcd510ffd8a2"
unit-tests:
cases:
- name: "Md5"
description: "check md5"
- name: "Sha1"
description: "check sha1"
- name: "GetMd5File"
description: ""
- name: "GetSha1File"
description: ""
- name: "GetSha1String"
description: ""
- name: "GetMd5String"
description: ""
Loading