Skip to content

Commit

Permalink
Unify and simplify the test harness.
Browse files Browse the repository at this point in the history
The test harness was too complicated. We had two versions, one for spcomp1 tests, and one for the
shell. In addition they were invoked by a weird script generated by the build, based on templates,
with separate templates for Windows and Mac/Linux. There's no need for any of this.

The new harness is much simpler. It scans an objdir for spcomp/spshell binaries (since we could
have dual-arch builds), scans for tests, and then runs a complete testing matrix. It now supports
per-folder manifests as well.

This setup will make it easier to add new configurations and even run tests in parallel.
  • Loading branch information
dvander committed Apr 30, 2018
1 parent 6c1df80 commit f45e4cd
Show file tree
Hide file tree
Showing 182 changed files with 483 additions and 329 deletions.
7 changes: 4 additions & 3 deletions .appveyor/build.bat
Expand Up @@ -2,12 +2,13 @@
mkdir opt32 && cd opt32
C:\python27\python.exe ..\configure.py --enable-optimize --amtl=..\..\amtl
C:\python27\Scripts\ambuild
testing\test-all.x86.bat

cd ..
C:\python27\python.exe tests\runtests.py opt32


"%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
mkdir opt64 && cd opt64
C:\python27\python.exe ..\configure.py --enable-optimize --amtl=..\..\amtl --target-arch=x64
C:\python27\Scripts\ambuild
testing\test-all.x64.bat
cd ..
C:\python27\python.exe tests\runtests.py opt64
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -35,5 +35,6 @@ obj-*/
*.orig
*.smx
*.swp
*.pyc

.gdb_history
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -33,4 +33,4 @@ script:
- mkdir $AM_CC-$AM_ARCH-$AM_TYPE && cd $AM_CC-$AM_ARCH-$AM_TYPE
- CC=$AM_CC CXX=$AM_CXX python ../configure.py --enable-$AM_TYPE --target-arch=$AM_ARCH
- ambuild
- ./testing/test-all.$AM_ARCH.sh
- python $CHECKOUT_DIR/tests/runtests.py .
4 changes: 0 additions & 4 deletions AMBuildScript
Expand Up @@ -243,10 +243,6 @@ class Config(object):
SetArchFlags(compiler, arch, builder.target.platform)
return self.StaticLibraryBuilder(compiler, name, arch)

ProjectScripts = [
#'exp/tools/docparse/AMBuilder'
]

class SourcePawn(object):
def __init__(self, root, amtl):
super(SourcePawn, self).__init__()
Expand Down
97 changes: 0 additions & 97 deletions compiler/tests/runtests.py

This file was deleted.

4 changes: 2 additions & 2 deletions exp/compiler/AMBuilder
Expand Up @@ -19,7 +19,7 @@
import os

### CLI
binary = Root.StaticLibrary(builder, 'spcomp', arch)
binary = Root.StaticLibrary(builder, 'spcomp2', arch)
binary.compiler.cxxincludes += [
os.path.join(builder.sourcePath, 'include'),
os.path.join(builder.sourcePath, builder.sourceFolder),
Expand Down Expand Up @@ -66,7 +66,7 @@ binary.sources += [
]
libspcomp2 = builder.Add(binary)

binary = Root.Program(builder, 'spcomp', arch)
binary = Root.Program(builder, 'spcomp2', arch)
binary.compiler.cxxincludes += [
os.path.join(builder.sourcePath),
os.path.join(builder.sourcePath, 'include'),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/compile-only/disabled/manifest.ini
@@ -0,0 +1,2 @@
[folder]
skip = true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/compile-only/manifest.ini
@@ -0,0 +1,3 @@
[folder]
type: compile-only
compiler: spcomp
File renamed without changes.
@@ -1,4 +1,4 @@
// sp: -E
// warnings_are_errors: true

public main()
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
// sp: -E
// warnings_are_errors: true
typedef OnEggFn = function void(int a);

native void Do(OnEggFn egg);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f45e4cd

Please sign in to comment.