Skip to content

Commit

Permalink
Updating stork files, implementing the "TestApp" standard for compili…
Browse files Browse the repository at this point in the history
…ng, and adding directory for compiling a falcon-unit-* binary and developing unit tests

(refs idaholab#42 idaholab/moose#9704) (kind of refs idaholab#46)
  • Loading branch information
crswong888 committed Jun 4, 2021
1 parent 03b6be7 commit 2dc7987
Show file tree
Hide file tree
Showing 121 changed files with 436 additions and 83 deletions.
173 changes: 131 additions & 42 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ tpl/tetgen/tetgen
*-opt
*-dbg
*-oprof
*-prof
*-devel
*.e
*.nav
*.log
*.aux
*.toc
*.snm
*.csv
*.csv.*
*.dylib
*.so
*.so.*
*.gitignore*
*.vrb
*.jou
Expand All @@ -37,6 +41,7 @@ tpl/tetgen/tetgen
*.spl
*.idx
traceout*.txt
temp_print_trace.*
*.xda
*.xda.*
*.xdr
Expand All @@ -52,6 +57,7 @@ traceout*.txt
*.mpx
*.btr
*.xml
*.xml.*
*.gmv
*.plt
*.slh
Expand All @@ -66,52 +72,53 @@ traceout*.txt
*.out
*.vtk
*.vtu
*.pvtu
*.node
.depend
*.png
*.svg
*.gif
*.tif
*.jpg
*.tiff
*.ps
*.bmp
*.mp4
*.webm
*.ico
*.html
*.xyz
*Revision.h
*.json
*.json.*
*.bak
*.processor.*
.clang_complete
.failed_tests
failed-unittest
compile_commands.json
build

# Allow .e files in gold directories (7 levels)
!/gold/*.e
!/*/gold/*.e
!/*/*/gold/*.e
!/*/*/*/gold/*.e
!/*/*/*/*/gold/*.e
!/*/*/*/*/*/gold/*.e
!/*/*/*/*/*/*/gold/*.e
!/*/*/*/*/*/*/*/gold/*.e


# Allow .csv files in gold directories (7 levels)
!/gold/*.csv
!/*/gold/*.csv
!/*/*/gold/*.csv
!/*/*/*/gold/*.csv
!/*/*/*/*/gold/*.csv
!/*/*/*/*/*/gold/*.csv
!/*/*/*/*/*/*/gold/*.csv
!/*/*/*/*/*/*/*/gold/*.csv

# Allow .vtk files in gold directories (7 levels)
!/gold/*.vtk
!/*/gold/*.vtk
!/*/*/gold/*.vtk
!/*/*/*/gold/*.vtk
!/*/*/*/*/gold/*.vtk
!/*/*/*/*/*/gold/*.vtk
!/*/*/*/*/*/*/gold/*.vtk
!/*/*/*/*/*/*/*/gold/*.vtk

# Allow .vtu files in gold directories (7 levels)
!/gold/*.vtu
!/*/gold/*.vtu
!/*/*/gold/*.vtu
!/*/*/*/gold/*.vtu
!/*/*/*/*/gold/*.vtu
!/*/*/*/*/*/gold/*.vtu
!/*/*/*/*/*/*/gold/*.vtu
!/*/*/*/*/*/*/*/gold/*.vtu
# Allow certain files in gold directories
!**/gold/*.e
!**/gold/*.e-s*
!**/gold/*.csv
!**/gold/*.csv.*
!**/gold/*.vtk
!**/gold/*.vtu
!**/gold/*.pvtu
!**/gold/*.xml*
!**/gold/*.json*

peacock_run_tmp.i
yaml_dump*
test/tests/outputs/format/dump.i

# Generated header file
MooseRevision.h

# Precompiled headers
moose/include/base/Precompiled.h.gch

# test garbagge
*.FAILED.txt
Expand All @@ -128,12 +135,14 @@ yaml_dump*
.*.swp
.*.swo

framework/contrib/exodiff/exodiff

# Mac garbage
.DS_Store
*.dSYM

# Unit testing stuff
moose_unit/test_results.xml
# Unit testing stuffbmoose_unit/test_results.xml
!unit/data/csv/*.csv

# gcov code coverage files
*.gcno
Expand All @@ -147,8 +156,20 @@ moose_unit/test_results.xml
peacock_*.i
peacock_*.e

# On linux, shared libs end in .0 sometimes
libpcre-opt*
libpcre-dbg*
libmoose-opt*
libmoose-dbg*

#doxygen generated
*/doc/doxygen/html/*
*/doc/doxygen/**/*
moose/doc/doxygen/html/*
modules/*/doc/doxygen/html/*
tutorials/*/*/doc/doxygen/html/*
ICE/
framework/contrib/asio/

# Restartable Data
*.rd
Expand All @@ -160,6 +181,74 @@ peacock_*.e
*.cpa-*
*.cpr-*

# Ignore petsc arch
petsc/arch-*/*

# phase_field/tests/solution_rasterizer
out.xyz

# JIT and automatic differentiation cache files
.jitcache/
.jitdir/
tmp_jit_*

# Do not store ipython notebook checkpoints
*-checkpoint.ipynb*

# HIT
framework/contrib/hit/hit

# MooseDocs
site
python/MooseDocs/test/output
!**/doc/content/**/*.md
!**/doc/content/**/*.jpg
!**/doc/content/**/*.jpeg
!**/doc/content/**/*.gif
!**/doc/content/**/*.png
!**/doc/content/**/*.svg
!**/doc/content/**/*.ogg
!**/doc/content/**/*.webm
!**/doc/content/**/*.mp4
!**/doc/content/**/*.css
!**/doc/content/**/*.js
!**/doc/content/**/*.bib
!**/doc/content/**/*.woff
!**/doc/content/**/*.woff2
!python/MooseDocs/test/gold/**/*.json
!python/MooseDocs/test/gold/**/*.html
!python/MooseDocs/test/gold/**/*.tex
.ruby-version

# Chigger
!python/chigger/tests/**/gold/*.png
!python/chigger/tests/input/*.e*
!python/chigger/logos/*.png
!python/chigger/contrib/*.xml

# Peacock
python/peacock/tests/exodus_tab/TestOutputPlugin_repr.py
python/peacock/tests/exodus_tab/TestExodusPluginManager_repr.py
python/peacock/tests/input_tab/InputFileEditor/fsp_test.i
python/peacock/tests/postprocessor_tab/TestPostprocessorPluginManager_test_script.py
!python/peacock/tests/**/gold/*.png
!python/peacock/icons/**/*.*
!python/peacock/tests/**/input/*.*
peacock_tmp_diff.exo
*.e.diff

# configure
_configs.sed
autom4te.cache
config.status
*MooseConfig.h
*MooseConfig.h.tmp
conf_vars.mk

# GPerf performance
*.prof
*.heap

lib
include/FalconRevision.h
include/base/FalconRevision.h
Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@ include $(FRAMEWORK_DIR)/build.mk
include $(FRAMEWORK_DIR)/moose.mk

################################## MODULES ####################################
#PHASE_FIELD := yes
POROUS_FLOW := yes
TEMSOR_MESHANICS := yes
GEOCHEMISTRY := yes
POROUS_FLOW := yes
TENSOR_MECHANICS := yes
include $(MOOSE_DIR)/modules/modules.mk
###############################################################################

# dep apps
APPLICATION_DIR := $(CURDIR)
APPLICATION_NAME := falcon
BUILD_EXEC := yes
DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME))
GEN_REVISION := no
include $(FRAMEWORK_DIR)/app.mk

###############################################################################
Expand Down
13 changes: 5 additions & 8 deletions include/base/FalconApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,18 @@
/* See COPYRIGHT for full restrictions */
/****************************************************************/

#ifndef FALCONAPP_H
#define FALCONAPP_H
#pragma once

#include "MooseApp.h"

class FalconApp : public MooseApp
{
public:
static InputParameters validParams();

FalconApp(InputParameters parameters);
virtual ~FalconApp();

static void registerAll(Factory & factory, ActionFactory & action_factory, Syntax & syntax);
static void registerApps();

public:
static InputParameters validParams();
static void registerAll(Factory & f, ActionFactory & af, Syntax & s);
};

#endif //FALCONAPP_H
25 changes: 25 additions & 0 deletions scripts/install-format-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../"
hookfile="$REPO_DIR/.git/hooks/pre-commit"

if [[ -f $hookfile ]]; then
echo "'$hookfile' already exists - aborting" 1>&2
exit 1
fi

echo '#!/bin/bash
patch=$(git clang-format --diff -- $(git diff --staged --name-only -- src include tests unit))
if [[ "$patch" =~ "no modified files to format" || "$patch" =~ "clang-format did not modify any files" ]]; then
echo "" > /dev/null
else
echo ""
echo "Your code is not properly formatted." >&2
echo "Run 'git clang-format' to resolve the following issues:" >&2
echo ""
echo "$patch"
exit 1
fi
' > $hookfile

chmod a+x $hookfile
Loading

0 comments on commit 2dc7987

Please sign in to comment.