some basic preprocessor tests
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4425 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
ea8b087593
commit
c4e4cff1d2
1 changed files with 42 additions and 0 deletions
42
Source/Tests/preprocessor.nsi
Normal file
42
Source/Tests/preprocessor.nsi
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
Name preprocessor
|
||||||
|
OutFile preprocessor.exe
|
||||||
|
|
||||||
|
!ifdef some_define_that_doesnt_exist
|
||||||
|
this should not be executed, so no error should be raised
|
||||||
|
/*
|
||||||
|
code inside comments should not be executed
|
||||||
|
!ifdef
|
||||||
|
*/
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!ifdef d1
|
||||||
|
!error "d1 is not defined!"
|
||||||
|
!else ifdef d2
|
||||||
|
!error "d2 is not defined!"
|
||||||
|
!else
|
||||||
|
# this should be compiled
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!define d1
|
||||||
|
|
||||||
|
!ifdef d1
|
||||||
|
# this should be compiled
|
||||||
|
!else ifdef d2
|
||||||
|
!error "d2 is not defined!"
|
||||||
|
!else
|
||||||
|
!error "d1 is defined!"
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!undef d1
|
||||||
|
!define d2
|
||||||
|
|
||||||
|
!ifdef d1
|
||||||
|
!error "d1 is not defined!"
|
||||||
|
!else ifdef d2
|
||||||
|
# this should be compiled
|
||||||
|
!else
|
||||||
|
!error "d2 is defined!"
|
||||||
|
!endif
|
||||||
|
|
||||||
|
Section
|
||||||
|
SectionEnd
|
Loading…
Add table
Add a link
Reference in a new issue