Skip to content

Commit

Permalink
ADD, REFACTOR: Add new tests and refactor
Browse files Browse the repository at this point in the history
Refactor code in style of tannergooding/new-repo, add tests for Vector4FComparisons, Vector4FBasicMaths. Started work on tests for Vector4FVectorOperations
  • Loading branch information
john-h-k committed Jun 8, 2019
1 parent 806cbfa commit f5dc833
Show file tree
Hide file tree
Showing 75 changed files with 3,293 additions and 317 deletions.
28 changes: 23 additions & 5 deletions MathSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MathSharp", "sources\MathSh
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MathSharp.Interactive", "samples\MathSharp.Interactive\MathSharp.Interactive.csproj", "{6183BF41-9E9F-4987-A4D9-6F773D65269D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "sripts", "{1959052F-0C5C-49B1-AA18-26EC74C1F228}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{CFFDBEEC-B112-4844-B65B-56A1029CC130}"
ProjectSection(SolutionItems) = preProject
scripts\azure-pipelines.yml = scripts\azure-pipelines.yml
scripts\build.ps1 = scripts\build.ps1
scripts\build.sh = scripts\build.sh
scripts\cibuild.cmd = scripts\cibuild.cmd
scripts\cibuild.sh = scripts\cibuild.sh
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{9A2281C3-DFB9-4E5A-ABF9-7B605E61E0F5}"
Expand All @@ -19,16 +22,31 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{9A22
samples\Directory.Build.targets = samples\Directory.Build.targets
EndProjectSection
EndProject
ProjectSection(SolutionItems) = preProject
docs\CODE_OF_CONDUCT.md = docs\CODE_OF_CONDUCT.md
docs\CODEOWNERS = docs\CODEOWNERS
docs\CONTRIBUTING.md = docs\CONTRIBUTING.md
docs\ISSUE_TEMPLATE.md = docs\ISSUE_TEMPLATE.md
docs\PULL_REQUEST_TEMPLATE.md = docs\PULL_REQUEST_TEMPLATE.md
docs\README.md = docs\README.md
EndProjectSection
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6BBF0A6F-9437-4146-83A9-AD251F6BA375}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
CONTRIBUTING.md = CONTRIBUTING.md
build.cmd = build.cmd
build.sh = build.sh
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
LICENSE = LICENSE
MathSharp.snk = MathSharp.snk
README.md = README.md
LICENSE.md = LICENSE.md
THIRD-PARTY-NOTICES.txt = THIRD-PARTY-NOTICES.txt
pack.cmd = pack.cmd
pack.sh = pack.sh
restore.cmd = restore.cmd
restore.sh = restore.sh
test.cmd = test.cmd
test.sh = test.sh
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sources", "sources", "{9B19E1B6-A3A3-4D4D-AECC-75EFEE60F834}"
Expand Down
21 changes: 21 additions & 0 deletions THIRD-PARTY-NOTICES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- new-repo template - https://github.com/tannergooding/new-repo
# The MIT License (MIT)

Copyright © Tanner Gooding and Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 changes: 2 additions & 8 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@ECHO OFF
WHERE pwsh >NUL
IF %ERRORLEVEL% NEQ 0 (
echo Using PS for Windows
powershell.exe -NoLogo -NoProfile -ExecutionPolicy ByPass -Command "& """%~dp0scripts\build.ps1""" %*"
) ELSE (
echo Using PS Core 6
pwsh.exe -NoLogo -NoProfile -ExecutionPolicy ByPass -Command "& """%~dp0scripts\build.ps1""" %*" )
EXIT /B %ERRORLEVEL%
powershell.exe -NoLogo -NoProfile -ExecutionPolicy ByPass -Command "& """%~dp0scripts\build.ps1""" -build %*"
EXIT /B %ERRORLEVEL%
13 changes: 11 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
pwsh "$PWD/scripts/build.ps1 $@" ||
echo "Install Powershell Core 6.0 and use build.ps1 instead, or help develop a bash 'build.sh' see < https://github.com/opentk/MathSharp/issues/11 >"
#!/bin/bash

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$ScriptRoot/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

. "$ScriptRoot/scripts/build.sh" --build "$@"
4 changes: 4 additions & 0 deletions docs/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
###############################################################################
# Default owner for all files in the repository
###############################################################################
* @johnkellyoxford
75 changes: 75 additions & 0 deletions docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of
experience, nationality, personal appearance, race, religion, or sexual identity
and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviors that they deem inappropriate, threatening,
offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an
incident. Further details of specific enforcement policies may be posted
separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
49 changes: 49 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contributing to $NewRepo

The following is a set of guidelines for contributing to MathSharp.

## Table of Contents

* [Code of Conduct](#code-of-conduct)
* [License](#license)
* [What should I know?](#what-should-i-know)
* [Pull Requests](#pull-requests)
* [Issues](#issues)
* [Questions](#questions)

### Code of Conduct

$NewRepo and everyone contributing (this includes issues, pull requests, the
wiki, etc) must abide by the [CODE_OF_CONDUCT](docs/CODE_OF_CONDUCT.md).
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at $Email.

### License

Copyright © $Name and Contributors. Licensed under the MIT License
(MIT). See [LICENSE](LICENSE.md) in the repository root for more information.

### What should I know?

Most of the basics of the project, such as what it is about, and its goals are
covered in our [README](docs/README.md).

### Pull Requests

All pull requests should follow our
[PULL_REQUEST_TEMPLATE](docs/PULL_REQUEST_TEMPALTE.md). It is additionally
recommended that an issue be opened, discussed, and approved first to ensure
that the change will be accepted. Any pull requests not following pull request
template will be requested to be updated. Any pull requests opened without a
corresponding issue may be delayed or be required to undergo further changes
before being accepted.

### Issues

All issues should follow our [ISSUE_TEMPLATE](ISSUE_TEMPLATE.md). It is
additionaly recommended to prefix your issue with an appriopriate "tag" such as
`[QUESTION]`, `[BUG]`, `[REGRESSION]`, `[IDEA]`, or `[PROPOSAL]`.

### Questions

Feel free to open an issue prefixed with `[QUESTION]`.
105 changes: 105 additions & 0 deletions docs/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Issue Template

Please remove everything except for the template best matching your issue type
below. Then ensure you fill in the template, to the best of your abilities
before submitting.

## Table of Contents

* [Code of Conduct](#code-of-conduct)
* [Question](#question)
* [Bug](#bug)
* [Regression](#regression)
* [Idea](#idea)
* [Proposal](#proposal)

### Code of Conduct

$NewRepo and everyone contributing (this includes issues, pull requests, the
wiki, etc) must abide by the [CODE_OF_CONDUCT](docs/CODE_OF_CONDUCT.md).
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at $Email.

### Question

Questions are straightforward, just prefix your issue title with `[QUESTION]`
and state what you desire to be answered.

### Bug

Bugs need to be both reproducible or we need some other mechanism of being able
to debug and determine the root cause of failure. Please prefix your issue title
with `[BUG]` and fill out the following sections.

#### Description (optional)

This section should contain an expanded description of the bug, if the title is
not sufficient.

#### Reproduction Steps

This section should contain an ordered list of steps that can be used to
reproduce the bug. Ideally, you would include as much information about your
environment as possible to help use in determining the best fix for the issue.

#### Expected Behavior

This section should contain a description of the behavior that is expected.

#### Actual Behavior

This section should contain a description of the actual behavior being observed.

### Regression

Regressions are similar to bugs but represent functionality that worked in a
prior release but is no longer functioning as expected. Please prefix your issue
title with `[REGRESSION]` and fill out the same sections as for a [Bug](#bug).

### Idea

Requests would ideally always be well thought and come with a full proposal;
however, this is not always possible and sometimes you want input from others
before actually proposing something. Please prefix your issue title with
`[IDEA]` and give a brief summary of what you want.

### Proposals

Proposals are generally thought out and discussed ideas that are ready to be
proposed for inclusion in the project. Please prefix your issue title with
`[PROPOSAL]` and fill out the following sections.

#### Description (optional)

This section should contain an expanded description of the proposal, if the
title is not sufficient.

#### Rationale

This section should contain the reasoning behind the proposal. It should include
things like "Why do we need this", "How will it improve a developers quality of
life", etc.

#### Proposed API

This section should contain the APIs being proposed along with a brief
description of what each API does.

#### Drawbacks

This should contain any drawbacks for the proposal that came up during the
discussions.

#### Alternatives

This should contain any alternative proposals that came up during the
discussions.

#### Other thoughts

This should contain any additional thoughts or footnotes on the proposal.

#### Discussions (optional)

This section should contain a link to all discussions related to the proposal
that have been made thus far.
39 changes: 39 additions & 0 deletions docs/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Pull Request Template

Please remove everything except for the template best matching your pull request
type below. Then ensure you fill in the template, to the best of your abilities
before submitting.

## Table of Contents

* [Code of Conduct](#code-of-conduct)
* [Test or Documentation Addition](#test-or-documentation-addition)
* [Bug Fix](#bug-fix)
* [Proposal Implementation](#proposal-implementation)

### Code of Conduct

$NewRepo and everyone contributing (this includes issues, pull requests, the
wiki, etc) must abide by the [CODE_OF_CONDUCT](docs/CODE_OF_CONDUCT.md).
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at $Email.

## Test or Documentation Addition

These types of additions should just have a brief summary of what they are
doing. They do not need an attached issue. They should be prefixed with `[TEST]`
or `[DOCS]`.

## Bug Fix

Bug fixes should have a brief summary of the change as well as a link to the
issue they are resolving. They should be prefixed with `[BUG]` and should
include a regression test to ensure the bug is not introduced again in the
future.

## Proposal Implementation

Proposal implementations should also have a brief summary of the change and a
link to the proposal they are implementing. They should be prefixed with
`[IMPL]`. Ideally, they will also come with basic unit, functional, or
integration tests that validate they work as intended.
3 changes: 3 additions & 0 deletions pack.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@ECHO OFF
powershell.exe -NoLogo -NoProfile -ExecutionPolicy ByPass -Command "& """%~dp0scripts\build.ps1""" -pack %*"
EXIT /B %ERRORLEVEL%
11 changes: 11 additions & 0 deletions pack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$ScriptRoot/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

. "$ScriptRoot/scripts/build.sh" --pack "$@"
3 changes: 3 additions & 0 deletions restore.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@ECHO OFF
powershell.exe -NoLogo -NoProfile -ExecutionPolicy ByPass -Command "& """%~dp0scripts\build.ps1""" -restore %*"
EXIT /B %ERRORLEVEL%
Loading

0 comments on commit f5dc833

Please sign in to comment.