Compare commits

..

8 Commits
4.0.0 ... tests

Author SHA1 Message Date
Dylan Araps
92bf7da15a tests: Add main test file 2018-05-18 14:35:31 +10:00
Dylan Araps
5fb3ab6ee3 tests: properly set exit code. 2018-05-18 14:28:56 +10:00
Dylan Araps
3b57104997 travis: Run initial tests. 2018-05-18 14:04:20 +10:00
Dylan Araps
fbc029b1b1 general: Added tests 2018-05-18 14:03:22 +10:00
Dylan Araps
b16ff8bc4d term: Fix tmux issue. 2018-05-17 20:43:22 +10:00
Dylan Araps
bad073d78a term: Fix macOS issue 2018-05-17 20:30:46 +10:00
Dylan Araps
0f7e7b6ee0 docs: update 2018-05-17 14:02:05 +10:00
Dylan Araps
e398f1ee08 docs: update 2018-05-17 13:57:45 +10:00
7 changed files with 107 additions and 48 deletions

View File

@@ -20,3 +20,4 @@ script:
# Check for lines longer than 100 chars.
# There are 3 lines that must be longer than 100 chars.
- if (("$(grep '.\{101\}' neofetch | wc -l)" > 3)); then (exit 1); else (exit 0); fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd tests && ./test.sh; fi

View File

@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
## [4.0.0] - 2018-05-17
This release bumps the version number up to `4.0.0` as it contains major
changes to how Neofetch is packaged and installed.
@@ -24,7 +27,9 @@ it. :+1:
## Discord
Neofetch now has a Discord server. Come and join the discussion! <a
Neofetch now has a Discord server. Come and join the discussion!
<a
href="https://discord.gg/BtnTPFF"><img
src="https://img.shields.io/discord/440354555197128704.svg"></a>
@@ -2653,7 +2658,8 @@ Changelog:
Let me know if you're having issues.
[Unreleased]: https://github.com/dylanaraps/neofetch/compare/3.4.0...HEAD
[Unreleased]: https://github.com/dylanaraps/neofetch/compare/4.0.0...HEAD
[4.0.0]: https://github.com/dylanaraps/neofetch/compare/3.4.0...4.0.0
[3.4.0]: https://github.com/dylanaraps/neofetch/compare/3.3.0...3.4.0
[3.3.0]: https://github.com/dylanaraps/neofetch/compare/3.2.0...3.3.0
[3.2.0]: https://github.com/dylanaraps/neofetch/compare/3.1.0...3.2.0

View File

@@ -27,7 +27,7 @@
# SOFTWARE.
# Neofetch version.
version="4.0.0"
version="4.0.1"
bash_version="${BASH_VERSION/.*}"
sys_locale="${LANG:-C}"
@@ -831,7 +831,7 @@ stdout="off"
#
# NOTE: Don't change this value, neofetch reads this to determine
# how to handle backwards compatibility.
config_version="4.0.0"
config_version="4.0.1"
EOF
# DETECT INFORMATION
@@ -2787,14 +2787,16 @@ get_term() {
[[ -z "$parent" ]] && break
name="$(get_process_name "$parent")"
case "${name// }" in
"${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;;
"${SHELL/*\/}" | *"sh" | "screen" | "su"*) ;;
"login"* | *"Login"* | "init" | "(init)") term="$(tty)" ;;
"ruby" | "1" | "systemd" | "sshd"* | "python"* | "USER"*"PID"* | "kdeinit"*)
"ruby" | "1" | "systemd" | "sshd"* | "python"* |\
"USER"*"PID"* | "kdeinit"* | "launchd"*)
break
;;
"gnome-terminal-") term="gnome-terminal" ;;
*"nvim") term="Neovim Terminal" ;;
*"NeoVimServer"*) term="VimR Terminal" ;;
*"tmux"*) term="tmux" ;;
*) term="${name##*/}" ;;
esac
fi
@@ -8722,4 +8724,4 @@ main() {
return 0
}
main "$@"
[[ "$0" == "${BASH_SOURCE[0]}" ]] && main "$@"

View File

@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
.TH NEOFETCH "1" "May 2018" "Neofetch 4.0.0" "User Commands"
.TH NEOFETCH "1" "May 2018" "Neofetch 4.0.1" "User Commands"
.SH NAME
Neofetch \- A fast, highly customizable system info script
.SH SYNOPSIS

7
tests/test.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#
# Run all tests.
./test_misc.sh
[[ -f /tmp/err ]] || exit 0 && { rm /tmp/err; exit 1; }

32
tests/test_misc.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
#
# Test misc functions.
source test_util.sh
source ../neofetch
# Tests only work on Linux for now.
os="Linux"
test_convert_time() {
# 24 hour time.
result="$(convert_time "2016" "04" "14" "23:50")"
assert_equals "$result" "Thu 14 Apr 2016 23:50"
# 12 hour time.
install_time_format="12h"
result="$(convert_time "2016" "04" "14" "23:50")"
assert_equals "$result" "Thu 14 Apr 2016 11:50 PM"
}
test_get_ppid() {
result="$(trim "$(get_ppid "1")")"
assert_equals "$result" "0"
}
printf "%s\\n" "Test MISC functions."
test_convert_time
test_get_ppid

11
tests/test_util.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
#
# Test util functions.
assert_equals() {
# Test equality.
local status
[[ "$1" == "$2" ]] && status="✔"
printf "%s\\n" " ${status:-} : ${FUNCNAME[1]}"
[[ "$1" == "$2" ]] || { :>/tmp/err; return 1; } && return 0
}