Skip to content
Snippets Groups Projects
Commit f0fcbbd8 authored by Thibault Martin's avatar Thibault Martin
Browse files

[tests] Add a mechanism to run `-p` automatically if needed

parent a552dbfd
No related branches found
No related tags found
No related merge requests found
...@@ -344,6 +344,35 @@ function GenerateCoverage ...@@ -344,6 +344,35 @@ function GenerateCoverage
# --- Test Suite Preparation # --- Test Suite Preparation
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
function GenerateDuneFiles
{
Head "Generating dune files..."
Cmd make run-ptests
}
function CheckDuneFiles
{
DEFAULT_FILE=tests/syntax/result/dune
if [ "$PREPARE" != "yes" ] ;
then
if [ ! -f "$DEFAULT_FILE" ] ;
then
GenerateDuneFiles
else
DATE_TEST_MODIFICATION=$(find $TESTS -type f \
-not -path "*/result*/*" \
-not -path "*/oracle*/*" \
-exec stat --printf "%Y\n" {} \+ | \
sort -n -r | head -n 1)
DATE_TEST_GENERATION=$(stat $DEFAULT_FILE --printf "%Y\n")
if [ $DATE_TEST_MODIFICATION -gt $DATE_TEST_GENERATION ] ;
then
GenerateDuneFiles
fi
fi
fi
}
function PrepareTests function PrepareTests
{ {
if [ "$TESTS" = "" ]; then if [ "$TESTS" = "" ]; then
...@@ -361,8 +390,7 @@ function PrepareTests ...@@ -361,8 +390,7 @@ function PrepareTests
fi fi
if [ "$PREPARE" = "yes" ] if [ "$PREPARE" = "yes" ]
then then
Head "Generating dune files..." GenerateDuneFiles
Cmd make run-ptests
fi fi
} }
...@@ -530,6 +558,7 @@ SetEnv ...@@ -530,6 +558,7 @@ SetEnv
PullCache PullCache
PrepareCoverage PrepareCoverage
PrepareTests PrepareTests
CheckDuneFiles
Register $TESTS Register $TESTS
RunAlias ${DUNE_ALIAS} RunAlias ${DUNE_ALIAS}
Commits ${COMMITS} Commits ${COMMITS}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment