Add C# test script for macOS

Summary: - Updated README and added bash script for testing C# on macOS

Reviewed By: emilsjolander

Differential Revision: D4142507

fbshipit-source-id: c682778e42d10242e02f3fdafe8a23f906bfabc5
This commit is contained in:
Kazuki Sakamoto
2016-11-07 19:31:29 -08:00
committed by Facebook Github Bot
parent 997088ffbb
commit ba2905dd1d
2 changed files with 35 additions and 0 deletions

View File

@@ -152,5 +152,8 @@ Run `gentest/gentest.rb` to generate test code and re-run `buck test //:CSSLayou
You may need to install the latest watir-webdriver gem (`gem install watir-webdriver`) and [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/) to run `gentest/gentest.rb` Ruby script.
#### .NET
.NET testing is not integrated in buck yet, you might need to set up .NET testing environment. We have a script which to launch C# test on macOS, `csharp/tests/Facebook.CSSLayout/test_macos.sh`.
### Benchmarks
Benchmarks are located in `benchmarks/CSSBenchmark.c` and can be run with `buck run //benchmarks:benchmarks`. If you think your change has affected performance please run this before and after your change to validate that nothing has regressed.

View File

@@ -0,0 +1,32 @@
#!/bin/sh
if clang --version >/dev/null 2>&1; then true; else
echo "ERROR: Can't execute clang. You need to install Xcode and command line tools."
exit 1
fi
if mcs --version >/dev/null 2>&1; then true; else
echo "ERROR: Can't execute mcs. You need to install Mono from http://www.mono-project.com/download/ and re-login to apply PATH environment."
exit 1
fi
if mono64 --version >/dev/null 2>&1; then true; else
echo "ERROR: Can't execute mono64. You need to install Mono from http://www.mono-project.com/download/ and re-login to apply PATH environment."
exit 1
fi
NUNIT=NUnit-2.6.4/bin
if [ -d $NUNIT \
-a -f $NUNIT/nunit-console.exe \
-a -f $NUNIT/lib/nunit-console-runner.dll \
-a -f $NUNIT/lib/nunit.core.dll \
-a -f $NUNIT/lib/nunit.core.interfaces.dll \
-a -f $NUNIT/lib/nunit.util.dll ]; then true; else
curl -L -O https://github.com/nunit/nunitv2/releases/download/2.6.4/NUnit-2.6.4.zip
unzip NUnit-2.6.4.zip
rm NUnit-2.6.4.zip
fi
cd "$( dirname "$0" )"
clang -g -DCSS_ASSERT_FAIL_ENABLED -Wall -Wextra -dynamiclib -o libCSSLayout.dylib -I../../.. ../../../CSSLayout/*.c ../../CSSLayout/CSSInterop.cpp
mcs -debug -t:library -r:$NUNIT/nunit.framework.dll -out:CSSLayoutTest.dll *.cs ../../../csharp/Facebook.CSSLayout/*cs
MONO_PATH=$NUNIT mono64 --debug $NUNIT/nunit-console.exe CSSLayoutTest.dll